}
TargetIRAnalysis TargetMachine::getTargetIRAnalysis() {
- // While targets are free to just override getTTI and rely on this analysis,
- // it would be more efficient to override and provide an analysis that could
- // directly construct that target's TTI without the virtual call.
- return TargetIRAnalysis([this](Function &) { return getTTI(); });
-}
-
-TargetTransformInfo TargetMachine::getTTI() {
- return TargetTransformInfo(getDataLayout());
+ return TargetIRAnalysis(
+ [this](Function &) { return TargetTransformInfo(getDataLayout()); });
}
static bool canUsePrivateLabel(const MCAsmInfo &AsmInfo,
return;
}
SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, *this);
- const TargetLoweringObjectFile &TLOF =
- getSubtargetImpl()->getTargetLowering()->getObjFileLowering();
- const MCSection *TheSection = TLOF.SectionForGlobal(GV, GVKind, Mang, *this);
+ const TargetLoweringObjectFile *TLOF = getObjFileLowering();
+ const MCSection *TheSection = TLOF->SectionForGlobal(GV, GVKind, Mang, *this);
bool CannotUsePrivateLabel = !canUsePrivateLabel(*AsmInfo, *TheSection);
Mang.getNameWithPrefix(Name, GV, CannotUsePrivateLabel);
}
MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {
SmallString<60> NameStr;
getNameWithPrefix(NameStr, GV, Mang);
- const TargetLoweringObjectFile &TLOF =
- getSubtargetImpl()->getTargetLowering()->getObjFileLowering();
- return TLOF.getContext().GetOrCreateSymbol(NameStr.str());
+ const TargetLoweringObjectFile *TLOF = getObjFileLowering();
+ return TLOF->getContext().GetOrCreateSymbol(NameStr.str());
}