summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_type.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-12 10:04:48 -0600
committerBrian Paul <brianp@vmware.com>2010-05-12 10:37:59 -0600
commit3dcb25364fc3b8570dfe240e5b1e6fa278bf0911 (patch)
treed3378d87287504e18448e993ffeae344558427fb /src/gallium/auxiliary/gallivm/lp_bld_type.c
parent6080e567f0ca1fdcce21e76271d4239c33a50db3 (diff)
gallivm: added lp_typekind_name() util function
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_type.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_type.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.c b/src/gallium/auxiliary/gallivm/lp_bld_type.c
index 796af88caa..a86ef03e41 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_type.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_type.c
@@ -238,6 +238,51 @@ lp_wider_type(struct lp_type type)
}
+/**
+ * Return string name for a LLVMTypeKind. Useful for debugging.
+ */
+const char *
+lp_typekind_name(LLVMTypeKind t)
+{
+ switch (t) {
+ case LLVMVoidTypeKind:
+ return "LLVMVoidTypeKind";
+ case LLVMFloatTypeKind:
+ return "LLVMFloatTypeKind";
+ case LLVMDoubleTypeKind:
+ return "LLVMDoubleTypeKind";
+ case LLVMX86_FP80TypeKind:
+ return "LLVMX86_FP80TypeKind";
+ case LLVMFP128TypeKind:
+ return "LLVMFP128TypeKind";
+ case LLVMPPC_FP128TypeKind:
+ return "LLVMPPC_FP128TypeKind";
+ case LLVMLabelTypeKind:
+ return "LLVMLabelTypeKind";
+ case LLVMIntegerTypeKind:
+ return "LLVMIntegerTypeKind";
+ case LLVMFunctionTypeKind:
+ return "LLVMFunctionTypeKind";
+ case LLVMStructTypeKind:
+ return "LLVMStructTypeKind";
+ case LLVMArrayTypeKind:
+ return "LLVMArrayTypeKind";
+ case LLVMPointerTypeKind:
+ return "LLVMPointerTypeKind";
+ case LLVMOpaqueTypeKind:
+ return "LLVMOpaqueTypeKind";
+ case LLVMVectorTypeKind:
+ return "LLVMVectorTypeKind";
+ case LLVMMetadataTypeKind:
+ return "LLVMMetadataTypeKind";
+ case LLVMUnionTypeKind:
+ return "LLVMUnionTypeKind";
+ default:
+ return "unknown LLVMTypeKind";
+ }
+}
+
+
void
lp_build_context_init(struct lp_build_context *bld,
LLVMBuilderRef builder,