diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 638f79a2452..0b76581d64b 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -656,7 +656,13 @@ void BackendConsumer::DiagnosticHandlerImpl(const DiagnosticInfo &DI) { CodeGenAction::CodeGenAction(unsigned _Act, LLVMContext *_VMContext) : Act(_Act), VMContext(_VMContext ? _VMContext : new LLVMContext), - OwnsVMContext(!_VMContext) {} + OwnsVMContext(!_VMContext) { +#ifdef NDEBUG + // FIXME: change this to be controlled by a cc1 flag that the driver passes, + // on the model of --disable-free + _VMContext.setDiscardValueNames(true); +#endif +} CodeGenAction::~CodeGenAction() { TheModule.reset(); |