From: Fariborz Jahanian Date: Mon, 19 Apr 2010 18:15:02 +0000 (+0000) Subject: Some renaming of methods, fixes typo X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63326a53418b4853a83b360ce1dbdb10c5739fc7;p=clang Some renaming of methods, fixes typo (related to PR6769). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101794 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index dcd5af5738..17ac81a5ae 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -548,7 +548,7 @@ public: return getStorageClass() <= Register; } - /// isStaticLocal - Returns tru if a variable with function scope is a + /// isStaticLocal - Returns true if a variable with function scope is a /// static local variable. bool isStaticLocal() const { return getStorageClass() == Static && !isFileVarDecl(); diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 58b90929f0..ff78cc8184 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -205,7 +205,8 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D, // Store into LocalDeclMap before generating initializer to handle // circular references. DMEntry = GV; - CGM.setStaticLocalDeclMap(&D, GV); + if (getContext().getLangOptions().CPlusPlus) + CGM.setStaticLocalDeclAddress(&D, GV); // Make sure to evaluate VLA bounds now so that we have them for later. // diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 257f2fc4f2..7809972630 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1106,8 +1106,9 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { bool NonGCable = VD->hasLocalStorage() && !VD->hasAttr(); llvm::Value *V = LocalDeclMap[VD]; - if (!V && VD->isStaticLocal()) - V = CGM.getStaticLocalDeclMap(VD); + if (!V && getContext().getLangOptions().CPlusPlus && + VD->isStaticLocal()) + V = CGM.getStaticLocalDeclAddress(VD); assert(V && "DeclRefExpr not entered in LocalDeclMap?"); Qualifiers Quals = MakeQualifiers(E->getType()); diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 022360bfc5..8bfa0b9ab7 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -171,10 +171,10 @@ public: /// been configured. bool hasObjCRuntime() { return !!Runtime; } - llvm::Value *getStaticLocalDeclMap(const VarDecl *VD) { + llvm::Value *getStaticLocalDeclAddress(const VarDecl *VD) { return StaticLocalDeclMap[VD]; } - void setStaticLocalDeclMap(const VarDecl *D, + void setStaticLocalDeclAddress(const VarDecl *D, llvm::GlobalVariable *GV) { StaticLocalDeclMap[D] = GV; }