summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 129a7703e6a..9192d860ade 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1386,7 +1386,8 @@ void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
if (CodeGenOpts.KeepStaticConsts && D && isa<VarDecl>(D)) {
const auto *VD = cast<VarDecl>(D);
- if (VD->getType().isConstQualified() && VD->getStorageClass() == SC_Static)
+ if (VD->getType().isConstQualified() &&
+ VD->getStorageDuration() == SD_Static)
addUsedGlobal(GV);
}
}
@@ -2024,7 +2025,7 @@ bool CodeGenModule::MustBeEmitted(const ValueDecl *Global) {
if (CodeGenOpts.KeepStaticConsts) {
const auto *VD = dyn_cast<VarDecl>(Global);
if (VD && VD->getType().isConstQualified() &&
- VD->getStorageClass() == SC_Static)
+ VD->getStorageDuration() == SD_Static)
return true;
}
OpenPOWER on IntegriCloud