diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2024-07-26 13:10:08 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-26 13:10:08 +0400 |
commit | 63e1647827f3427c5f3ad37461d84a63ba5fcdaf (patch) | |
tree | a0c9d1914ab82081e3245aebbbee1fff0dbfdcaa /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 4ce3993ee2b6ee883ef62100df68db9e10ef1dc9 (diff) | |
download | llvm-63e1647827f3427c5f3ad37461d84a63ba5fcdaf.zip llvm-63e1647827f3427c5f3ad37461d84a63ba5fcdaf.tar.gz llvm-63e1647827f3427c5f3ad37461d84a63ba5fcdaf.tar.bz2 |
CodeGen: Remove MachineModuleInfo reference from MachineFunction (#100357)
This avoids another unserializable field. Move the DbgInfoAvailable
field into the AsmPrinter, which is only really a cache/convenience
bit for checking a direct IR module metadata check.
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 6179925..40bde20 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -162,9 +162,9 @@ static inline Align getFnStackAlignment(const TargetSubtargetInfo *STI, } MachineFunction::MachineFunction(Function &F, const LLVMTargetMachine &Target, - const TargetSubtargetInfo &STI, - unsigned FunctionNum, MachineModuleInfo &mmi) - : F(F), Target(Target), STI(&STI), Ctx(mmi.getContext()), MMI(mmi) { + const TargetSubtargetInfo &STI, MCContext &Ctx, + unsigned FunctionNum) + : F(F), Target(Target), STI(&STI), Ctx(Ctx) { FunctionNumber = FunctionNum; init(); } @@ -659,9 +659,9 @@ bool MachineFunction::needsFrameMoves() const { // under this switch, we'd like .debug_frame to be precise when using -g. At // this moment, there's no way to specify that some CFI directives go into // .eh_frame only, while others go into .debug_frame only. - return getMMI().hasDebugInfo() || - getTarget().Options.ForceDwarfFrameSection || - F.needsUnwindTableEntry(); + return getTarget().Options.ForceDwarfFrameSection || + F.needsUnwindTableEntry() || + !F.getParent()->debug_compile_units().empty(); } namespace llvm { |