Author: lattner
Date: Fri Mar 26 12:10:02 2010
New Revision: 99624

URL: http://llvm.org/viewvc/llvm-project?rev=99624&view=rev
Log:
fix a bug in paste avoidance which would cause us to accidentally
form a >>=.  Patch by Abramo Bagnara, testcase by me.

Modified:
    cfe/trunk/lib/Lex/TokenConcatenation.cpp
    cfe/trunk/test/Preprocessor/output_paste_avoid.c

Modified: cfe/trunk/lib/Lex/TokenConcatenation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/TokenConcatenation.cpp?rev=99624&r1=99623&r2=99624&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/TokenConcatenation.cpp (original)
+++ cfe/trunk/lib/Lex/TokenConcatenation.cpp Fri Mar 26 12:10:02 2010
@@ -85,7 +85,7 @@
   TokenInfo[tok::star        ] |= aci_avoid_equal;           // *=
   TokenInfo[tok::exclaim     ] |= aci_avoid_equal;           // !=
   TokenInfo[tok::lessless    ] |= aci_avoid_equal;           // <<=
-  TokenInfo[tok::greaterequal] |= aci_avoid_equal;           // >>=
+  TokenInfo[tok::greatergreater] |= aci_avoid_equal;         // >>=
   TokenInfo[tok::caret       ] |= aci_avoid_equal;           // ^=
   TokenInfo[tok::equal       ] |= aci_avoid_equal;           // ==
 }

Modified: cfe/trunk/test/Preprocessor/output_paste_avoid.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/output_paste_avoid.c?rev=99624&r1=99623&r2=99624&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/output_paste_avoid.c (original)
+++ cfe/trunk/test/Preprocessor/output_paste_avoid.c Fri Mar 26 12:10:02 2010
@@ -24,3 +24,7 @@
 // Should expand to L "str" not L"str"
 // CHECK: E: L "str"
 
+// Should avoid producing >>=.
+#define equal =
+F: >>equal
+// CHECK: F: >> =


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to