summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:05 +0000
commitcf1b401909b5e54edfd80656b1a18eaa31f9f6f1 (patch)
treeedb0ffff2a43d84ba9b4c862b394cfeeebb36ddc /lib/CodeGen/CGDecl.cpp
parentef915aab0ac566c55bfb0d7a9f6635bb5d94d4af (diff)
downloadsrc-test2-cf1b401909b5e54edfd80656b1a18eaa31f9f6f1.tar.gz
src-test2-cf1b401909b5e54edfd80656b1a18eaa31f9f6f1.zip
Notes
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index ccd3b8d513b1..4b656ea4a879 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -1860,6 +1860,10 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, ParamValue Arg,
lt = Qualifiers::OCL_ExplicitNone;
}
+ // Load objects passed indirectly.
+ if (Arg.isIndirect() && !ArgVal)
+ ArgVal = Builder.CreateLoad(DeclPtr);
+
if (lt == Qualifiers::OCL_Strong) {
if (!isConsumed) {
if (CGM.getCodeGenOpts().OptimizationLevel == 0) {