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 dcd5af5..17ac81a 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -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();
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 58b9092..ff78cc8 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -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.
//
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 257f2fc..7809972 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -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());
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index 022360b..8bfa0b9 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -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;
}