aboutsummaryrefslogtreecommitdiff
path: root/lib/LTO/LTOModule.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
commit71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch)
tree5343938942df402b49ec7300a1c25a2d4ccd5821 /lib/LTO/LTOModule.cpp
parent31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff)
Diffstat (limited to 'lib/LTO/LTOModule.cpp')
-rw-r--r--lib/LTO/LTOModule.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp
index 89aeb8000038..11f0982c6a60 100644
--- a/lib/LTO/LTOModule.cpp
+++ b/lib/LTO/LTOModule.cpp
@@ -14,11 +14,12 @@
#include "llvm/LTO/legacy/LTOModule.h"
#include "llvm/ADT/Triple.h"
+#include "llvm/Analysis/ObjectUtils.h"
#include "llvm/Bitcode/BitcodeReader.h"
-#include "llvm/CodeGen/Analysis.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Mangler.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCExpr.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.