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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174347 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2013-02-05 07:19:31 +00:00
parent 933b851485
commit ae510f3936

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);