diff options
author | John McCall <rjmccall@apple.com> | 2011-08-26 18:42:59 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-08-26 18:42:59 +0000 |
commit | 8affed5107ea79bf4d429770d2873e9c7288255e (patch) | |
tree | 8c18640102363ff26ec13ce63b4614720ab16fc6 /lib/CodeGen/CGCall.cpp | |
parent | 66c203051f052cb2f9c550338fd966075a5bdcee (diff) |
Assert that a call argument is a gl-value iff the parameter is a reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 846e1aa393..102793b48a 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1431,6 +1431,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, return emitWritebackArg(*this, args, CRE); } + assert(type->isReferenceType() == E->isGLValue() && + "reference binding to unmaterialized r-value!"); + if (type->isReferenceType()) return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0), type); |