diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-15 22:00:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-15 22:00:31 +0000 |
commit | dac44ec99bf3a3b04d39c8d3c633b4158356cec2 (patch) | |
tree | c52c3061b758a272d64848cb7112b8f910b4a087 /llvm/lib/VMCore/Core.cpp | |
parent | 3a3e83c3e2bd456f5bc3e1e3b15f4af36d2f5953 (diff) | |
download | bcm5719-llvm-dac44ec99bf3a3b04d39c8d3c633b4158356cec2.tar.gz bcm5719-llvm-dac44ec99bf3a3b04d39c8d3c633b4158356cec2.zip |
Update the C bindings to keep the LLVMTypeKind up to date between the C/C++
stuff. Patch by Zoltan Varga!
llvm-svn: 75842
Diffstat (limited to 'llvm/lib/VMCore/Core.cpp')
-rw-r--r-- | llvm/lib/VMCore/Core.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index d04701e146c..600bda6fa57 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -117,7 +117,40 @@ void LLVMDumpModule(LLVMModuleRef M) { /*--.. Operations on all types (mostly) ....................................--*/ LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty) { - return static_cast<LLVMTypeKind>(unwrap(Ty)->getTypeID()); + switch (unwrap(Ty)->getTypeID()) { + case Type::VoidTyID: + return LLVMVoidTypeKind; + case Type::FloatTyID: + return LLVMFloatTypeKind; + case Type::DoubleTyID: + return LLVMDoubleTypeKind; + case Type::X86_FP80TyID: + return LLVMX86_FP80TypeKind; + case Type::FP128TyID: + return LLVMFP128TypeKind; + case Type::PPC_FP128TyID: + return LLVMPPC_FP128TypeKind; + case Type::LabelTyID: + return LLVMLabelTypeKind; + case Type::MetadataTyID: + return LLVMMetadataTypeKind; + case Type::IntegerTyID: + return LLVMIntegerTypeKind; + case Type::FunctionTyID: + return LLVMFunctionTypeKind; + case Type::StructTyID: + return LLVMStructTypeKind; + case Type::ArrayTyID: + return LLVMArrayTypeKind; + case Type::PointerTyID: + return LLVMPointerTypeKind; + case Type::OpaqueTyID: + return LLVMOpaqueTypeKind; + case Type::VectorTyID: + return LLVMVectorTypeKind; + default: + assert (false && "Unhandled TypeID."); + } } /*--.. Operations on integer types .........................................--*/ |