summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTOCodeGenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/LTO/LTOCodeGenerator.cpp')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 2ba90fad848..8df42772d5a 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -64,17 +64,17 @@ const char* LTOCodeGenerator::getVersionString() {
LTOCodeGenerator::LTOCodeGenerator()
: Context(getGlobalContext()), Linker(new Module("ld-temp.o", Context)),
- TargetMach(NULL), EmitDwarfDebugInfo(false), ScopeRestrictionsDone(false),
- CodeModel(LTO_CODEGEN_PIC_MODEL_DEFAULT), NativeObjectFile(NULL),
- DiagHandler(NULL), DiagContext(NULL) {
+ TargetMach(nullptr), EmitDwarfDebugInfo(false),
+ ScopeRestrictionsDone(false), CodeModel(LTO_CODEGEN_PIC_MODEL_DEFAULT),
+ NativeObjectFile(nullptr), DiagHandler(nullptr), DiagContext(nullptr) {
initializeLTOPasses();
}
LTOCodeGenerator::~LTOCodeGenerator() {
delete TargetMach;
delete NativeObjectFile;
- TargetMach = NULL;
- NativeObjectFile = NULL;
+ TargetMach = nullptr;
+ NativeObjectFile = nullptr;
Linker.deleteModule();
@@ -245,7 +245,7 @@ const void* LTOCodeGenerator::compile(size_t* length,
const char *name;
if (!compile_to_file(&name, disableOpt, disableInline, disableGVNLoadPRE,
errMsg))
- return NULL;
+ return nullptr;
// remove old buffer if compile() called twice
delete NativeObjectFile;
@@ -255,7 +255,7 @@ const void* LTOCodeGenerator::compile(size_t* length,
if (error_code ec = MemoryBuffer::getFile(name, BuffPtr, -1, false)) {
errMsg = ec.message();
sys::fs::remove(NativeObjectPath);
- return NULL;
+ return nullptr;
}
NativeObjectFile = BuffPtr.release();
@@ -263,14 +263,14 @@ const void* LTOCodeGenerator::compile(size_t* length,
sys::fs::remove(NativeObjectPath);
// return buffer, unless error
- if (NativeObjectFile == NULL)
- return NULL;
+ if (!NativeObjectFile)
+ return nullptr;
*length = NativeObjectFile->getBufferSize();
return NativeObjectFile->getBufferStart();
}
bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
- if (TargetMach != NULL)
+ if (TargetMach)
return true;
std::string TripleStr = Linker.getModule()->getTargetTriple();
@@ -280,7 +280,7 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
// create target machine from info for merged modules
const Target *march = TargetRegistry::lookupTarget(TripleStr, errMsg);
- if (march == NULL)
+ if (!march)
return false;
// The relocation model is actually a static member of TargetMachine and
@@ -355,7 +355,7 @@ applyRestriction(GlobalValue &GV,
static void findUsedValues(GlobalVariable *LLVMUsed,
SmallPtrSet<GlobalValue*, 8> &UsedValues) {
- if (LLVMUsed == 0) return;
+ if (!LLVMUsed) return;
ConstantArray *Inits = cast<ConstantArray>(LLVMUsed->getInitializer());
for (unsigned i = 0, e = Inits->getNumOperands(); i != e; ++i)
@@ -579,7 +579,7 @@ LTOCodeGenerator::setDiagnosticHandler(lto_diagnostic_handler_t DiagHandler,
this->DiagHandler = DiagHandler;
this->DiagContext = Ctxt;
if (!DiagHandler)
- return Context.setDiagnosticHandler(NULL, NULL);
+ return Context.setDiagnosticHandler(nullptr, nullptr);
// Register the LTOCodeGenerator stub in the LLVMContext to forward the
// diagnostic to the external DiagHandler.
Context.setDiagnosticHandler(LTOCodeGenerator::DiagnosticHandler, this);
OpenPOWER on IntegriCloud