summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-15 22:08:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-15 22:08:45 +0000
commit7dd749e6fd4c16db46ce1175aee607c55b79656e (patch)
tree2375116485686775926b9f5761b5c4369d9a8023 /clang/lib/CodeGen/CodeGenModule.h
parent455b8f41069ca322ede92f15f72ecaf4685f13f5 (diff)
downloadbcm5719-llvm-7dd749e6fd4c16db46ce1175aee607c55b79656e.tar.gz
bcm5719-llvm-7dd749e6fd4c16db46ce1175aee607c55b79656e.zip
Defer generation of tentative definitions.
- PR3980. - <rdar://problem/6762287> [irgen] crash when generating tentative definition of incomplete structure - This also avoids creating common definitions for things which are later overwritten. - XFAIL'ed external-defs.c, it isn't completing types properly yet. llvm-svn: 69231
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index a1fc7153444..e7a587fc8c0 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -117,6 +117,14 @@ class CodeGenModule : public BlockModule {
/// that *are* actually referenced. These get code generated when the module
/// is done.
std::vector<const ValueDecl*> DeferredDeclsToEmit;
+
+ /// TentativeDefinitions - A list of declarations which are
+ /// tentative definitions. Code generation for these must be
+ /// deferred because they are allowed to have incomplete type when
+ /// they are seen. This also allows us to avoid generating an extra
+ /// common definiton in situations where the tentative definition is
+ /// followed by an actual definition.
+ std::vector<const VarDecl*> TentativeDefinitions;
/// LLVMUsed - List of global values which are required to be
/// present in the object file; bitcast to i8*. This is used for
@@ -357,6 +365,7 @@ private:
void EmitGlobalDefinition(const ValueDecl *D);
void EmitGlobalFunctionDefinition(const FunctionDecl *D);
+ void EmitTentativeDefinition(const VarDecl *D);
void EmitGlobalVarDefinition(const VarDecl *D);
void EmitAliasDefinition(const ValueDecl *D);
void EmitObjCPropertyImplementations(const ObjCImplementationDecl *D);
OpenPOWER on IntegriCloud