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 | 3b861ec9898150947d023c6288c9a6e170df8ef3 (patch) | |
tree | 5c11e2d23b6cd1b71d56a55a09d1dc2f2ee3e31c /llvm/include | |
parent | 0597c1e53cc9e773eff07746df271cd035cc5bd2 (diff) | |
download | bcm5719-llvm-3b861ec9898150947d023c6288c9a6e170df8ef3.tar.gz bcm5719-llvm-3b861ec9898150947d023c6288c9a6e170df8ef3.zip |
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.
llvm-svn: 165490
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/DebugInfo.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/include/llvm/DebugInfo.h b/llvm/include/llvm/DebugInfo.h index 4c1d045fa0d..dae03ad1009 100644 --- a/llvm/include/llvm/DebugInfo.h +++ b/llvm/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); |