In C++, an initializer on a variable doesn't necessarily mean it's the definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.

llvm-svn: 94999
This commit is contained in:
Sebastian Redl
2010-02-01 20:16:42 +00:00
parent b18093e467
commit 5ca7984bb4
9 changed files with 51 additions and 57 deletions

View File

@@ -979,7 +979,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
QualType ASTTy = D->getType();
bool NonConstInit = false;
const Expr *InitExpr = D->getDefinition();
const Expr *InitExpr = D->getAnyInitializer();
if (!InitExpr) {
// This is a tentative definition; tentative definitions are