File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change
1
+ ; REQUIRES: plugins, examples
2
+ ; UNSUPPORTED: target={{.*windows.*}}
3
+
4
+ ; RUN: not opt < %s -load-pass-plugin=%t/nonexistant.so -disable-output 2>&1 | FileCheck %s
5
+ ; CHECK: Could not load library {{.*}}nonexistant.so
Original file line number Diff line number Diff line change 39
39
#include " llvm/Passes/PassPlugin.h"
40
40
#include " llvm/Remarks/HotnessThresholdParser.h"
41
41
#include " llvm/Support/Debug.h"
42
+ #include " llvm/Support/ErrorHandling.h"
42
43
#include " llvm/Support/FileSystem.h"
43
44
#include " llvm/Support/InitLLVM.h"
44
45
#include " llvm/Support/PluginLoader.h"
@@ -440,11 +441,8 @@ int main(int argc, char **argv) {
440
441
SmallVector<PassPlugin, 1 > PluginList;
441
442
PassPlugins.setCallback ([&](const std::string &PluginPath) {
442
443
auto Plugin = PassPlugin::Load (PluginPath);
443
- if (!Plugin) {
444
- errs () << " Failed to load passes from '" << PluginPath
445
- << " '. Request ignored.\n " ;
446
- return ;
447
- }
444
+ if (!Plugin)
445
+ report_fatal_error (Plugin.takeError (), /* gen_crash_diag=*/ false );
448
446
PluginList.emplace_back (Plugin.get ());
449
447
});
450
448
You can’t perform that action at this time.
0 commit comments