summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt/opt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/opt/opt.cpp')
-rw-r--r--llvm/tools/opt/opt.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 73f89c0e155..a736107965c 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -593,10 +593,9 @@ int main(int argc, char **argv) {
}
if (TM) {
- // FIXME: We should dyn_cast this when supported.
- auto &LTM = static_cast<LLVMTargetMachine &>(*TM);
- Pass *TPC = LTM.createPassConfig(Passes);
- Passes.add(TPC);
+ Pass *TPC = TM->createPassConfig(Passes);
+ if (TPC)
+ Passes.add(TPC);
}
// Create a new optimization pass for each one specified on the command line
OpenPOWER on IntegriCloud