From 5ca7984bb4fe32623d40a7f1cd9691eb21eb3560 Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Mon, 1 Feb 2010 20:16:42 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 1773b41..84a3c31 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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 -- cgit v1.1