[cfe-commits] r171717 - /cfe/trunk/lib/Format/UnwrappedLineParser.cpp

Manuel Klimek klimek at google.com
Mon Jan 7 01:34:28 PST 2013


Author: klimek
Date: Mon Jan  7 03:34:28 2013
New Revision: 171717

URL: http://llvm.org/viewvc/llvm-project?rev=171717&view=rev
Log:
Remove outdated FIXME and add explanation for error handling strategy
while parsing #define's.

Modified:
    cfe/trunk/lib/Format/UnwrappedLineParser.cpp

Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineParser.cpp?rev=171717&r1=171716&r2=171717&view=diff
==============================================================================
--- cfe/trunk/lib/Format/UnwrappedLineParser.cpp (original)
+++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp Mon Jan  7 03:34:28 2013
@@ -29,8 +29,6 @@
       : Line(Line), TokenSource(TokenSource), ResetToken(ResetToken),
         PreviousLineLevel(Line.Level), PreviousTokenSource(TokenSource) {
     TokenSource = this;
-    // FIXME: Back up all other state (errors, line indent, etc) and reset after
-    // parsing the macro.
     Line.Level = 0;
     Line.InPPDirective = true;
   }
@@ -173,6 +171,12 @@
   }
   addUnwrappedLine();
   Line.Level = 1;
+
+  // Errors during a preprocessor directive can only affect the layout of the
+  // preprocessor directive, and thus we ignore them. An alternative approach
+  // would be to use the same approach we use on the file level (no
+  // re-indentation if there was a structural error) within the macro
+  // definition.
   parseFile();
 }
 





More information about the cfe-commits mailing list