summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index e8bab26907b7..40f4dc2689cd 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1728,7 +1728,8 @@ void AsmPrinter::emitFunctionBody() {
if (isVerbose()) {
// Get MachineDominatorTree or compute it on the fly if it's unavailable
- MDT = getAnalysisIfAvailable<MachineDominatorTree>();
+ auto MDTWrapper = getAnalysisIfAvailable<MachineDominatorTreeWrapperPass>();
+ MDT = MDTWrapper ? &MDTWrapper->getDomTree() : nullptr;
if (!MDT) {
OwnedMDT = std::make_unique<MachineDominatorTree>();
OwnedMDT->getBase().recalculate(*MF);
@@ -2414,8 +2415,7 @@ bool AsmPrinter::doFinalization(Module &M) {
SectionName,
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ |
COFF::IMAGE_SCN_LNK_COMDAT,
- SectionKind::getReadOnly(), Stub.first->getName(),
- COFF::IMAGE_COMDAT_SELECT_ANY));
+ Stub.first->getName(), COFF::IMAGE_COMDAT_SELECT_ANY));
emitAlignment(Align(DL.getPointerSize()));
OutStreamer->emitSymbolAttribute(Stub.first, MCSA_Global);
OutStreamer->emitLabel(Stub.first);
@@ -2463,15 +2463,11 @@ bool AsmPrinter::doFinalization(Module &M) {
emitGlobalIFunc(M, IFunc);
// Finalize debug and EH information.
- // Defer MCAssembler based constant folding due to a performance issue. The
- // label differences will be evaluated at write time.
- OutStreamer->setUseAssemblerInfoForParsing(false);
for (const HandlerInfo &HI : Handlers) {
NamedRegionTimer T(HI.TimerName, HI.TimerDescription, HI.TimerGroupName,
HI.TimerGroupDescription, TimePassesIsEnabled);
HI.Handler->endModule();
}
- OutStreamer->setUseAssemblerInfoForParsing(true);
// This deletes all the ephemeral handlers that AsmPrinter added, while
// keeping all the user-added handlers alive until the AsmPrinter is
@@ -2803,10 +2799,8 @@ void AsmPrinter::emitJumpTableInfo() {
// Defer MCAssembler based constant folding due to a performance issue. The
// label differences will be evaluated at write time.
- OutStreamer->setUseAssemblerInfoForParsing(false);
for (const MachineBasicBlock *MBB : JTBBs)
emitJumpTableEntry(MJTI, MBB, JTI);
- OutStreamer->setUseAssemblerInfoForParsing(true);
}
if (!JTInDiffSection)
OutStreamer->emitDataRegion(MCDR_DataRegionEnd);
@@ -2897,8 +2891,8 @@ bool AsmPrinter::emitSpecialLLVMGlobal(const GlobalVariable *GV) {
// For ARM64EC, print the table that maps between symbols and the
// corresponding thunks to translate between x64 and AArch64 code.
// This table is generated by AArch64Arm64ECCallLowering.
- OutStreamer->switchSection(OutContext.getCOFFSection(
- ".hybmp$x", COFF::IMAGE_SCN_LNK_INFO, SectionKind::getMetadata()));
+ OutStreamer->switchSection(
+ OutContext.getCOFFSection(".hybmp$x", COFF::IMAGE_SCN_LNK_INFO));
auto *Arr = cast<ConstantArray>(GV->getInitializer());
for (auto &U : Arr->operands()) {
auto *C = cast<Constant>(U);
@@ -3157,7 +3151,7 @@ void AsmPrinter::emitAlignment(Align Alignment, const GlobalObject *GV,
if (Alignment == Align(1))
return; // 1-byte aligned: no need to emit alignment.
- if (getCurrentSection()->getKind().isText()) {
+ if (getCurrentSection()->isText()) {
const MCSubtargetInfo *STI = nullptr;
if (this->MF)
STI = &getSubtargetInfo();
@@ -3181,6 +3175,9 @@ const MCExpr *AsmPrinter::lowerConstant(const Constant *CV) {
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV))
return MCConstantExpr::create(CI->getZExtValue(), Ctx);
+ if (const ConstantPtrAuth *CPA = dyn_cast<ConstantPtrAuth>(CV))
+ return lowerConstantPtrAuth(*CPA);
+
if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV))
return MCSymbolRefExpr::create(getSymbol(GV), Ctx);