Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit. 

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.

llvm-svn: 69681
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 8bda323..0326b34 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -291,7 +291,8 @@
   if (!isFileVarDecl() || Context.getLangOptions().CPlusPlus)
     return false;
 
-  return (!getInit() &&
+  const VarDecl *Def = 0;
+  return (!getDefinition(Def) &&
           (getStorageClass() == None || getStorageClass() == Static));
 }