X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=lib%2FTarget%2FTargetMachine.cpp;h=850c93cb21b896f0306cb4e7e5a13a0ccfa4925a;hb=ecc456747ed00af4960e5f76cb0a75c56e67f776;hp=83174c20c8e9fd34902706c5f40d056ebc1bc499;hpb=966e6ca1ac8b52ac81cff0f816f779abf6432481;p=oota-llvm.git diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index 83174c20c8e..850c93cb21b 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -150,24 +150,11 @@ void TargetMachine::setOptLevel(CodeGenOpt::Level Level) const { } TargetIRAnalysis TargetMachine::getTargetIRAnalysis() { - return TargetIRAnalysis([this](Function &F) { + return TargetIRAnalysis([this](const Function &F) { return TargetTransformInfo(F.getParent()->getDataLayout()); }); } -static bool canUsePrivateLabel(const MCAsmInfo &AsmInfo, - const MCSection &Section) { - if (!AsmInfo.isSectionAtomizableBySymbols(Section)) - return true; - - // If it is not dead stripped, it is safe to use private labels. - const MCSectionMachO &SMO = cast(Section); - if (SMO.hasAttribute(MachO::S_ATTR_NO_DEAD_STRIP)) - return true; - - return false; -} - void TargetMachine::getNameWithPrefix(SmallVectorImpl &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate) const { @@ -177,11 +164,8 @@ void TargetMachine::getNameWithPrefix(SmallVectorImpl &Name, Mang.getNameWithPrefix(Name, GV, false); return; } - SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, *this); const TargetLoweringObjectFile *TLOF = getObjFileLowering(); - const MCSection *TheSection = TLOF->SectionForGlobal(GV, GVKind, Mang, *this); - bool CannotUsePrivateLabel = !canUsePrivateLabel(*AsmInfo, *TheSection); - TLOF->getNameWithPrefix(Name, GV, CannotUsePrivateLabel, Mang, *this); + TLOF->getNameWithPrefix(Name, GV, Mang, *this); } MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {