summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2018-01-23 16:12:42 -0600
committerGeorge Kyriazis <[email protected]>2018-01-25 08:22:52 -0600
commit0e879aad2fd1dac102c13d680edf455aa068d5df (patch)
tree6892ee18085b84264ff0fc4915e5af238d582b72
parente1331c9d618e14c620387754839e0e681960b32e (diff)
swr/rast: support llvm 3.9 type declarations
LLVM 3.9 was not taken into account in initial check-in. Fixes: 01ab218bbc ("swr/rast: Initial work for debugging support.") cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104749 Acked-by: Emil Velikov <[email protected]> Reviewed-by: Bruce Cherniak <[email protected]>
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 93e32406123..5a71ab6a4f8 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -249,9 +249,15 @@ DIType* JitManager::GetDebugType(Type* pTy)
switch (id)
{
case Type::VoidTyID: return builder.createUnspecifiedType("void"); break;
+#if LLVM_VERSION_MAJOR >= 4
case Type::HalfTyID: return builder.createBasicType("float16", 16, dwarf::DW_ATE_float); break;
case Type::FloatTyID: return builder.createBasicType("float", 32, dwarf::DW_ATE_float); break;
case Type::DoubleTyID: return builder.createBasicType("double", 64, dwarf::DW_ATE_float); break;
+#else
+ case Type::HalfTyID: return builder.createBasicType("float16", 16, 0, dwarf::DW_ATE_float); break;
+ case Type::FloatTyID: return builder.createBasicType("float", 32, 0, dwarf::DW_ATE_float); break;
+ case Type::DoubleTyID: return builder.createBasicType("double", 64, 0, dwarf::DW_ATE_float); break;
+#endif
case Type::IntegerTyID: return GetDebugIntegerType(pTy); break;
case Type::StructTyID: return GetDebugStructType(pTy); break;
case Type::ArrayTyID: return GetDebugArrayType(pTy); break;
@@ -288,11 +294,19 @@ DIType* JitManager::GetDebugIntegerType(Type* pTy)
IntegerType* pIntTy = cast<IntegerType>(pTy);
switch (pIntTy->getBitWidth())
{
+#if LLVM_VERSION_MAJOR >= 4
case 1: return builder.createBasicType("int1", 1, dwarf::DW_ATE_unsigned); break;
case 8: return builder.createBasicType("int8", 8, dwarf::DW_ATE_signed); break;
case 16: return builder.createBasicType("int16", 16, dwarf::DW_ATE_signed); break;
case 32: return builder.createBasicType("int", 32, dwarf::DW_ATE_signed); break;
case 64: return builder.createBasicType("int64", 64, dwarf::DW_ATE_signed); break;
+#else
+ case 1: return builder.createBasicType("int1", 1, 0, dwarf::DW_ATE_unsigned); break;
+ case 8: return builder.createBasicType("int8", 8, 0, dwarf::DW_ATE_signed); break;
+ case 16: return builder.createBasicType("int16", 16, 0, dwarf::DW_ATE_signed); break;
+ case 32: return builder.createBasicType("int", 32, 0, dwarf::DW_ATE_signed); break;
+ case 64: return builder.createBasicType("int64", 64, 0, dwarf::DW_ATE_signed); break;
+#endif
default: SWR_ASSERT(false, "Unimplemented integer bit width");
}
return nullptr;