aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lli
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-05-29 02:49:00 -0700
committerStephen Hines <srhines@google.com>2014-05-29 02:49:00 -0700
commitdce4a407a24b04eebc6a376f8e62b41aaa7b071f (patch)
treedcebc53f2b182f145a2e659393bf9a0472cedf23 /tools/lli
parent220b921aed042f9e520c26cffd8282a94c66c3d5 (diff)
downloadexternal_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.zip
external_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.tar.gz
external_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.tar.bz2
Update LLVM for 3.5 rebase (r209712).
Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/RemoteMemoryManager.cpp13
-rw-r--r--tools/lli/RemoteMemoryManager.h2
-rw-r--r--tools/lli/RemoteTarget.cpp4
-rw-r--r--tools/lli/RemoteTargetExternal.cpp2
-rw-r--r--tools/lli/Unix/RPCChannel.inc4
-rw-r--r--tools/lli/lli.cpp17
6 files changed, 23 insertions, 19 deletions
diff --git a/tools/lli/RemoteMemoryManager.cpp b/tools/lli/RemoteMemoryManager.cpp
index e9f4d53..200ab75 100644
--- a/tools/lli/RemoteMemoryManager.cpp
+++ b/tools/lli/RemoteMemoryManager.cpp
@@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "lli"
#include "RemoteMemoryManager.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/ObjectImage.h"
@@ -21,6 +20,8 @@
using namespace llvm;
+#define DEBUG_TYPE "lli"
+
RemoteMemoryManager::~RemoteMemoryManager() {
for (SmallVector<Allocation, 2>::iterator
I = AllocatedSections.begin(), E = AllocatedSections.end();
@@ -178,16 +179,16 @@ void RemoteMemoryManager::setPoisonMemory(bool poison) { llvm_unreachable("Unexp
void RemoteMemoryManager::AllocateGOT() { llvm_unreachable("Unexpected!"); }
uint8_t *RemoteMemoryManager::getGOTBase() const {
llvm_unreachable("Unexpected!");
- return 0;
+ return nullptr;
}
uint8_t *RemoteMemoryManager::startFunctionBody(const Function *F, uintptr_t &ActualSize){
llvm_unreachable("Unexpected!");
- return 0;
+ return nullptr;
}
uint8_t *RemoteMemoryManager::allocateStub(const GlobalValue* F, unsigned StubSize,
unsigned Alignment) {
llvm_unreachable("Unexpected!");
- return 0;
+ return nullptr;
}
void RemoteMemoryManager::endFunctionBody(const Function *F, uint8_t *FunctionStart,
uint8_t *FunctionEnd) {
@@ -195,11 +196,11 @@ void RemoteMemoryManager::endFunctionBody(const Function *F, uint8_t *FunctionSt
}
uint8_t *RemoteMemoryManager::allocateSpace(intptr_t Size, unsigned Alignment) {
llvm_unreachable("Unexpected!");
- return 0;
+ return nullptr;
}
uint8_t *RemoteMemoryManager::allocateGlobal(uintptr_t Size, unsigned Alignment) {
llvm_unreachable("Unexpected!");
- return 0;
+ return nullptr;
}
void RemoteMemoryManager::deallocateFunctionBody(void *Body) {
llvm_unreachable("Unexpected!");
diff --git a/tools/lli/RemoteMemoryManager.h b/tools/lli/RemoteMemoryManager.h
index 11f600f..cf5d7c6 100644
--- a/tools/lli/RemoteMemoryManager.h
+++ b/tools/lli/RemoteMemoryManager.h
@@ -63,7 +63,7 @@ private:
RemoteTarget *Target;
public:
- RemoteMemoryManager() : Target(NULL) {}
+ RemoteMemoryManager() : Target(nullptr) {}
virtual ~RemoteMemoryManager();
uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
diff --git a/tools/lli/RemoteTarget.cpp b/tools/lli/RemoteTarget.cpp
index 55fc064..850fdc5 100644
--- a/tools/lli/RemoteTarget.cpp
+++ b/tools/lli/RemoteTarget.cpp
@@ -30,9 +30,9 @@ using namespace llvm;
bool RemoteTarget::allocateSpace(size_t Size, unsigned Alignment,
uint64_t &Address) {
- sys::MemoryBlock *Prev = Allocations.size() ? &Allocations.back() : NULL;
+ sys::MemoryBlock *Prev = Allocations.size() ? &Allocations.back() : nullptr;
sys::MemoryBlock Mem = sys::Memory::AllocateRWX(Size, Prev, &ErrorMsg);
- if (Mem.base() == NULL)
+ if (Mem.base() == nullptr)
return false;
if ((uintptr_t)Mem.base() % Alignment) {
ErrorMsg = "unable to allocate sufficiently aligned memory";
diff --git a/tools/lli/RemoteTargetExternal.cpp b/tools/lli/RemoteTargetExternal.cpp
index c1bc8df..fe46248 100644
--- a/tools/lli/RemoteTargetExternal.cpp
+++ b/tools/lli/RemoteTargetExternal.cpp
@@ -26,6 +26,8 @@
using namespace llvm;
+#define DEBUG_TYPE "lli"
+
bool RemoteTargetExternal::allocateSpace(size_t Size, unsigned Alignment,
uint64_t &Address) {
DEBUG(dbgs() << "Message [allocate space] size: " << Size <<
diff --git a/tools/lli/Unix/RPCChannel.inc b/tools/lli/Unix/RPCChannel.inc
index 4d245d6..6a9ae14 100644
--- a/tools/lli/Unix/RPCChannel.inc
+++ b/tools/lli/Unix/RPCChannel.inc
@@ -60,7 +60,7 @@ bool RPCChannel::createServer() {
}
// Execute the child process.
- char *args[1] = { NULL };
+ char *args[1] = { nullptr };
int rc = execv(ChildName.c_str(), args);
if (rc != 0)
perror("Error executing child process: ");
@@ -84,7 +84,7 @@ bool RPCChannel::createClient() {
return true;
}
-void RPCChannel::Wait() { wait(NULL); }
+void RPCChannel::Wait() { wait(nullptr); }
static bool CheckError(int rc, size_t Size, const char *Desc) {
if (rc < 0) {
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) {