summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-01 18:09:32 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-01 18:09:32 +0000
commitce47a05c7c5251fa8d0e4e6d9610b774d53a5e7c (patch)
treefd31f1aaecfcc9173af945fdcb1f0dcb6d019982 /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
parent9e5b6a08d425401b97d5ed3182d4c2f7111ca6b3 (diff)
downloadbcm5719-llvm-ce47a05c7c5251fa8d0e4e6d9610b774d53a5e7c.tar.gz
bcm5719-llvm-ce47a05c7c5251fa8d0e4e6d9610b774d53a5e7c.zip
Replace comment about ownership with std::unique_ptr.
llvm-svn: 214533
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 2ed267b3161..435ffd7cdfa 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -87,10 +87,6 @@ MCJIT::~MCJIT() {
}
LoadedObjects.clear();
-
- for (object::Archive *A : Archives)
- delete A;
-
Archives.clear();
delete TM;
@@ -118,8 +114,8 @@ void MCJIT::addObjectFile(std::unique_ptr<object::ObjectFile> Obj) {
NotifyObjectEmitted(*LoadedObject);
}
-void MCJIT::addArchive(object::Archive *A) {
- Archives.push_back(A);
+void MCJIT::addArchive(std::unique_ptr<object::Archive> A) {
+ Archives.push_back(std::move(A));
}
@@ -294,7 +290,7 @@ uint64_t MCJIT::getSymbolAddress(const std::string &Name,
if (Addr)
return Addr;
- for (object::Archive *A : Archives) {
+ for (std::unique_ptr<object::Archive> &A : Archives) {
// Look for our symbols in each Archive
object::Archive::child_iterator ChildIt = A->findSym(Name);
if (ChildIt != A->child_end()) {
OpenPOWER on IntegriCloud