summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-11-13 00:54:24 +0000
committerBill Wendling <isanbard@gmail.com>2012-11-13 00:54:24 +0000
commit744611f9baebba0bcf255a62471a31abcca2f541 (patch)
tree7f82be2d6e0dc1b07aaf49eafca95b96cfd4585c /clang/lib/Driver/Tools.cpp
parent52c0b58d33385417567a404149570fd2b6895c91 (diff)
downloadbcm5719-llvm-744611f9baebba0bcf255a62471a31abcca2f541.tar.gz
bcm5719-llvm-744611f9baebba0bcf255a62471a31abcca2f541.zip
Disable accelerator tables when compiling with LTO.
LTO doesn't generate correct accelerator tables. This is due to the general lack correct of debug info for LTO. Disable it when using LTO. <rdar://problem/12401423> llvm-svn: 167799
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 00894c45479..6b113bc1c98 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3780,15 +3780,22 @@ void darwin::Link::AddLinkArgs(Compilation &C,
CmdArgs.push_back("-demangle");
}
- // If we are using LTO, then automatically create a temporary file path for
- // the linker to use, so that it's lifetime will extend past a possible
- // dsymutil step.
- if (Version[0] >= 116 && D.IsUsingLTO(Args) && NeedsTempPath(Inputs)) {
- const char *TmpPath = C.getArgs().MakeArgString(
- D.GetTemporaryPath("cc", types::getTypeTempSuffix(types::TY_Object)));
- C.addTempFile(TmpPath);
- CmdArgs.push_back("-object_path_lto");
- CmdArgs.push_back(TmpPath);
+ if (Version[0] >= 116 && D.IsUsingLTO(Args)) {
+ if (NeedsTempPath(Inputs)) {
+ // If we are using LTO, then automatically create a temporary file path
+ // for the linker to use, so that it's lifetime will extend past a
+ // possible dsymutil step.
+ const char *TmpPath = C.getArgs().MakeArgString(
+ D.GetTemporaryPath("cc", types::getTypeTempSuffix(types::TY_Object)));
+ C.addTempFile(TmpPath);
+ CmdArgs.push_back("-object_path_lto");
+ CmdArgs.push_back(TmpPath);
+ }
+
+ // FIXME: Disable the creation of accelerator tables when using LTO. They
+ // don't currently work and can cause other tools to bork.
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-dwarf-accel-tables=Disable");
}
// Derived from the "link" spec.
OpenPOWER on IntegriCloud