diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-07 09:34:28 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-07 09:34:28 +0000 |
commit | c3d0c82ab0ce17c684c0192f14059d8e4d63156c (patch) | |
tree | 807e55089c7961283637cde2a1ff1767bcc14a3b /lib/Format/UnwrappedLineParser.cpp | |
parent | f39f6ff8ea2c9136f890a47f0ab784359e9706e6 (diff) |
Remove outdated FIXME and add explanation for error handling strategy
while parsing #define's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 00710827c2..70f33ad031 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -29,8 +29,6 @@ public: : 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 @@ void UnwrappedLineParser::parsePPDefine() { } 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(); } |