[llvm] r174347 - Use the do-while(0) thing for this #define.
Bill Wendling
isanbard at gmail.com
Mon Feb 4 23:19:31 PST 2013
Author: void
Date: Tue Feb 5 01:19:31 2013
New Revision: 174347
URL: http://llvm.org/viewvc/llvm-project?rev=174347&view=rev
Log:
Use the do-while(0) thing for this #define.
Modified:
llvm/trunk/lib/AsmParser/LLLexer.cpp
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=174347&r1=174346&r2=174347&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Tue Feb 5 01:19:31 2013
@@ -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);
More information about the llvm-commits
mailing list