summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-09-17 04:36:46 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-09-17 04:36:46 +0000
commit952ed8e36482cc82778acc4e51f69f7034746297 (patch)
treeb1875111e1dfbd9746c4e39cbd859b5fd0598456 /llvm/lib/IR/Function.cpp
parentb877aeb7c80afd1ae360f4368aee4bb055ed30eb (diff)
downloadbcm5719-llvm-952ed8e36482cc82778acc4e51f69f7034746297.tar.gz
bcm5719-llvm-952ed8e36482cc82778acc4e51f69f7034746297.zip
Revert "Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC)"
This reverts commit r281806. It introduces undefined behavior as an API is returning a reference to the Symtab llvm-svn: 281808
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp6
1 files changed, 2 insertions, 4 deletions
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