diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-11 17:50:36 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-11 17:50:36 +0000 |
commit | 1bbad59379c44cc46c7e99710e9a4730eed4ff75 (patch) | |
tree | d28ff007280e26e33e315e30a99a8901d3a8e81c /clang/lib/CodeGen/CGExpr.cpp | |
parent | 715f7a1bd058c64a39cc4773114dfb46ae8cc8a3 (diff) | |
download | bcm5719-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.cpp | 8 |
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; } |