aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp2
-rw-r--r--lib/VMCore/Value.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index a5c28fcc76..cb181d2810 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1088,7 +1088,7 @@ static void WriteValueSymbolTable(const ValueSymbolTable &VST,
// VST_ENTRY: [valueid, namechar x N]
// VST_BBENTRY: [bbid, namechar x N]
unsigned Code;
- if (isa<BasicBlock>(*SI->getValue())) {
+ if (isa<BasicBlock>(SI->getValue())) {
Code = bitc::VST_CODE_BBENTRY;
if (isChar6)
AbbrevToUse = VST_BBENTRY_6_ABBREV;
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 8710b9461e..2cdd55217c 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -57,14 +57,6 @@ Value::Value(const Type *ty, unsigned scid)
}
Value::~Value() {
- // If this value is named, destroy the name. This should not be in a symtab
- // at this point.
- if (Name)
- Name->Destroy();
-
- // There should be no uses of this object anymore, remove it.
- LeakDetector::removeGarbageObject(this);
-
// Notify all ValueHandles (if present) that this value is going away.
if (HasValueHandle)
ValueHandleBase::ValueIsDeleted(this);
@@ -84,6 +76,14 @@ Value::~Value() {
}
#endif
assert(use_empty() && "Uses remain when a value is destroyed!");
+
+ // If this value is named, destroy the name. This should not be in a symtab
+ // at this point.
+ if (Name)
+ Name->Destroy();
+
+ // There should be no uses of this object anymore, remove it.
+ LeakDetector::removeGarbageObject(this);
}
/// hasNUses - Return true if this Value has exactly N users.