summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/IR/Function.h3
-rw-r--r--llvm/lib/IR/Function.cpp6
2 files changed, 3 insertions, 6 deletions
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h
index 46f5edea627..129ba308004 100644
--- a/llvm/include/llvm/IR/Function.h
+++ b/llvm/include/llvm/IR/Function.h
@@ -50,8 +50,7 @@ private:
// Important things that make up a function!
BasicBlockListType BasicBlocks; ///< The basic blocks
mutable ArgumentListType ArgumentList; ///< The formal arguments
- std::unique_ptr<ValueSymbolTable>
- SymTab; ///< Symbol table of args/instructions
+ ValueSymbolTable *SymTab; ///< Symbol table of args/instructions
AttributeSet AttributeSets; ///< Parameter attributes
/*
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index f9f33fef452..fa34158e9c5 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -258,10 +258,7 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage, const Twine &name,
assert(FunctionType::isValidReturnType(getReturnType()) &&
"invalid return type");
setGlobalObjectSubClassData(0);
-
- // We only need a symbol table for a function if the context keeps value names
- if (!getContext().shouldDiscardValueNames())
- SymTab = make_unique<ValueSymbolTable>();
+ SymTab = new ValueSymbolTable();
// If the function has arguments, mark them as lazily built.
if (Ty->getNumParams())
@@ -282,6 +279,7 @@ Function::~Function() {
// Delete all of the method arguments and unlink from symbol table...
ArgumentList.clear();
+ delete SymTab;
// Remove the function from the on-the-side GC table.
clearGC();
OpenPOWER on IntegriCloud