mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Use DILexicalBlockFile, rather than DILexicalBlock, to track discriminator changes to ensure discriminator changes don't introduce new DWARF DW_TAG_lexical_blocks.
Somewhat unnoticed in the original implementation of discriminators, but it could cause instructions to end up in new, small, DW_TAG_lexical_blocks due to the use of DILexicalBlock to track discriminator changes. Instead, use DILexicalBlockFile which we already use to track file changes without introducing new scopes, so it works well to track discriminator changes in the same way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216239 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -193,13 +193,11 @@ bool AddDiscriminators::runOnFunction(Function &F) {
|
||||
// Create a new lexical scope and compute a new discriminator
|
||||
// number for it.
|
||||
StringRef Filename = FirstDIL.getFilename();
|
||||
unsigned LineNumber = FirstDIL.getLineNumber();
|
||||
unsigned ColumnNumber = FirstDIL.getColumnNumber();
|
||||
DIScope Scope = FirstDIL.getScope();
|
||||
DIFile File = Builder.createFile(Filename, Scope.getDirectory());
|
||||
unsigned Discriminator = FirstDIL.computeNewDiscriminator(Ctx);
|
||||
DILexicalBlock NewScope = Builder.createLexicalBlock(
|
||||
Scope, File, LineNumber, ColumnNumber, Discriminator);
|
||||
DILexicalBlockFile NewScope =
|
||||
Builder.createLexicalBlockFile(Scope, File, Discriminator);
|
||||
DILocation NewDIL = FirstDIL.copyWithNewScope(Ctx, NewScope);
|
||||
DebugLoc newDebugLoc = DebugLoc::getFromDILocation(NewDIL);
|
||||
|
||||
|
Reference in New Issue
Block a user