AddDiscriminators: Create new MDLocation directly

I don't see a reason to add the `copyWithNewScope()` API over to
`MDLocation` -- it seems to be a holdover from when creating locations
required knowing details of operand layout -- so change
`AddDiscriminators` to call `MDLocation::get()` directly.  Should be no
functionality change here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-14 00:34:30 +00:00
parent 7b161773fd
commit 31bbd1ac1e
3 changed files with 3 additions and 13 deletions

View File

@ -198,7 +198,9 @@ bool AddDiscriminators::runOnFunction(Function &F) {
unsigned Discriminator = FirstDIL.computeNewDiscriminator(Ctx);
DILexicalBlockFile NewScope =
Builder.createLexicalBlockFile(Scope, File, Discriminator);
DILocation NewDIL = FirstDIL.copyWithNewScope(Ctx, NewScope);
DILocation NewDIL =
MDLocation::get(Ctx, FirstDIL->getLine(), FirstDIL->getColumn(),
NewScope, FirstDIL->getInlinedAt());
DebugLoc newDebugLoc = NewDIL.get();
// Attach this new debug location to First and every