mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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:
@@ -47,15 +47,6 @@ void DICompileUnit::replaceGlobalVariables(DIArray GlobalVariables) {
|
||||
get()->replaceGlobalVariables(MDGlobalVariableArray(GlobalVariables));
|
||||
}
|
||||
|
||||
DILocation DILocation::copyWithNewScope(LLVMContext &Ctx,
|
||||
DILexicalBlockFile NewScope) {
|
||||
assert(NewScope && "Expected valid scope");
|
||||
|
||||
const auto *Old = cast<MDLocation>(DbgNode);
|
||||
return DILocation(MDLocation::get(Ctx, Old->getLine(), Old->getColumn(),
|
||||
NewScope, Old->getInlinedAt()));
|
||||
}
|
||||
|
||||
unsigned DILocation::computeNewDiscriminator(LLVMContext &Ctx) {
|
||||
std::pair<const char *, unsigned> Key(getFilename().data(), getLineNumber());
|
||||
return ++Ctx.pImpl->DiscriminatorTable[Key];
|
||||
|
Reference in New Issue
Block a user