diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/FrontendAction.cpp | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 48a698368d..2b4eecd2b2 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -359,7 +359,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI, Act.reset(new TopLevelDeclTrackerAction(*AST)); if (!Act->BeginSourceFile(Clang, Clang.getFrontendOpts().Inputs[0].second, - /*IsAST=*/false)) + Clang.getFrontendOpts().Inputs[0].first)) goto error; Act->Execute(); diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 4f6ed56410..0af355c431 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -509,7 +509,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { createPreprocessor(); } - if (Act.BeginSourceFile(*this, InFile, IsAST)) { + if (Act.BeginSourceFile(*this, InFile, getFrontendOpts().Inputs[i].first)) { Act.Execute(); Act.EndSourceFile(); } diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index 87fc1227b2..66bec7c4ae 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -32,7 +32,7 @@ void FrontendAction::setCurrentFile(llvm::StringRef Value, ASTUnit *AST) { bool FrontendAction::BeginSourceFile(CompilerInstance &CI, llvm::StringRef Filename, - bool IsAST) { + InputKind InputKind) { assert(!Instance && "Already processing a source file!"); assert(!Filename.empty() && "Unexpected empty filename!"); setCurrentFile(Filename); @@ -40,6 +40,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, // AST files follow a very different path, since they share objects via the // AST unit. + bool IsAST = InputKind == IK_AST; if (IsAST) { assert(!usesPreprocessorOnly() && "Attempt to pass AST file to preprocessor only action!"); |