aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp22
-rw-r--r--clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp19
-rw-r--r--clang/lib/Interpreter/IncrementalParser.cpp2
3 files changed, 18 insertions, 25 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index a9c7566..8de2e75 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -23,7 +23,6 @@
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/FrontendDiagnostic.h"
-#include "clang/Frontend/FrontendPluginRegistry.h"
#include "clang/Frontend/LogDiagnosticPrinter.h"
#include "clang/Frontend/SerializedDiagnosticPrinter.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
@@ -1030,27 +1029,6 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
return !getDiagnostics().getClient()->getNumErrors();
}
-void CompilerInstance::LoadRequestedPlugins() {
- // Load any requested plugins.
- for (const std::string &Path : getFrontendOpts().Plugins) {
- std::string Error;
- if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &Error))
- getDiagnostics().Report(diag::err_fe_unable_to_load_plugin)
- << Path << Error;
- }
-
- // Check if any of the loaded plugins replaces the main AST action
- for (const FrontendPluginRegistry::entry &Plugin :
- FrontendPluginRegistry::entries()) {
- std::unique_ptr<PluginASTAction> P(Plugin.instantiate());
- if (P->getActionType() == PluginASTAction::ReplaceAction) {
- getFrontendOpts().ProgramAction = clang::frontend::PluginAction;
- getFrontendOpts().ActionName = Plugin.getName().str();
- break;
- }
- }
-}
-
/// Determine the appropriate source input kind based on language
/// options.
static Language getLanguageFromOptions(const LangOptions &LangOpts) {
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index dc8409f..b95851e 100644
--- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -203,7 +203,24 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
return true;
}
- Clang->LoadRequestedPlugins();
+ // Load any requested plugins.
+ for (const std::string &Path : Clang->getFrontendOpts().Plugins) {
+ std::string Error;
+ if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &Error))
+ Clang->getDiagnostics().Report(diag::err_fe_unable_to_load_plugin)
+ << Path << Error;
+ }
+
+ // Check if any of the loaded plugins replaces the main AST action
+ for (const FrontendPluginRegistry::entry &Plugin :
+ FrontendPluginRegistry::entries()) {
+ std::unique_ptr<PluginASTAction> P(Plugin.instantiate());
+ if (P->getActionType() == PluginASTAction::ReplaceAction) {
+ Clang->getFrontendOpts().ProgramAction = clang::frontend::PluginAction;
+ Clang->getFrontendOpts().ActionName = Plugin.getName().str();
+ break;
+ }
+ }
// Honor -mllvm.
//
diff --git a/clang/lib/Interpreter/IncrementalParser.cpp b/clang/lib/Interpreter/IncrementalParser.cpp
index 6c5a26e..897e2cd 100644
--- a/clang/lib/Interpreter/IncrementalParser.cpp
+++ b/clang/lib/Interpreter/IncrementalParser.cpp
@@ -65,8 +65,6 @@ public:
case frontend::ParseSyntaxOnly:
Act = CreateFrontendAction(CI);
break;
- case frontend::PluginAction:
- LLVM_FALLTHROUGH;
case frontend::EmitAssembly:
LLVM_FALLTHROUGH;
case frontend::EmitObj: