summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-04-19 18:15:02 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-04-19 18:15:02 +0000
commit4d55b2d049760b9f81d3dc4af6a751537fc0e666 (patch)
treea1895b5706c05686141ebc32cff89ea185542252
parente6a9912a76caaa3f21d732fbdd53788f61d8ad29 (diff)
downloadbcm5719-llvm-4d55b2d049760b9f81d3dc4af6a751537fc0e666.tar.gz
bcm5719-llvm-4d55b2d049760b9f81d3dc4af6a751537fc0e666.zip
Some renaming of methods, fixes typo
(related to PR6769). llvm-svn: 101794
-rw-r--r--clang/include/clang/AST/Decl.h2
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp3
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp5
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h4
4 files changed, 8 insertions, 6 deletions
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index dcd5af57388..17ac81a5ae3 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/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/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 58b90929f04..ff78cc8184a 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/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/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 257f2fc4f2f..7809972630b 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -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());
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 022360bfc52..8bfa0b9ab79 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/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;
}
OpenPOWER on IntegriCloud