summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-01-23 18:44:14 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-01-23 18:44:14 +0000
commit1e49137d34607733fde81f28747f328408d8ebd6 (patch)
tree78c39063aeeabbbb1406e82482ee2e29d97d0ad4 /clang/lib/CodeGen/CGStmtOpenMP.cpp
parent596527bca63e59a413934caf1e0b7f7d39d95d5b (diff)
downloadbcm5719-llvm-1e49137d34607733fde81f28747f328408d8ebd6.tar.gz
bcm5719-llvm-1e49137d34607733fde81f28747f328408d8ebd6.zip
[OPENMP] Replace call of EmitLoadOfLValue() by EmitLoadOfScalar(), NFC.
Replace calls of EmitLoadOfLValue() by EmitLoadOfScalar() functions if it is known that the value is scalar. llvm-svn: 323236
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 044e8195433..cdf46f04207 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -265,8 +265,7 @@ void CodeGenFunction::GenerateOpenMPCapturedVars(
} else if (CurCap->capturesThis())
CapturedVars.push_back(CXXThisValue);
else if (CurCap->capturesVariableByCopy()) {
- llvm::Value *CV =
- EmitLoadOfLValue(EmitLValue(*I), SourceLocation()).getScalarVal();
+ llvm::Value *CV = EmitLoadOfScalar(EmitLValue(*I), CurCap->getLocation());
// If the field is not a pointer, we need to save the actual value
// and load it as a void pointer.
@@ -287,7 +286,7 @@ void CodeGenFunction::GenerateOpenMPCapturedVars(
EmitStoreThroughLValue(RValue::get(CV), SrcLV);
// Load the value using the destination type pointer.
- CV = EmitLoadOfLValue(DstLV, CurCap->getLocation()).getScalarVal();
+ CV = EmitLoadOfScalar(DstLV, CurCap->getLocation());
}
CapturedVars.push_back(CV);
} else {
@@ -501,8 +500,7 @@ static llvm::Function *emitOutlinedFunctionPrologue(
Args[Cnt]->getName(), ArgLVal),
FD->getType(), AlignmentSource::Decl);
}
- auto *ExprArg =
- CGF.EmitLoadOfLValue(ArgLVal, I->getLocation()).getScalarVal();
+ auto *ExprArg = CGF.EmitLoadOfScalar(ArgLVal, I->getLocation());
auto VAT = FD->getCapturedVLAType();
VLASizes.insert({Args[Cnt], {VAT->getSizeExpr(), ExprArg}});
} else if (I->capturesVariable()) {
@@ -538,8 +536,7 @@ static llvm::Function *emitOutlinedFunctionPrologue(
} else {
// If 'this' is captured, load it into CXXThisValue.
assert(I->capturesThis());
- CXXThisValue =
- CGF.EmitLoadOfLValue(ArgLVal, I->getLocation()).getScalarVal();
+ CXXThisValue = CGF.EmitLoadOfScalar(ArgLVal, I->getLocation());
LocalAddrs.insert({Args[Cnt], {nullptr, ArgLVal.getAddress()}});
}
++Cnt;
OpenPOWER on IntegriCloud