summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-10-21 05:17:08 -0500
committerGitHub <noreply@github.com>2016-10-21 05:17:08 -0500
commit82a74d081a8a0fb2c828a8ef99b181bd593818cf (patch)
treeee0f6d4d634decc191b008686859461221b7cf1e /src
parentc21c6f55d5aaf87b0dc6ce4a86aa0614b39713c5 (diff)
parentc1639f708aa3c45be1623e51615b688d7b7061e2 (diff)
Auto merge of #73 - emilio:complex, r=nox
Be able to represent Complex types with the correct layout. r? @nox
Diffstat (limited to 'src')
-rw-r--r--src/ir/ty.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index d74b1a0e..bf45b9fc 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -631,6 +631,13 @@ impl Type {
.expect("Not able to resolve array element?");
TypeKind::Array(inner, ty.num_elements())
}
+ // A complex number is always a real and an imaginary part, so
+ // represent that as a two-item array.
+ CXType_Complex => {
+ let inner = Item::from_ty(&ty.elem_type(), location, parent_id, ctx)
+ .expect("Not able to resolve array element?");
+ TypeKind::Array(inner, 2)
+ }
#[cfg(not(feature="llvm_stable"))]
CXType_Elaborated => {
return Self::from_clang_ty(potential_id, &ty.named(),