Use the do-while(0) thing for this #define.

llvm-svn: 174347
This commit is contained in:
Bill Wendling 2013-02-05 07:19:31 +00:00
parent 741c688fe1
commit 952e5c3e61
1 changed files with 10 additions and 8 deletions

View File

@ -436,9 +436,11 @@ lltok::Kind LLLexer::LexIdentifier() {
CurPtr = KeywordEnd;
--StartChar;
unsigned Len = CurPtr-StartChar;
#define KEYWORD(STR) \
if (Len == strlen(#STR) && !memcmp(StartChar, #STR, strlen(#STR))) \
return lltok::kw_##STR;
#define KEYWORD(STR) \
do { \
if (Len == strlen(#STR) && !memcmp(StartChar, #STR, strlen(#STR))) \
return lltok::kw_##STR; \
} while (0)
KEYWORD(true); KEYWORD(false);
KEYWORD(declare); KEYWORD(define);
@ -490,11 +492,11 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(seq_cst);
KEYWORD(singlethread);
KEYWORD(nnan)
KEYWORD(ninf)
KEYWORD(nsz)
KEYWORD(arcp)
KEYWORD(fast)
KEYWORD(nnan);
KEYWORD(ninf);
KEYWORD(nsz);
KEYWORD(arcp);
KEYWORD(fast);
KEYWORD(nuw);
KEYWORD(nsw);
KEYWORD(exact);