diff options
author | Fangrui Song <i@maskray.me> | 2024-07-20 10:43:52 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-07-20 10:43:52 -0700 |
commit | aa86f4f18549583f9227276cd116dbaf5625aa78 (patch) | |
tree | 0643d1862f68b6f0dc72eb584d4698458659ea8e /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | 29be889c2c9c9a92e7ed89bd71d141961517d7e5 (diff) | |
download | llvm-aa86f4f18549583f9227276cd116dbaf5625aa78.zip llvm-aa86f4f18549583f9227276cd116dbaf5625aa78.tar.gz llvm-aa86f4f18549583f9227276cd116dbaf5625aa78.tar.bz2 |
[MC] Remove unnecessary DWARFMustBeAtTheEnd check
36a15cb975334403216e6145d4abece3026af17a introduced the
DWARFMustBeAtTheEnd check to ensure DWARF sections were placed after all
text sections to help avoid out-of-range branches for Darwin ARM. The
commit removed a Darwin ARM hack from
20e5f5ed7930efdf2bd34bf099f24ac88798c5ea (2009), likely due to a
no-longer-relevant assembler limitation.
However, this check is no longer relevant due to the following:
* Our CodeGen approach reliably places DWARF sections at the end.
* Darwin AArch32 is less relevant today.
Removing this check also addresses a minor clang cc1as crash that could
occur when text sections were placed after DWARF sections
(e9ad54b3ee905ea3a77c35ca7d6e843b2c552e0b (2015)).
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 1d13173..3092177 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -208,9 +208,8 @@ Expected<std::unique_ptr<MCStreamer>> LLVMTargetMachine::createMCStreamer( T, Context, std::unique_ptr<MCAsmBackend>(MAB), DwoOut ? MAB->createDwoObjectWriter(Out, *DwoOut) : MAB->createObjectWriter(Out), - std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll, - Options.MCOptions.MCIncrementalLinkerCompatible, - /*DWARFMustBeAtTheEnd*/ true)); + std::unique_ptr<MCCodeEmitter>(MCE), STI, /*ignore=*/false, false, + false)); break; } case CodeGenFileType::Null: @@ -284,9 +283,7 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, const Triple &T = getTargetTriple(); std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer( T, *Ctx, std::move(MAB), MAB->createObjectWriter(Out), std::move(MCE), - STI, Options.MCOptions.MCRelaxAll, - Options.MCOptions.MCIncrementalLinkerCompatible, - /*DWARFMustBeAtTheEnd*/ true)); + STI, /*ignore=*/false, false, false)); // Create the AsmPrinter, which takes ownership of AsmStreamer if successful. FunctionPass *Printer = |