Skip to content
Snippets Groups Projects
Commit c3d0c82a authored by Manuel Klimek's avatar Manuel Klimek
Browse files

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
parent f39f6ff8
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,6 @@ public: ...@@ -29,8 +29,6 @@ public:
: Line(Line), TokenSource(TokenSource), ResetToken(ResetToken), : Line(Line), TokenSource(TokenSource), ResetToken(ResetToken),
PreviousLineLevel(Line.Level), PreviousTokenSource(TokenSource) { PreviousLineLevel(Line.Level), PreviousTokenSource(TokenSource) {
TokenSource = this; TokenSource = this;
// FIXME: Back up all other state (errors, line indent, etc) and reset after
// parsing the macro.
Line.Level = 0; Line.Level = 0;
Line.InPPDirective = true; Line.InPPDirective = true;
} }
...@@ -173,6 +171,12 @@ void UnwrappedLineParser::parsePPDefine() { ...@@ -173,6 +171,12 @@ void UnwrappedLineParser::parsePPDefine() {
} }
addUnwrappedLine(); addUnwrappedLine();
Line.Level = 1; 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(); parseFile();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment