mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-06 01:19:28 +00:00
Debug Info: Apply a default location for cleanups if none is available.
This unbreaks the debuginfo-tests testsuite by replacing the assertion with a default location. There are cleanups in helper functions that don't have a valid source location such as block copy helpers and it's not worth tracking each of them down. rdar://57630879
This commit is contained in:
parent
decee04e63
commit
338588d7cf
@ -748,6 +748,7 @@ public:
|
||||
ApplyDebugLocation(ApplyDebugLocation &&Other) : CGF(Other.CGF) {
|
||||
Other.CGF = nullptr;
|
||||
}
|
||||
ApplyDebugLocation &operator=(ApplyDebugLocation &&) = default;
|
||||
|
||||
~ApplyDebugLocation();
|
||||
|
||||
|
@ -377,11 +377,14 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
|
||||
if (HasCleanups) {
|
||||
// Make sure the line table doesn't jump back into the body for
|
||||
// the ret after it's been at EndLoc.
|
||||
Optional<ApplyDebugLocation> AL;
|
||||
if (CGDebugInfo *DI = getDebugInfo()) {
|
||||
if (OnlySimpleReturnStmts)
|
||||
DI->EmitLocation(Builder, EndLoc);
|
||||
else
|
||||
assert(EndLoc.isValid() && "no location for inlineable cleanup calls");
|
||||
// We may not have a valid end location. Try to apply it anyway, and
|
||||
// fall back to an artificial location if needed.
|
||||
AL = ApplyDebugLocation::CreateDefaultArtificial(*this, EndLoc);
|
||||
}
|
||||
|
||||
PopCleanupBlocks(PrologueCleanupDepth);
|
||||
|
Loading…
x
Reference in New Issue
Block a user