mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-05 14:34:55 +00:00
Do not directly use function names to construct new name for named metadata.
"llvm.dbg.lv.~A" is not a valid name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106438 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c79e43aee3
commit
10de3bb4fd
@ -1056,7 +1056,14 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
|
||||
// to preserve variable info in such situation then stash it in a
|
||||
// named mdnode.
|
||||
DISubprogram Fn(getDISubprogram(Context));
|
||||
const Twine FnLVName = Twine("llvm.dbg.lv.", Fn.getName());
|
||||
StringRef FName = "fn";
|
||||
if (Fn.getFunction())
|
||||
FName = Fn.getFunction()->getName();
|
||||
const Twine FnLVName = Twine("llvm.dbg.lv.", FName);
|
||||
char One = '\1';
|
||||
if (FName.startswith(StringRef(&One, 1)))
|
||||
FName = FName.substr(1);
|
||||
|
||||
NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName);
|
||||
if (!FnLocals)
|
||||
FnLocals = NamedMDNode::Create(VMContext, FnLVName, NULL, 0, &M);
|
||||
|
Loading…
x
Reference in New Issue
Block a user