Change CodeGen to emit calls using (RValue,Type) list:
- Add CodeGenFunction::EmitAnyExprToTemp
o Like EmitAnyExpr, but emits aggregates to a temporary location if
none is available. Seems like this should be simpler (even aside
from using first class aggregates).
- Killed CodeGenFunction::EmitCallArg (just append the pair)
- Conversion of RValues to actual call arguments is now isolated in
CodeGenFunction::EmitCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55970 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 4d69aed..2bbbb46 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -28,6 +28,7 @@
#include "llvm/Target/TargetData.h"
#include <map>
using namespace clang;
+using namespace CodeGen;
using llvm::dyn_cast;
// The version of the runtime that this class targets. Must match the version
@@ -281,9 +282,9 @@
// Call the method
CallArgList ActualArgs;
- ActualArgs.push_back(std::make_pair(Receiver,
+ ActualArgs.push_back(std::make_pair(RValue::get(Receiver),
CGF.getContext().getObjCIdType()));
- ActualArgs.push_back(std::make_pair(cmd,
+ ActualArgs.push_back(std::make_pair(RValue::get(cmd),
CGF.getContext().getObjCSelType()));
ActualArgs.insert(ActualArgs.end(), CallArgs.begin(), CallArgs.end());
return CGF.EmitCall(imp, ResultType, ActualArgs);
@@ -328,9 +329,9 @@
// Call the method.
CallArgList ActualArgs;
- ActualArgs.push_back(std::make_pair(Receiver,
+ ActualArgs.push_back(std::make_pair(RValue::get(Receiver),
CGF.getContext().getObjCIdType()));
- ActualArgs.push_back(std::make_pair(cmd,
+ ActualArgs.push_back(std::make_pair(RValue::get(cmd),
CGF.getContext().getObjCSelType()));
ActualArgs.insert(ActualArgs.end(), CallArgs.begin(), CallArgs.end());
return CGF.EmitCall(imp, ResultType, ActualArgs);