summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DIE.h
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-03-22 18:47:14 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-03-22 18:47:14 +0000
commit638fe8dd62f0bd37a0ae7374eea280c224a84b6f (patch)
tree3a94a7f3218e7edab94615767ad1da9875c29fe1 /lib/CodeGen/AsmPrinter/DIE.h
parentfc91114a2e622776d003d121eebc3c1b79f418f3 (diff)
downloadllvm-638fe8dd62f0bd37a0ae7374eea280c224a84b6f.tar.gz
llvm-638fe8dd62f0bd37a0ae7374eea280c224a84b6f.tar.bz2
llvm-638fe8dd62f0bd37a0ae7374eea280c224a84b6f.tar.xz
Fix a memory leak from DIE::addSiblingOffset() by adding the DIEValue
it allocates to DwarfDebug::DIEValues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIE.h')
-rw-r--r--lib/CodeGen/AsmPrinter/DIE.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.h b/lib/CodeGen/AsmPrinter/DIE.h
index c5909faab7..1a41e2829c 100644
--- a/lib/CodeGen/AsmPrinter/DIE.h
+++ b/lib/CodeGen/AsmPrinter/DIE.h
@@ -153,7 +153,7 @@ namespace llvm {
unsigned getOffset() const { return Offset; }
unsigned getSize() const { return Size; }
const std::vector<DIE *> &getChildren() const { return Children; }
- SmallVector<DIEValue*, 32> &getValues() { return Values; }
+ const SmallVector<DIEValue*, 32> &getValues() const { return Values; }
DIE *getParent() const { return Parent; }
void setTag(unsigned Tag) { Abbrev.setTag(Tag); }
void setOffset(unsigned O) { Offset = O; }
@@ -171,8 +171,10 @@ namespace llvm {
unsigned getSiblingOffset() const { return Offset + Size; }
/// addSiblingOffset - Add a sibling offset field to the front of the DIE.
+ /// The caller is responsible for deleting the return value at or after the
+ /// same time it destroys this DIE.
///
- void addSiblingOffset();
+ DIEValue *addSiblingOffset();
/// addChild - Add a child to the DIE.
///