Avoid a couple of assertions when preprocessing with modules
1. We were hitting the NextIsPrevious assertion because we were trying to merge decl chains that were independent of each other because we had no Sema object to allow them to find existing decls. This is fixed by delaying loading the "preloaded" decls until Sema is available. 2. We were trying to get identifier info from an annotation token, which asserts. The fix is to special-case the module annotations in the preprocessed output printer. Fixed in a single commit because when you hit 1 you almost invariably hit 2 as well. llvm-svn: 217550
This commit is contained in:
@@ -332,7 +332,10 @@ void PrintPPOutputPPCallbacks::InclusionDirective(SourceLocation HashLoc,
|
||||
MoveToLine(HashLoc);
|
||||
OS << "@import " << Imported->getFullModuleName() << ";"
|
||||
<< " /* clang -E: implicit import for \"" << File->getName() << "\" */";
|
||||
// Since we want a newline after the @import, but not a #<line>, start a new
|
||||
// line immediately.
|
||||
EmittedTokensOnThisLine = true;
|
||||
startNewLineIfNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user