diff options
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r-- | tools/opt/opt.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 8ccd8e877b..e55b4b3e2a 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -532,8 +532,12 @@ int main(int argc, char **argv) { PassManager Passes; // Add an appropriate TargetLibraryInfo pass for the module's triple. - if (!M->getTargetTriple().empty()) - Passes.add(new TargetLibraryInfo(Triple(M->getTargetTriple()))); + TargetLibraryInfo *TLI = new TargetLibraryInfo(Triple(M->getTargetTriple())); + + // The -disable-simplify-libcalls flag actually disables all builtin optzns. + if (DisableSimplifyLibCalls) + TLI->disableAllFunctions(); + Passes.add(TLI); // Add an appropriate TargetData instance for this module. TargetData *TD = 0; |