summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-02-04 01:28:44 +0000
committerBob Haarman <llvm@inglorion.net>2017-02-04 01:28:44 +0000
commite2fe59fddd235104d79c382681d86cf97e9d9153 (patch)
tree677cac846b6d2c77944c3e8406cd047a4a22fbbf
parent33c33c3e86684d12adbea4f7b216b2c05abd0ac8 (diff)
downloadbcm5719-llvm-e2fe59fddd235104d79c382681d86cf97e9d9153.tar.gz
bcm5719-llvm-e2fe59fddd235104d79c382681d86cf97e9d9153.zip
fix nullptr Mangler in LTOModule
Reviewers: kcc, pcc Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D29523 llvm-svn: 294079
-rw-r--r--llvm/lib/LTO/LTOModule.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index 89aeb800003..473684255a5 100644
--- a/llvm/lib/LTO/LTOModule.cpp
+++ b/llvm/lib/LTO/LTOModule.cpp
@@ -16,6 +16,7 @@
#include "llvm/ADT/Triple.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/CodeGen/Analysis.h"
+#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/LLVMContext.h"
@@ -647,11 +648,15 @@ void LTOModule::parseMetadata() {
}
}
- // Globals
+ // Globals - we only need to do this for COFF.
+ const Triple TT(_target->getTargetTriple());
+ if (!TT.isOSBinFormatCOFF())
+ return;
+ Mangler M;
for (const NameAndAttributes &Sym : _symbols) {
if (!Sym.symbol)
continue;
- _target->getObjFileLowering()->emitLinkerFlagsForGlobal(OS, Sym.symbol);
+ emitLinkerFlagsForGlobalCOFF(OS, Sym.symbol, TT, M);
}
// Add other interesting metadata here.
OpenPOWER on IntegriCloud