aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lli/lli.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lli/lli.cpp')
-rw-r--r--tools/lli/lli.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index c0c0f9d..4cde105 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -13,7 +13,6 @@
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "lli"
#include "llvm/IR/LLVMContext.h"
#include "RemoteMemoryManager.h"
#include "RemoteTarget.h"
@@ -64,6 +63,8 @@
using namespace llvm;
+#define DEBUG_TYPE "lli"
+
namespace {
cl::opt<std::string>
InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
@@ -282,13 +283,13 @@ public:
const std::string ModuleID = M->getModuleIdentifier();
std::string CacheName;
if (!getCacheFilename(ModuleID, CacheName))
- return NULL;
+ return nullptr;
// Load the object from the cache filename
std::unique_ptr<MemoryBuffer> IRObjectBuffer;
MemoryBuffer::getFile(CacheName.c_str(), IRObjectBuffer, -1, false);
// If the file isn't there, that's OK.
if (!IRObjectBuffer)
- return NULL;
+ return nullptr;
// MCJIT will want to write into this buffer, and we don't want that
// because the file has probably just been mmapped. Instead we make
// a copy. The filed-based buffer will be released when it goes
@@ -319,8 +320,8 @@ private:
}
};
-static ExecutionEngine *EE = 0;
-static LLIObjectCache *CacheManager = 0;
+static ExecutionEngine *EE = nullptr;
+static LLIObjectCache *CacheManager = nullptr;
static void do_shutdown() {
// Cygwin-1.5 invokes DLL's dtors before atexit handler.
@@ -449,7 +450,7 @@ int main(int argc, char **argv, char * const *envp) {
Mod->setTargetTriple(Triple::normalize(TargetTriple));
// Enable MCJIT if desired.
- RTDyldMemoryManager *RTDyldMM = 0;
+ RTDyldMemoryManager *RTDyldMM = nullptr;
if (UseMCJIT && !ForceInterpreter) {
builder.setUseMCJIT(true);
if (RemoteMCJIT)
@@ -462,7 +463,7 @@ int main(int argc, char **argv, char * const *envp) {
errs() << "error: Remote process execution requires -use-mcjit\n";
exit(1);
}
- builder.setJITMemoryManager(ForceInterpreter ? 0 :
+ builder.setJITMemoryManager(ForceInterpreter ? nullptr :
JITMemoryManager::CreateDefaultMemManager());
}
@@ -533,7 +534,7 @@ int main(int argc, char **argv, char * const *envp) {
Err.print(argv[0], errs());
return 1;
}
- EE->addObjectFile(Obj.get());
+ EE->addObjectFile(std::unique_ptr<object::ObjectFile>(Obj.get()));
}
for (unsigned i = 0, e = ExtraArchives.size(); i != e; ++i) {