]> granicus.if.org Git - clang/commitdiff
Some renaming of methods, fixes typo
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 19 Apr 2010 18:15:02 +0000 (18:15 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 19 Apr 2010 18:15:02 +0000 (18:15 +0000)
(related to PR6769).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101794 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenModule.h

index dcd5af57388f470db7147ada7c2463860e27e1ad..17ac81a5ae384f562ee83a374ee6c71cbbe9c3c8 100644 (file)
@@ -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();
index 58b90929f04b73819bcf9df69f35a40cd23ff3a0..ff78cc8184a48d15872e7b8da4dd82939836e7d5 100644 (file)
@@ -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.
   //
index 257f2fc4f2f62d80ed37befe2e0575b7711fcacf..7809972630be814356b230534f621b9db8622229 100644 (file)
@@ -1106,8 +1106,9 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
     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());
index 022360bfc52136f6aab84bbe975258cb4590c1e9..8bfa0b9ab79923678f14f994e78feb496c0f45a4 100644 (file)
@@ -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;
   }