summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGCall.h')
-rw-r--r--clang/lib/CodeGen/CGCall.h50
1 files changed, 7 insertions, 43 deletions
diff --git a/clang/lib/CodeGen/CGCall.h b/clang/lib/CodeGen/CGCall.h
index b66b48b823f..495baf0f9a2 100644
--- a/clang/lib/CodeGen/CGCall.h
+++ b/clang/lib/CodeGen/CGCall.h
@@ -213,46 +213,12 @@ public:
};
struct CallArg {
- private:
- union {
- RValue RV;
- LValue LV; /// The argument is semantically a load from this l-value.
- };
- bool HasLV;
-
- /// A data-flow flag to make sure getRValue and/or copyInto are not
- /// called twice for duplicated IR emission.
- mutable bool IsUsed;
-
- public:
+ RValue RV;
QualType Ty;
- CallArg(RValue rv, QualType ty)
- : RV(rv), HasLV(false), IsUsed(false), Ty(ty) {}
- CallArg(LValue lv, QualType ty)
- : LV(lv), HasLV(true), IsUsed(false), Ty(ty) {}
- bool hasLValue() const { return HasLV; }
- QualType getType() const { return Ty; }
-
- /// \returns an independent RValue. If the CallArg contains an LValue,
- /// a temporary copy is returned.
- RValue getRValue(CodeGenFunction &CGF) const;
-
- LValue getKnownLValue() const {
- assert(HasLV && !IsUsed);
- return LV;
- }
- RValue getKnownRValue() const {
- assert(!HasLV && !IsUsed);
- return RV;
- }
- void setRValue(RValue _RV) {
- assert(!HasLV);
- RV = _RV;
- }
-
- bool isAggregate() const { return HasLV || RV.isAggregate(); }
-
- void copyInto(CodeGenFunction &CGF, Address A) const;
+ bool NeedsCopy;
+ CallArg(RValue rv, QualType ty, bool needscopy)
+ : RV(rv), Ty(ty), NeedsCopy(needscopy)
+ { }
};
/// CallArgList - Type for representing both the value and type of
@@ -282,10 +248,8 @@ public:
llvm::Instruction *IsActiveIP;
};
- void add(RValue rvalue, QualType type) { push_back(CallArg(rvalue, type)); }
-
- void addUncopiedAggregate(LValue LV, QualType type) {
- push_back(CallArg(LV, type));
+ void add(RValue rvalue, QualType type, bool needscopy = false) {
+ push_back(CallArg(rvalue, type, needscopy));
}
/// Add all the arguments from another CallArgList to this one. After doing
OpenPOWER on IntegriCloud