Skip to content

Commit 6a97408

Browse files
authored
[BUILD] add clang-cl to CMakeSettings (microsoft#5596)
This is for enable clang-cl build. The change will fix build error when use clang_cl_x64_x64 with CMakeSettings. Still many warnings and other issue to fix.
1 parent d369be5 commit 6a97408

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

CMakeSettings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@
2222
"ctestCommandArgs": "",
2323
"inheritEnvironments": [ "msvc_x64_x64" ]
2424
},
25+
{
26+
"name": "x64-clang-cl-Release",
27+
"generator": "Ninja",
28+
"configurationType": "RelWithDebInfo",
29+
"buildRoot": "${projectDir}\\out\\build\\${name}",
30+
"installRoot": "${projectDir}\\out\\install\\${name}",
31+
"cmakeCommandArgs": "-C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
32+
"buildCommandArgs": "-v",
33+
"ctestCommandArgs": "",
34+
"inheritEnvironments": [ "clang_cl_x64_x64" ]
35+
},
36+
{
37+
"name": "x64-clang-cl-Debug",
38+
"generator": "Ninja",
39+
"configurationType": "Debug",
40+
"buildRoot": "${projectDir}\\out\\build\\${name}",
41+
"installRoot": "${projectDir}\\out\\install\\${name}",
42+
"cmakeCommandArgs": "-C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
43+
"buildCommandArgs": "-v",
44+
"ctestCommandArgs": "",
45+
"inheritEnvironments": [ "clang_cl_x64_x64" ]
46+
},
2547
{
2648
"name": "x86-Release",
2749
"generator": "Ninja",

projects/dxilconv/lib/DxbcConverter/DxbcConverter.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6807,7 +6807,8 @@ Value *DxbcConverter::CastDxbcValue(Value *pValue, const CompType &SrcType, cons
68076807
return m_pBuilder->CreateBitCast(m_pBuilder->CreateSExt(pValue, Type::getInt16Ty(m_Ctx)), Type::getHalfTy(m_Ctx));
68086808
case CompType::Kind::F32:
68096809
return m_pBuilder->CreateBitCast(m_pBuilder->CreateSExt(pValue, Type::getInt32Ty(m_Ctx)), Type::getFloatTy(m_Ctx));
6810-
default: LLVM_FALLTHROUGH;
6810+
default:
6811+
break;
68116812
}
68126813
break;
68136814

@@ -6831,7 +6832,8 @@ Value *DxbcConverter::CastDxbcValue(Value *pValue, const CompType &SrcType, cons
68316832
pValue = m_pBuilder->CreateSExt(pValue, Type::getInt32Ty(m_Ctx));
68326833
return CreateBitCast(pValue, CompType::getI32(), CompType::getF32());
68336834
}
6834-
default: LLVM_FALLTHROUGH;
6835+
default:
6836+
break;
68356837
}
68366838
break;
68376839

@@ -6855,7 +6857,8 @@ Value *DxbcConverter::CastDxbcValue(Value *pValue, const CompType &SrcType, cons
68556857
pValue = m_pBuilder->CreateZExt(pValue, Type::getInt32Ty(m_Ctx));
68566858
return CreateBitCast(pValue, CompType::getI32(), CompType::getF32());
68576859
}
6858-
default: LLVM_FALLTHROUGH;
6860+
default:
6861+
break;
68596862
}
68606863
break;
68616864

@@ -6877,7 +6880,8 @@ Value *DxbcConverter::CastDxbcValue(Value *pValue, const CompType &SrcType, cons
68776880
}
68786881
case CompType::Kind::F32:
68796882
return CreateBitCast(pValue, CompType::getI32(), CompType::getF32());
6880-
default: LLVM_FALLTHROUGH;
6883+
default:
6884+
break;
68816885
}
68826886
break;
68836887

@@ -6897,7 +6901,8 @@ Value *DxbcConverter::CastDxbcValue(Value *pValue, const CompType &SrcType, cons
68976901
}
68986902
case CompType::Kind::F32:
68996903
return m_pBuilder->CreateFPExt(pValue, Type::getFloatTy(m_Ctx));
6900-
default: LLVM_FALLTHROUGH;
6904+
default:
6905+
break;
69016906
}
69026907
break;
69036908

@@ -6917,11 +6922,13 @@ Value *DxbcConverter::CastDxbcValue(Value *pValue, const CompType &SrcType, cons
69176922
return CreateBitCast(pValue, CompType::getF32(), CompType::getI32());
69186923
case CompType::Kind::F16:
69196924
return m_pBuilder->CreateFPTrunc(pValue, Type::getHalfTy(m_Ctx));
6920-
default: LLVM_FALLTHROUGH;
6925+
default:
6926+
break;
69216927
}
69226928
break;
69236929

6924-
default: LLVM_FALLTHROUGH;
6930+
default:
6931+
break;
69256932
}
69266933

69276934
DXASSERT(false, "unsupported cast combination");
@@ -7084,7 +7091,8 @@ CompType DxbcConverter::InferOperandType(const D3D10ShaderBinary::CInstruction &
70847091
}
70857092
}
70867093

7087-
default: LLVM_FALLTHROUGH;
7094+
default:
7095+
break;
70887096
}
70897097
}
70907098

projects/dxilconv/lib/DxbcConverter/DxbcUtil.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,8 @@ DXIL::PrimitiveTopology GetPrimitiveTopology(D3D10_SB_PRIMITIVE_TOPOLOGY Topolog
825825
case D3D10_SB_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ: LLVM_FALLTHROUGH;
826826
case D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ: LLVM_FALLTHROUGH;
827827
case D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ: LLVM_FALLTHROUGH;
828+
default:
829+
break;
828830
}
829831

830832
IFTBOOL(false, DXC_E_INCORRECT_DXBC);

0 commit comments

Comments
 (0)