Jelajahi Sumber

Fix unused var warning in Release, fix #709 misplaces parens (#728)

Marcelo Lopez Ruiz 7 tahun lalu
induk
melakukan
b7ce331dee

+ 1 - 1
lib/HLSL/HLMatrixLowerPass.cpp

@@ -2022,7 +2022,7 @@ void HLMatrixLowerPass::replaceMatWithVec(Instruction *matInst,
           MatIntrinsicReplace(cast<CallInst>(matInst), vecInst, useCall);
         } else {
           IntrinsicOp opcode = static_cast<IntrinsicOp>(GetHLOpcode(useCall));
-          DXASSERT(opcode == IntrinsicOp::IOP_frexp,
+          DXASSERT_LOCALVAR(opcode, opcode == IntrinsicOp::IOP_frexp,
                    "otherwise, unexpected opcode with matrix out parameter");
           // NOTE: because out param use copy out semantic, so the operand of
           // out must be temp alloca.

+ 1 - 1
tools/clang/lib/Parse/ParseDecl.cpp

@@ -322,7 +322,7 @@ static void ParseSpaceForHLSL(_In_z_ const char *name,
   *diagId = 0;
   *spaceValue = 0;
 
-  if (strncmp(name, "space", strlen("space") != 0)) {
+  if (strncmp(name, "space", strlen("space")) != 0) {
     *diagId = diag::err_hlsl_expected_space;
     return;
   }

+ 1 - 0
tools/clang/test/HLSL/packreg.hlsl

@@ -195,6 +195,7 @@ sampler myVar_s1 : register(ps, s[1], space1);
   `-RegisterAssignment <col:20> register(ps, s1, space1)
 */
 // fxc error X3591: incorrect bind semantic
+sampler myVar_sb : register(ps, s[1], splice); // expected-error {{expected space definition with syntax 'spaceX', where X is an integral value}} fxc-pass {{X3591: incorrect bind semantic}}
 sampler myVar_sz : register(ps, s[1], spacez); // expected-error {{space number should be an integral numeric string}} fxc-error {{X3591: incorrect bind semantic}}
 
 // Legal in fxc due to compatibility mode: