[cfe-commits] r101794 - in /cfe/trunk: include/clang/AST/Decl.h lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenModule.h
Fariborz Jahanian
fjahanian at apple.com
Mon Apr 19 11:15:03 PDT 2010
Author: fjahanian
Date: Mon Apr 19 13:15:02 2010
New Revision: 101794
URL: http://llvm.org/viewvc/llvm-project?rev=101794&view=rev
Log:
Some renaming of methods, fixes typo
(related to PR6769).
Modified:
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.h
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=101794&r1=101793&r2=101794&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Mon Apr 19 13:15:02 2010
@@ -548,7 +548,7 @@
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();
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=101794&r1=101793&r2=101794&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Mon Apr 19 13:15:02 2010
@@ -205,7 +205,8 @@
// 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.
//
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=101794&r1=101793&r2=101794&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Apr 19 13:15:02 2010
@@ -1106,8 +1106,9 @@
bool NonGCable = VD->hasLocalStorage() && !VD->hasAttr<BlocksAttr>();
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());
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=101794&r1=101793&r2=101794&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Mon Apr 19 13:15:02 2010
@@ -171,10 +171,10 @@
/// 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;
}
More information about the cfe-commits
mailing list