aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2020-01-17 17:29:34 -0800
committerDavid Blaikie <dblaikie@gmail.com>2020-01-17 17:30:24 -0800
commit46ed93315fceec4c8c3cd3defada501a55eb96e2 (patch)
tree0d36a9deb2e7ecdd07b9cd8466ea0249c3aa27ec /llvm/lib/IR/Module.cpp
parentff171acf84204c03f67a46d16ef6adb1b83c4e9b (diff)
downloadllvm-46ed93315fceec4c8c3cd3defada501a55eb96e2.zip
llvm-46ed93315fceec4c8c3cd3defada501a55eb96e2.tar.gz
llvm-46ed93315fceec4c8c3cd3defada501a55eb96e2.tar.bz2
[IR] Remove some unnecessary cleanup in Module's dtor, and use a unique_ptr to simplify some
Follow on from D72812, based on Mehdi Amini's feedback.
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 8ddbffc..eb23b12 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -71,8 +71,8 @@ template class llvm::SymbolTableListTraits<GlobalIFunc>;
//
Module::Module(StringRef MID, LLVMContext &C)
- : Context(C), Materializer(), ModuleID(MID), SourceFileName(MID), DL("") {
- ValSymTab = new ValueSymbolTable();
+ : Context(C), ValSymTab(std::make_unique<ValueSymbolTable>()),
+ Materializer(), ModuleID(MID), SourceFileName(MID), DL("") {
Context.addModule(this);
}
@@ -83,9 +83,6 @@ Module::~Module() {
FunctionList.clear();
AliasList.clear();
IFuncList.clear();
- NamedMDList.clear();
- NamedMDSymTab.clear();
- delete ValSymTab;
}
std::unique_ptr<RandomNumberGenerator> Module::createRNG(const Pass* P) const {