X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FExecutionEngine%2FRuntimeDyld%2FGDBRegistrar.cpp;h=85465715873fba19fcfb050ea7ae853e12ff322a;hp=1d0e9b3f92c2c2b2a007325c743f39ce94ba11ea;hb=e703fcb9757820fe27d9ef98ce3775d9c6d6e898;hpb=2c0470e781355a96f901fcf863f59b814eac20fa diff --git a/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp b/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp index 1d0e9b3f92c..85465715873 100644 --- a/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp @@ -45,7 +45,7 @@ extern "C" { // We put information about the JITed function in this global, which the // debugger reads. Make sure to specify the version statically, because the // debugger checks the version before we can set it during runtime. - struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 }; + struct jit_descriptor __jit_debug_descriptor = { 1, 0, nullptr, nullptr }; // Debuggers puts a breakpoint in this function. LLVM_ATTRIBUTE_NOINLINE void __jit_debug_register_code() { @@ -108,10 +108,10 @@ void NotifyDebugger(jit_code_entry* JITCodeEntry) { __jit_debug_descriptor.action_flag = JIT_REGISTER_FN; // Insert this entry at the head of the list. - JITCodeEntry->prev_entry = NULL; + JITCodeEntry->prev_entry = nullptr; jit_code_entry* NextEntry = __jit_debug_descriptor.first_entry; JITCodeEntry->next_entry = NextEntry; - if (NextEntry != NULL) { + if (NextEntry) { NextEntry->prev_entry = JITCodeEntry; } __jit_debug_descriptor.first_entry = JITCodeEntry; @@ -142,11 +142,10 @@ void GDBJITRegistrar::registerObject(const ObjectBuffer &Object) { "Second attempt to perform debug registration."); jit_code_entry* JITCodeEntry = new jit_code_entry(); - if (JITCodeEntry == 0) { + if (!JITCodeEntry) { llvm::report_fatal_error( "Allocation failed when registering a JIT entry!\n"); - } - else { + } else { JITCodeEntry->symfile_addr = Buffer; JITCodeEntry->symfile_size = Size; @@ -198,7 +197,7 @@ void GDBJITRegistrar::deregisterObjectInternal( } delete JITCodeEntry; - JITCodeEntry = NULL; + JITCodeEntry = nullptr; } llvm::ManagedStatic TheRegistrar;