Small code refactoring.
This commit is contained in:
11
module.cpp
11
module.cpp
@@ -108,14 +108,11 @@ Module::Module(const char *fn) {
|
|||||||
module = new llvm::Module(filename ? filename : "<stdin>", *g->ctx);
|
module = new llvm::Module(filename ? filename : "<stdin>", *g->ctx);
|
||||||
module->setTargetTriple(g->target.GetTripleString());
|
module->setTargetTriple(g->target.GetTripleString());
|
||||||
|
|
||||||
if (g->generateDebuggingSymbols)
|
if (g->generateDebuggingSymbols) {
|
||||||
diBuilder = new llvm::DIBuilder(*module);
|
diBuilder = new llvm::DIBuilder(*module);
|
||||||
else
|
|
||||||
diBuilder = NULL;
|
|
||||||
|
|
||||||
// If we're generating debugging symbols, let the DIBuilder know that
|
// Let the DIBuilder know that we're starting a new compilation
|
||||||
// we're starting a new compilation unit.
|
// unit.
|
||||||
if (diBuilder != NULL) {
|
|
||||||
if (filename == NULL) {
|
if (filename == NULL) {
|
||||||
// Unfortunately we can't yet call Error() since the global 'm'
|
// Unfortunately we can't yet call Error() since the global 'm'
|
||||||
// variable hasn't been initialized yet.
|
// variable hasn't been initialized yet.
|
||||||
@@ -138,6 +135,8 @@ Module::Module(const char *fn) {
|
|||||||
0 /* run time version */);
|
0 /* run time version */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
diBuilder = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user