From: Bob Haarman Date: Sat, 4 Feb 2017 01:28:44 +0000 (+0000) Subject: fix nullptr Mangler in LTOModule X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=447e81d4e268598b61b08a6751807b1d35cbc6d4;p=llvm fix nullptr Mangler in LTOModule Reviewers: kcc, pcc Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D29523 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294079 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp index 89aeb800003..473684255a5 100644 --- a/lib/LTO/LTOModule.cpp +++ b/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.