diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-10-09 08:13:15 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-10-09 08:13:15 +0000 |
commit | e97a3a4b4fccbe6283b616af93ab0117d3a7fee9 (patch) | |
tree | afe233298f0be8fd15476c640cc05e3c131a0c85 /include | |
parent | 6765834754cbb3cb0f15b4b15e98c5e73fa50066 (diff) |
Fix PR14016.
DeadArgumentElimination pass can replace one LLVM function with another,
invalidating a pointer stored in debug info metadata entry for this function.
To fix this, we collect debug info descriptors for functions before
running a DeadArgumentElimination pass and "patch" pointers in metadata nodes
if we replace a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165490 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/DebugInfo.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 4c1d045fa0..dae03ad100 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -81,6 +81,7 @@ namespace llvm { GlobalVariable *getGlobalVariableField(unsigned Elt) const; Constant *getConstantField(unsigned Elt) const; Function *getFunctionField(unsigned Elt) const; + void replaceFunctionField(unsigned Elt, Function *F); public: explicit DIDescriptor() : DbgNode(0) {} @@ -562,6 +563,7 @@ namespace llvm { bool describes(const Function *F); Function *getFunction() const { return getFunctionField(16); } + void replaceFunction(Function *F) { replaceFunctionField(16, F); } DIArray getTemplateParams() const { return getFieldAs<DIArray>(17); } DISubprogram getFunctionDeclaration() const { return getFieldAs<DISubprogram>(18); |