diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-18 22:34:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-18 22:34:03 +0000 |
commit | 188a7e00e784f78d6b5b250a64ac5c374f0fd3f0 (patch) | |
tree | 42cf098b118963de0f04a559cf3c3e0fa609ba4b /tools/opt/opt.cpp | |
parent | c19175c9d8d3c2663b682a7fe34bb22da370d5c1 (diff) | |
download | external_llvm-188a7e00e784f78d6b5b250a64ac5c374f0fd3f0.zip external_llvm-188a7e00e784f78d6b5b250a64ac5c374f0fd3f0.tar.gz external_llvm-188a7e00e784f78d6b5b250a64ac5c374f0fd3f0.tar.bz2 |
add a way to disable all builtins, wire it up to opt's -disable-simplifylibcalls flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125978 91177308-0d34-0410-b5e6-96231b3b80d8
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 8ccd8e8..e55b4b3 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; |