From 573faecacf5277b338f27c541c93c364ff284304 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 25 Apr 2014 04:24:47 +0000 Subject: [C++] Use 'nullptr'. Tools edition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207176 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/lli/RemoteMemoryManager.cpp | 10 +++++----- tools/lli/RemoteTarget.cpp | 4 ++-- tools/lli/lli.cpp | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'tools/lli') diff --git a/tools/lli/RemoteMemoryManager.cpp b/tools/lli/RemoteMemoryManager.cpp index 7e0f8cb76d..200ab75152 100644 --- a/tools/lli/RemoteMemoryManager.cpp +++ b/tools/lli/RemoteMemoryManager.cpp @@ -179,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) { @@ -196,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/RemoteTarget.cpp b/tools/lli/RemoteTarget.cpp index 55fc064ad3..850fdc5069 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/lli.cpp b/tools/lli/lli.cpp index 904a9e5830..f1413f302a 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -283,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 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 @@ -320,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. @@ -450,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) @@ -463,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()); } -- cgit v1.2.3