Change CodeGenModule::ConstructTypeAttributes to return the calling convention
to use, and allow the ABI implementation to override the calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81593 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.h b/lib/CodeGen/CGCall.h
index 53432a2..ebf801d 100644
--- a/lib/CodeGen/CGCall.h
+++ b/lib/CodeGen/CGCall.h
@@ -60,9 +60,14 @@
ABIArgInfo info;
};
- /// The LLVM::CallingConv to use for this function.
+ /// The LLVM::CallingConv to use for this function (as specified by the
+ /// user).
unsigned CallingConvention;
+ /// The LLVM::CallingConv to actually use for this function, which may
+ /// depend on the ABI.
+ unsigned EffectiveCallingConvention;
+
unsigned NumArgs;
ArgInfo *Args;
@@ -82,8 +87,19 @@
unsigned arg_size() const { return NumArgs; }
+ /// getCallingConvention - Return the user specified calling
+ /// convention.
unsigned getCallingConvention() const { return CallingConvention; }
+ /// getEffectiveCallingConvention - Return the actual calling convention to
+ /// use, which may depend on the ABI.
+ unsigned getEffectiveCallingConvention() const {
+ return EffectiveCallingConvention;
+ }
+ void setEffectiveCallingConvention(unsigned Value) {
+ EffectiveCallingConvention = Value;
+ }
+
QualType getReturnType() const { return Args[0].type; }
ABIArgInfo &getReturnInfo() { return Args[0].info; }