summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 17:50:36 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 17:50:36 +0000
commit1bbad59379c44cc46c7e99710e9a4730eed4ff75 (patch)
treed28ff007280e26e33e315e30a99a8901d3a8e81c /clang/lib/CodeGen/CGExpr.cpp
parent715f7a1bd058c64a39cc4773114dfb46ae8cc8a3 (diff)
downloadbcm5719-llvm-1bbad59379c44cc46c7e99710e9a4730eed4ff75.tar.gz
bcm5719-llvm-1bbad59379c44cc46c7e99710e9a4730eed4ff75.zip
For DR712: store on a MemberExpr whether it constitutes an odr-use.
llvm-svn: 363087
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 46b1af5e1cf..c1c9af0ddd2 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -1492,17 +1492,11 @@ CodeGenFunction::tryEmitAsConstant(DeclRefExpr *refExpr) {
static DeclRefExpr *tryToConvertMemberExprToDeclRefExpr(CodeGenFunction &CGF,
const MemberExpr *ME) {
if (auto *VD = dyn_cast<VarDecl>(ME->getMemberDecl())) {
- // FIXME: Copy this from the MemberExpr once we store it there.
- NonOdrUseReason NOUR = NOUR_None;
- if (VD->getType()->isReferenceType() &&
- VD->isUsableInConstantExpressions(CGF.getContext()))
- NOUR = NOUR_Constant;
-
// Try to emit static variable member expressions as DREs.
return DeclRefExpr::Create(
CGF.getContext(), NestedNameSpecifierLoc(), SourceLocation(), VD,
/*RefersToEnclosingVariableOrCapture=*/false, ME->getExprLoc(),
- ME->getType(), ME->getValueKind(), nullptr, nullptr, NOUR);
+ ME->getType(), ME->getValueKind(), nullptr, nullptr, ME->isNonOdrUse());
}
return nullptr;
}
OpenPOWER on IntegriCloud