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();
// 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.
//
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());
/// 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;
}