summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/ABIInfo.h
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-16 15:53:40 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-16 15:53:40 +0000
commit0a8f847e97f40cce51dc69051b964732333dc028 (patch)
treeeb78e940410796b475e4b0c4345d2f5cbba63d10 /lib/CodeGen/ABIInfo.h
parent37473829cb2308af5b268a2d58bf3d7fa2056610 (diff)
x86-64 ABI: If a type is a C++ record with either a non-trivial destructor or a non-trivial copy constructor, it should be passed in a pointer. Daniel, plz review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ABIInfo.h')
-rw-r--r--lib/CodeGen/ABIInfo.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/CodeGen/ABIInfo.h b/lib/CodeGen/ABIInfo.h
index c1a9481c4b..1ab2f55295 100644
--- a/lib/CodeGen/ABIInfo.h
+++ b/lib/CodeGen/ABIInfo.h
@@ -72,11 +72,12 @@ namespace clang {
Kind TheKind;
const llvm::Type *TypeData;
unsigned UIntData;
+ bool BoolData;
ABIArgInfo(Kind K, const llvm::Type *TD=0,
- unsigned UI=0) : TheKind(K),
- TypeData(TD),
- UIntData(UI) {}
+ unsigned UI=0, bool B = false)
+ : TheKind(K), TypeData(TD), UIntData(UI), BoolData(B) {}
+
public:
ABIArgInfo() : TheKind(Direct), TypeData(0), UIntData(0) {}
@@ -92,8 +93,8 @@ namespace clang {
static ABIArgInfo getCoerce(const llvm::Type *T) {
return ABIArgInfo(Coerce, T);
}
- static ABIArgInfo getIndirect(unsigned Alignment) {
- return ABIArgInfo(Indirect, 0, Alignment);
+ static ABIArgInfo getIndirect(unsigned Alignment, bool ByVal = true) {
+ return ABIArgInfo(Indirect, 0, Alignment, ByVal);
}
static ABIArgInfo getExpand() {
return ABIArgInfo(Expand);
@@ -113,12 +114,17 @@ namespace clang {
return TypeData;
}
- // ByVal accessors
+ // Indirect accessors
unsigned getIndirectAlign() const {
assert(TheKind == Indirect && "Invalid kind!");
return UIntData;
}
+ bool getIndirectByVal() const {
+ assert(TheKind == Indirect && "Invalid kind!");
+ return BoolData;
+ }
+
void dump() const;
};