mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Before setting scope end marker, pay attention to scope begin marker and existing scope end marker, if any. Scope must begin before it ends and nested inlined scope do not truncate surrounding scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96445 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -238,7 +238,18 @@ public:
|
||||
LIndex = DSI;
|
||||
}
|
||||
}
|
||||
setLastInsn(LastInsn);
|
||||
|
||||
unsigned CurrentLastInsnIndex = 0;
|
||||
if (const MachineInstr *CL = getLastInsn())
|
||||
CurrentLastInsnIndex = MIIndexMap[CL];
|
||||
unsigned FIndex = MIIndexMap[getFirstInsn()];
|
||||
|
||||
// Set LastInsn as the last instruction for this scope only if
|
||||
// it follows
|
||||
// 1) this scope's first instruction and
|
||||
// 2) current last instruction for this scope, if any.
|
||||
if (LIndex >= CurrentLastInsnIndex && LIndex >= FIndex)
|
||||
setLastInsn(LastInsn);
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
Reference in New Issue
Block a user