[cfe-commits] r44144 - /cfe/trunk/Driver/RewriteTest.cpp

Chris Lattner sabre at nondot.org
Wed Nov 14 14:57:51 PST 2007


Author: lattner
Date: Wed Nov 14 16:57:51 2007
New Revision: 44144

URL: http://llvm.org/viewvc/llvm-project?rev=44144&view=rev
Log:
Fix a rewriter bug that steve noticed.   Don't skip arbitrary things
between an @ and a p, just skip whitespace.


Modified:
    cfe/trunk/Driver/RewriteTest.cpp

Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=44144&r1=44143&r2=44144&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Wed Nov 14 16:57:51 2007
@@ -1178,7 +1178,10 @@
     while (cursor < endBuf) {
       if (*cursor == '@') {
         SourceLocation atLoc = LocStart.getFileLocWithOffset(cursor-startBuf);
-        cursor = strchr(cursor, 'p');
+        // Skip whitespace.
+        for (++cursor; cursor[0] == ' ' || cursor[0] == '\t'; ++cursor)
+          /*scan*/;
+
         // FIXME: presence of @public, etc. inside comment results in
         // this transformation as well, which is still correct c-code.
         if (!strncmp(cursor, "public", strlen("public")) ||





More information about the cfe-commits mailing list