diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-11 17:50:37 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-11 17:50:37 +0000 |
| commit | e75ebf573f7f71e65e7bdfa288254237eb563255 (patch) | |
| tree | 56b7263f030a654575141f3e0b75c6915d7356ff /lib/CodeGen/CGExpr.cpp | |
| parent | 4bd25fda3f577f5c23687e7559a4f8af1d4db6c1 (diff) | |
| download | clang-e75ebf573f7f71e65e7bdfa288254237eb563255.tar.gz | |
Remove redundant check for whether a DeclRefExpr that names a capture
constitutes an odr-use.
We now track this accurately on the DeclRefExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index c1c9af0ddd..d5ce4870f1 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -2463,16 +2463,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { // A DeclRefExpr for a reference initialized by a constant expression can // appear without being odr-used. Directly emit the constant initializer. VD->getAnyInitializer(VD); - const auto *BD = dyn_cast_or_null<BlockDecl>(CurCodeDecl); - if (E->isNonOdrUse() == NOUR_Constant && VD->getType()->isReferenceType() && - // Do not emit if it is private OpenMP variable. - // FIXME: This should be handled in odr-use marking, not here. - !(E->refersToEnclosingVariableOrCapture() && - ((CapturedStmtInfo && - (LocalDeclMap.count(VD->getCanonicalDecl()) || - CapturedStmtInfo->lookup(VD->getCanonicalDecl()))) || - LambdaCaptureFields.lookup(VD->getCanonicalDecl()) || - (BD && BD->capturesVariable(VD))))) { + if (E->isNonOdrUse() == NOUR_Constant && VD->getType()->isReferenceType()) { llvm::Constant *Val = ConstantEmitter(*this).emitAbstract(E->getLocation(), *VD->evaluateValue(), |
