diff options
author | John McCall <rjmccall@apple.com> | 2011-08-26 21:08:13 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-08-26 21:08:13 +0000 |
commit | cec52f0623d57f090e3477941acebe4932fa7abd (patch) | |
tree | 36a15399a3730b3df1fd3f64fd84199561edcfaf /lib/CodeGen/CGCall.cpp | |
parent | 417162cc3bbc608372bdd0b6679a925de6874c88 (diff) |
Slight optimization enabled by the previous assert:
emit all gl-value arguments as reference bindings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 102793b48a..f7cb5492a8 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1434,9 +1434,11 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, assert(type->isReferenceType() == E->isGLValue() && "reference binding to unmaterialized r-value!"); - if (type->isReferenceType()) + if (E->isGLValue()) { + assert(E->getObjectKind() == OK_Ordinary); return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0), type); + } if (hasAggregateLLVMType(type) && !E->getType()->isAnyComplexType() && isa<ImplicitCastExpr>(E) && |