From c0ff7448d758fae2168bb0d09a5893d6a7aeb5ed Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 9 Dec 2013 14:59:08 +0000 Subject: When we decide to output a deferred decl, remember the llvm GlobalValue. We can reuse it to avoid a DenseMap+StringMap lookup to find if it was already emitted or not. This fixes a 2010 TODO. llvm-svn: 196785 --- clang/lib/CodeGen/ModuleBuilder.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp') diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index bc7acbc39ca..6b81ce7fb09 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/lib/CodeGen/ModuleBuilder.cpp @@ -117,6 +117,8 @@ namespace { virtual void HandleTranslationUnit(ASTContext &Ctx) { if (Diags.hasErrorOccurred()) { + if (Builder) + Builder->clear(); M.reset(); return; } -- cgit v1.2.3