Browse Source

[linux-port] Remove unused from HLSL code (#1315)

Removes unused variables and functions from code between HLSL
change comments in LLVM code or else in HLSL or SPIRV original
source files along with any code correspondingly rendered unused
or originally in service of these ultimately unused elements.
Each of these produces a warning in clang, gcc, or both.
Fixes around 458 clang warnings and 461 gcc warnings.
Greg Roth 7 years ago
parent
commit
5481aca58f

+ 0 - 3
lib/HLSL/DxilDebugInstrumentation.cpp

@@ -583,14 +583,11 @@ void DxilDebugInstrumentation::addDebugEntryValue(BuilderContext &BC, Value * Th
     Function* StoreValue = BC.HlslOP->GetOpFunc(OP::OpCode::BufferStore, TheValue->getType()); // Type::getInt32Ty(BC.Ctx));
     Constant* StoreValueOpcode = BC.HlslOP->GetU32Const((unsigned)DXIL::OpCode::BufferStore);
     UndefValue* Undef32Arg = UndefValue::get(Type::getInt32Ty(BC.Ctx));
-    Constant* ZeroArg;
     UndefValue* UndefArg;
     if (TheValueTypeID == Type::TypeID::IntegerTyID) {
-        ZeroArg = BC.HlslOP->GetU32Const(0);
         UndefArg = UndefValue::get(Type::getInt32Ty(BC.Ctx));
     }
     else if (TheValueTypeID == Type::TypeID::FloatTyID) {
-        ZeroArg = BC.HlslOP->GetFloatConst(0.f);
         UndefArg = UndefValue::get(Type::getFloatTy(BC.Ctx));
     }
     else {

+ 0 - 25
lib/HLSL/DxilGenerationPass.cpp

@@ -339,19 +339,6 @@ private:
 };
 }
 
-static Value *MergeImmResClass(Value *resClass) {
-  if (ConstantInt *Imm = dyn_cast<ConstantInt>(resClass)) {
-    return resClass;
-  } else {
-    PHINode *phi = cast<PHINode>(resClass);
-    Value *immResClass = MergeImmResClass(phi->getIncomingValue(0));
-    unsigned numOperands = phi->getNumOperands();
-    for (unsigned i=0;i<numOperands;i++)
-      phi->setIncomingValue(i, immResClass);
-    return immResClass;
-  }
-}
-
 static const StringRef kResourceMapErrorMsg = "local resource not guaranteed to map to unique global resource.";
 static void EmitResMappingError(Instruction *Res) {
   const DebugLoc &DL = Res->getDebugLoc();
@@ -363,16 +350,6 @@ static void EmitResMappingError(Instruction *Res) {
     Res->getContext().emitError(Twine(kResourceMapErrorMsg) + " With /Zi to show more information.");
   }
 }
-static Value *SelectOnOperand(Value *Cond, CallInst *CIT, CallInst *CIF,
-                              unsigned idx, IRBuilder<> &Builder) {
-  Value *OpT = CIT->getArgOperand(idx);
-  Value *OpF = CIF->getArgOperand(idx);
-  Value *OpSel = OpT;
-  if (OpT != OpF) {
-    OpSel = Builder.CreateSelect(Cond, OpT, OpF);
-  }
-  return OpSel;
-}
 
 static void ReplaceResourceUserWithHandle(LoadInst *Res, Value *handle) {
   for (auto resUser = Res->user_begin(); resUser != Res->user_end();) {
@@ -821,10 +798,8 @@ void DxilGenerationPass::AddCreateHandleForPhiNodeAndSelect(OP *hlslOP) {
     unsigned numOperands = Res->getNumOperands();
     IRBuilder<> Builder(Res);
 
-    unsigned startOpIdx = 0;
     // Skip Cond for Select.
     if (SelectInst *Sel = dyn_cast<SelectInst>(Res)) {
-      startOpIdx = 1;
       Value *Cond = Sel->getCondition();
 
       Value *resClassSel =

+ 0 - 4
lib/HLSL/DxilRootSignature.cpp

@@ -1059,10 +1059,6 @@ static void SetFlags(DxilRootDescriptor1 &D, DxilRootDescriptorFlags Flags)
 {
   D.Flags = Flags;
 }
-static DxilRootDescriptorFlags GetFlags(const DxilContainerRootDescriptor1 &D)
-{
-  return (DxilRootDescriptorFlags)D.Flags;
-}
 static void SetFlags(DxilContainerRootDescriptor1 &D, DxilRootDescriptorFlags Flags)
 {
   D.Flags = (uint32_t)Flags;

+ 9 - 55
lib/HLSL/DxilValidation.cpp

@@ -293,15 +293,6 @@ static void emitDxilDiag(const LLVMContext &Ctx, const char *str) {
   diagCtx.diagnose(DxilErrorDiagnosticInfo(str));
 }
 
-// Printing of types.
-static inline DiagnosticPrinter &operator<<(DiagnosticPrinter &OS, Type &T) {
-  std::string O;
-  raw_string_ostream OSS(O);
-  T.print(OSS);
-  OS << OSS.str();
-  return OS;
-}
-
 } // anon namespace
 
 namespace hlsl {
@@ -820,7 +811,6 @@ struct ResRetUsage {
 
 static void CollectGetDimResRetUsage(ResRetUsage &usage, Instruction *ResRet,
                                      ValidationContext &ValCtx) {
-  const unsigned kMaxResRetElementIndex = 5;
   for (User *U : ResRet->users()) {
     if (ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(U)) {
       for (unsigned idx : EVI->getIndices()) {
@@ -856,35 +846,6 @@ static void CollectGetDimResRetUsage(ResRetUsage &usage, Instruction *ResRet,
   }
 }
 
-static void ValidateStatus(Instruction *ResRet, ValidationContext &ValCtx) {
-  ResRetUsage usage;
-  CollectGetDimResRetUsage(usage, ResRet, ValCtx);
-  if (usage.status) {
-    for (User *U : ResRet->users()) {
-      if (ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(U)) {
-        for (unsigned idx : EVI->getIndices()) {
-          switch (idx) {
-          case DXIL::kResRetStatusIndex:
-            for (User *SU : EVI->users()) {
-              Instruction *I = cast<Instruction>(SU);
-              // Make sure all use is CheckAccess.
-              if (!isa<CallInst>(I)) {
-                ValCtx.EmitInstrError(I, ValidationRule::InstrStatus);
-                return;
-              }
-              if (!ValCtx.DxilMod.GetOP()->IsDxilOpFuncCallInst(
-                      I, DXIL::OpCode::CheckAccessFullyMapped)) {
-                ValCtx.EmitInstrError(I, ValidationRule::InstrStatus);
-                return;
-              }
-            }
-            break;
-          }
-        }
-      }
-    }
-  }
-}
 
 static void ValidateResourceCoord(CallInst *CI, DXIL::ResourceKind resKind,
                                   ArrayRef<Value *> coords,
@@ -1587,8 +1548,6 @@ static void ValidateDxilOperationCallInProfile(CallInst *CI,
     const unsigned uglobal =
         static_cast<unsigned>(DXIL::BarrierMode::UAVFenceGlobal);
     const unsigned g = static_cast<unsigned>(DXIL::BarrierMode::TGSMFence);
-    const unsigned t =
-        static_cast<unsigned>(DXIL::BarrierMode::SyncThreadGroup);
     const unsigned ut =
         static_cast<unsigned>(DXIL::BarrierMode::UAVFenceThreadGroup);
     unsigned barrierMode = cMode->getLimitedValue();
@@ -3150,12 +3109,10 @@ static void ValidateCBuffer(DxilCBuffer &cb, ValidationContext &ValCtx) {
 
 static void ValidateResources(ValidationContext &ValCtx) {
   const vector<unique_ptr<DxilResource>> &uavs = ValCtx.DxilMod.GetUAVs();
-  bool hasROV = false;
   SpacesAllocator<unsigned, DxilResourceBase> uavAllocator;
 
   for (auto &uav : uavs) {
     if (uav->IsROV()) {
-      hasROV = true;
       if (!ValCtx.DxilMod.GetShaderModel()->IsPS()) {
         ValCtx.EmitResourceError(uav.get(), ValidationRule::SmROVOnlyInPS);
       }
@@ -3252,28 +3209,25 @@ static void ValidateSignatureElement(DxilSignatureElement &SE,
   unsigned compWidth = 0;
   bool compFloat = false;
   bool compInt = false;
-  bool compUnsigned = false;
   bool compBool = false;
-  bool compSNorm = false;
-  bool compUNorm = false;
 
   switch (compKind) {
-  case CompType::Kind::U64: compWidth = 64; compInt = true; compUnsigned = true; break;
+  case CompType::Kind::U64: compWidth = 64; compInt = true; break;
   case CompType::Kind::I64: compWidth = 64; compInt = true; break;
-  case CompType::Kind::U32: compWidth = 32; compInt = true; compUnsigned = true; break;
+  case CompType::Kind::U32: compWidth = 32; compInt = true; break;
   case CompType::Kind::I32: compWidth = 32; compInt = true; break;
-  case CompType::Kind::U16: compWidth = 16; compInt = true; compUnsigned = true; break;
+  case CompType::Kind::U16: compWidth = 16; compInt = true; break;
   case CompType::Kind::I16: compWidth = 16; compInt = true; break;
   case CompType::Kind::I1: compWidth = 1; compBool = true; break;
   case CompType::Kind::F64: compWidth = 64; compFloat = true; break;
   case CompType::Kind::F32: compWidth = 32; compFloat = true; break;
   case CompType::Kind::F16: compWidth = 16; compFloat = true; break;
-  case CompType::Kind::SNormF64: compWidth = 64; compFloat = true; compSNorm = true; break;
-  case CompType::Kind::SNormF32: compWidth = 32; compFloat = true; compSNorm = true; break;
-  case CompType::Kind::SNormF16: compWidth = 16; compFloat = true; compSNorm = true; break;
-  case CompType::Kind::UNormF64: compWidth = 64; compFloat = true; compUNorm = true; break;
-  case CompType::Kind::UNormF32: compWidth = 32; compFloat = true; compUNorm = true; break;
-  case CompType::Kind::UNormF16: compWidth = 16; compFloat = true; compUNorm = true; break;
+  case CompType::Kind::SNormF64: compWidth = 64; compFloat = true; break;
+  case CompType::Kind::SNormF32: compWidth = 32; compFloat = true; break;
+  case CompType::Kind::SNormF16: compWidth = 16; compFloat = true; break;
+  case CompType::Kind::UNormF64: compWidth = 64; compFloat = true; break;
+  case CompType::Kind::UNormF32: compWidth = 32; compFloat = true; break;
+  case CompType::Kind::UNormF16: compWidth = 16; compFloat = true; break;
   case CompType::Kind::Invalid:
   default:
     ValCtx.EmitFormatError(ValidationRule::MetaSignatureCompType, { SE.GetName() });

+ 0 - 52
lib/HLSL/HLMatrixLowerPass.cpp

@@ -524,22 +524,6 @@ Instruction *HLMatrixLowerPass::MatIntrinsicToVec(CallInst *CI) {
   return Builder.CreateCall(vecF, argList);
 }
 
-static Value *VectorizeScalarOp(Value *op, Type *dstTy, IRBuilder<> &Builder) {
-  if (op->getType() == dstTy)
-    return op;
-  op = Builder.CreateInsertElement(
-      UndefValue::get(VectorType::get(op->getType(), 1)), op, (uint64_t)0);
-  Type *I32Ty = IntegerType::get(dstTy->getContext(), 32);
-  Constant *zero = ConstantInt::get(I32Ty, 0);
-
-  std::vector<Constant *> MaskVec(dstTy->getVectorNumElements(), zero);
-  Value *castMask = ConstantVector::get(MaskVec);
-
-  Value *vecOp = new ShuffleVectorInst(op, op, castMask);
-  Builder.Insert(cast<Instruction>(vecOp));
-  return vecOp;
-}
-
 Instruction *HLMatrixLowerPass::TrivialMatUnOpToVec(CallInst *CI) {
   Type *ResultTy = LowerMatrixType(CI->getType());
   UndefValue *tmp = UndefValue::get(ResultTy);
@@ -1591,7 +1575,6 @@ void HLMatrixLowerPass::TranslateMatLoadStoreOnGlobal(GlobalVariable *matGlobal,
                                                       GlobalVariable *scalarArrayGlobal,
                                                       CallInst *matLdStInst) {
   // vecGlobals already in correct major.
-  const bool bColMajor = true;
   HLMatLoadStoreOpcode opcode =
       static_cast<HLMatLoadStoreOpcode>(GetHLOpcode(matLdStInst));
   switch (opcode) {
@@ -1842,41 +1825,6 @@ static void IterateInitList(MutableArrayRef<Value *> elts, unsigned &idx,
     }
   }
 }
-// Store flattened init list elements into matrix array.
-static void GenerateMatArrayInit(ArrayRef<Value *> elts, Value *ptr,
-                                 unsigned &offset, IRBuilder<> &Builder) {
-  Type *Ty = ptr->getType()->getPointerElementType();
-  if (Ty->isVectorTy()) {
-    unsigned vecSize = Ty->getVectorNumElements();
-    Type *eltTy = Ty->getVectorElementType();
-    Value *result = UndefValue::get(Ty);
-
-    for (unsigned i = 0; i < vecSize; i++) {
-      Value *elt = elts[offset + i];
-      if (elt->getType() != eltTy) {
-        // FIXME: get signed/unsigned info.
-        elt = CreateTypeCast(HLCastOpcode::DefaultCast, eltTy, elt, Builder);
-      }
-
-      result = Builder.CreateInsertElement(result, elt, i);
-    }
-    // Update offset.
-    offset += vecSize;
-    Builder.CreateStore(result, ptr);
-  } else {
-    DXASSERT(Ty->isArrayTy(), "must be array type");
-    Type *i32Ty = Type::getInt32Ty(Ty->getContext());
-    Constant *zero = ConstantInt::get(i32Ty, 0);
-
-    unsigned arraySize = Ty->getArrayNumElements();
-
-    for (unsigned i = 0; i < arraySize; i++) {
-      Value *GEP =
-          Builder.CreateInBoundsGEP(ptr, {zero, ConstantInt::get(i32Ty, i)});
-      GenerateMatArrayInit(elts, GEP, offset, Builder);
-    }
-  }
-}
 
 void HLMatrixLowerPass::TranslateMatInit(CallInst *matInitInst) {
   // Array matrix init will be translated in TranslateMatArrayInitReplace.

+ 0 - 8
lib/HLSL/HLModule.cpp

@@ -385,14 +385,6 @@ DXIL::ResourceKind HLModule::GetResourceKind(llvm::Type *Ty) {
   }
 }
 
-static unsigned GetIntAt(MDTuple *tuple, unsigned idx) {
-  return DxilMDHelper::ConstMDToUint32(tuple->getOperand(idx));
-}
-
-static unsigned GetFloatAt(MDTuple *tuple, unsigned idx) {
-  return DxilMDHelper::ConstMDToFloat(tuple->getOperand(idx));
-}
-
 DXIL::Float32DenormMode HLModule::GetFloat32DenormMode() const {
   return m_Float32DenormMode;
 }

+ 0 - 23
lib/HLSL/HLOperationLower.cpp

@@ -1101,7 +1101,6 @@ Value *TransalteAbs(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
     Value *src = CI->getArgOperand(HLOperandIndex::kUnaryOpSrc0Idx);
     IRBuilder<> Builder(CI);
     Value *neg = Builder.CreateNeg(src);
-    Value *refArgs[] = {nullptr, src, neg};
     return TrivialDxilBinaryOperation(DXIL::OpCode::IMax, src, neg, hlslOP,
                                       Builder);
   }
@@ -3083,26 +3082,6 @@ void Make64bitResultForLoad(Type *EltTy, ArrayRef<Value *> resultElts32,
   }
 }
 
-static uint8_t GetRawBufferMaskFromIOP(IntrinsicOp IOP, hlsl::OP *OP) {
-  switch (IOP) {
-    // one component
-    case IntrinsicOp::MOP_Load:
-      return DXIL::kCompMask_X;
-    // two component
-    case IntrinsicOp::MOP_Load2:
-      return DXIL::kCompMask_X | DXIL::kCompMask_Y;
-    // three component
-    case IntrinsicOp::MOP_Load3:
-      return DXIL::kCompMask_X | DXIL::kCompMask_Y | DXIL::kCompMask_Z;
-    // four component
-    case IntrinsicOp::MOP_Load4:
-      return DXIL::kCompMask_All;
-    default:
-      DXASSERT(false, "Invalid Intrinsic for computing load mask.");
-      return 0;
-  }
-}
-
 static Constant *GetRawBufferMaskForETy(Type *Ty, unsigned NumComponents, hlsl::OP *OP) {
   Type *ETy = Ty->getScalarType();
   bool is64 = ETy->isDoubleTy() || ETy == Type::getInt64Ty(ETy->getContext());
@@ -6234,8 +6213,6 @@ Value *UpdateVectorElt(Value *VecVal, Value *EltVal, Value *EltIdx,
 }
 
 void TranslateDefaultSubscript(CallInst *CI, HLOperationLowerHelper &helper,  HLObjectOperationLowerHelper *pObjHelper, bool &Translated) {
-  auto U = CI->user_begin();
-
   Value *ptr = CI->getArgOperand(HLOperandIndex::kSubscriptObjectOpIdx);
 
   hlsl::OP *hlslOP = &helper.hlslOP;

+ 0 - 8
lib/HLSL/HLSignatureLower.cpp

@@ -1442,14 +1442,6 @@ void HLSignatureLower::GenerateClipPlanesForVS(Value *outPosition) {
 }
 
 namespace {
-// Helper functions for Gs Streams.
-void GenerateStOutput(Function *stOutput, Value *eltVal, Value *outputID,
-                      Value *rowIdx, Value *colIdx, OP *hlslOP,
-                      IRBuilder<> Builder) {
-  Constant *OpArg = hlslOP->GetU32Const((unsigned)OP::OpCode::StoreOutput);
-  Builder.CreateCall(stOutput, {OpArg, outputID, rowIdx, colIdx, eltVal});
-}
-
 Value *TranslateStreamAppend(CallInst *CI, unsigned ID, hlsl::OP *OP) {
   Function *DxilFunc = OP->GetOpFunc(OP::OpCode::EmitStream, CI->getType());
   // TODO: generate a emit which has the data being emited as its argment.

+ 0 - 3
lib/IR/LegacyPassManager.cpp

@@ -86,9 +86,6 @@ static cl::opt<bool>
 PrintAfterAll("print-after-all",
               llvm::cl::desc("Print IR after each pass"),
               cl::init(false));
-#else
-static const bool PrintBeforeAll = false;
-static const bool PrintAfterAll = false;
 #endif // HLSL Change Ends
 
 /// This is a helper to determine whether to print IR before or

+ 0 - 2
lib/IR/Verifier.cpp

@@ -80,8 +80,6 @@ using namespace llvm;
 
 #if 0 // HLSL Change Starts - option pending
 static cl::opt<bool> VerifyDebugInfo("verify-debug-info", cl::init(true));
-#else
-static const bool VerifyDebugInfo = true;
 #endif // HLSL Change Ends
 
 namespace {

+ 0 - 2
lib/Support/CommandLine.cpp

@@ -1724,8 +1724,6 @@ void HelpPrinterWrapper::operator=(bool Value) {
 static const bool PrintOptions = false;
 static const bool PrintAllOptions = false;
 
-void HelpPrinterWrapper::operator=(bool Value) {
-}
 #endif // HLSL Change Ends
 
 // Print the value of each option.

+ 0 - 1
lib/Support/Timer.cpp

@@ -53,7 +53,6 @@ namespace {
                    cl::Hidden, cl::location(getLibSupportInfoOutputFilename()));
 #else
   static const bool TrackSpace = false;
-  static const char InfoOutputFilename[] = "";
 #endif // HLSL Change Ends
 }
 

+ 2 - 2
lib/Transforms/IPO/MergeFunctions.cpp

@@ -119,8 +119,6 @@ static cl::opt<unsigned> NumFunctionsForSanityCheck(
              "MergeFunctions pass sanity check. "
              "'0' disables this check. Works only with '-debug' key."),
     cl::init(0), cl::Hidden);
-#else
-static const unsigned NumFunctionsForSanityCheck = 0;
 #endif
 
 namespace {
@@ -1157,6 +1155,7 @@ ModulePass *llvm::createMergeFunctionsPass() {
 }
 
 bool MergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
+#if 0 // Begin HLSL Change (NumFunctionsForSanityCheck is always zero)
   if (const unsigned Max = NumFunctionsForSanityCheck) {
     unsigned TripleNumber = 0;
     bool Valid = true;
@@ -1225,6 +1224,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
     dbgs() << "MERGEFUNC-SANITY: " << (Valid ? "Passed." : "Failed.") << "\n";
     return Valid;
   }
+#endif // End HLSL Change
   return true;
 }
 

+ 0 - 4
lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

@@ -68,7 +68,6 @@ using namespace hlsl;
 STATISTIC(NumReplaced, "Number of allocas broken up");
 STATISTIC(NumPromoted, "Number of allocas promoted");
 STATISTIC(NumAdjusted, "Number of scalar allocas adjusted to allow promotion");
-STATISTIC(NumConverted, "Number of aggregates converted to scalar");
 
 namespace {
 
@@ -5935,11 +5934,8 @@ static void LegalizeDxilInputOutputs(Function *F,
             EntryAnnotation->GetParameterAnnotation(output->getArgNo());
 
         auto Iter = Builder.GetInsertPoint();
-        bool onlyRetBlk = false;
         if (RI != BB.begin())
           Iter--;
-        else
-          onlyRetBlk = true;
         // split copy.
         SplitCpy(output->getType(), output, temp, idxList, Builder, DL, typeSys,
                  &paramAnnotation);

+ 1 - 9
tools/clang/lib/AST/ASTContextHLSL.cpp

@@ -32,20 +32,13 @@ static const int FirstTemplateDepth = 0;
 static const int FirstParamPosition = 0;
 static const bool ForConstFalse = false;          // a construct is targeting a const type
 static const bool ForConstTrue = true;            // a construct is targeting a non-const type
-static const bool ExplicitConversionFalse = false;// a conversion operation is not the result of an explicit cast
-static const bool InheritedFalse = false;         // template parameter default value is not inherited.
 static const bool ParameterPackFalse = false;     // template parameter is not an ellipsis.
 static const bool TypenameFalse = false;          // 'typename' specified rather than 'class' for a template argument.
 static const bool DelayTypeCreationTrue = true;   // delay type creation for a declaration
-static const bool DelayTypeCreationFalse = false; // immediately create a type when the declaration is created
-static const unsigned int NoQuals = 0;            // no qualifiers in effect
 static const SourceLocation NoLoc;                // no source location attribution available
-static const bool HasWrittenPrototypeTrue = true; // function had the prototype written
 static const bool InlineFalse = false;            // namespace is not an inline namespace
 static const bool InlineSpecifiedFalse = false;   // function was not specified as inline
 static const bool IsConstexprFalse = false;       // function is not constexpr
-static const bool ListInitializationFalse = false;// not performing a list initialization
-static const bool SuppressDiagTrue = true;        // suppress diagnostics
 static const bool VirtualFalse = false;           // whether the base class is declares 'virtual'
 static const bool BaseClassFalse = false;         // whether the base class is declared as 'class' (vs. 'struct')
 
@@ -292,7 +285,7 @@ void AddSubscriptOperator(
     vectorType = context.getConstType(vectorType);
 
   QualType indexType = intType;
-  CXXMethodDecl* functionDecl = CreateObjectFunctionDeclarationWithParams(
+  CreateObjectFunctionDeclarationWithParams(
     context, templateRecordDecl, vectorType,
     ArrayRef<QualType>(indexType), ArrayRef<StringRef>(StringRef("index")),
     context.DeclarationNames.getCXXOperatorName(OO_Subscript), forConst);
@@ -531,7 +524,6 @@ CXXRecordDecl* CreateStdStructWithStaticBool(clang::ASTContext& context, Namespa
   // struct true_type { static const bool value = true; }
   TypeSourceInfo* boolTypeSource = context.getTrivialTypeSourceInfo(context.BoolTy.withConst());
   CXXRecordDecl* trueTypeDecl = CXXRecordDecl::Create(context, TagTypeKind::TTK_Struct, stdNamespace, NoLoc, NoLoc, &trueTypeId, nullptr, DelayTypeCreationTrue);
-  QualType trueTypeQT = context.getTagDeclType(trueTypeDecl); // Fault this in now.
 
   // static fields are variables in the AST
   VarDecl* trueValueDecl = VarDecl::Create(context, trueTypeDecl, NoLoc, NoLoc, &valueId,

+ 0 - 2
tools/clang/lib/AST/ExprConstant.cpp

@@ -5725,7 +5725,6 @@ bool VectorExprEvaluator::VisitCastExpr(const CastExpr* E) {
           hlsl::GetHLSLVecElementType(E->getType()), Elem.getFloat());
       Elts.push_back(Elem);
     }
-    const auto EltsSize = Elts.size();
     return Success(Elts, E);
   }
   case CK_HLSLCC_IntegralToFloating: {
@@ -5740,7 +5739,6 @@ bool VectorExprEvaluator::VisitCastExpr(const CastExpr* E) {
                            ElemFloat);
       Elts.push_back(APValue(ElemFloat));
     }
-    const auto EltsSize = Elts.size();
     return Success(Elts, E);
   }
   case CK_HLSLCC_FloatingToIntegral: {

+ 0 - 4
tools/clang/lib/AST/HlslTypes.cpp

@@ -150,9 +150,7 @@ uint32_t GetHLSLVecSize(clang::QualType type) {
          "otherwise caller shouldn't be invoking this");
 
   const TemplateArgumentList &argList = templateDecl->getTemplateArgs();
-  const TemplateArgument &arg0 = argList[0];
   const TemplateArgument &arg1 = argList[1];
-  QualType elemTy = arg0.getAsType();
   llvm::APSInt vecSize = arg1.getAsIntegral();
   return vecSize.getLimitedValue();
 }
@@ -172,10 +170,8 @@ void GetRowsAndCols(clang::QualType type, uint32_t &rowCount,
          "otherwise caller shouldn't be invoking this");
 
   const TemplateArgumentList &argList = templateDecl->getTemplateArgs();
-  const TemplateArgument &arg0 = argList[0];
   const TemplateArgument &arg1 = argList[1];
   const TemplateArgument &arg2 = argList[2];
-  QualType elemTy = arg0.getAsType();
   llvm::APSInt rowSize = arg1.getAsIntegral();
   llvm::APSInt colSize = arg2.getAsIntegral();
   rowCount = rowSize.getLimitedValue();

+ 0 - 1
tools/clang/lib/CodeGen/CGExprAgg.cpp

@@ -710,7 +710,6 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
   // HLSL Change Begins.
   case CK_FlatConversion: {
     QualType Ty = E->getSubExpr()->getType();
-    QualType PtrTy = CGF.getContext().getPointerType(Ty);
     llvm::Value *DestPtr = Dest.getAddr();
 
     if (IntegerLiteral *IL = dyn_cast<IntegerLiteral>(E->getSubExpr())) {

+ 0 - 4
tools/clang/lib/CodeGen/CGExprCXX.cpp

@@ -85,8 +85,6 @@ RValue CodeGenFunction::EmitCXXMemberOrOperatorCall(
   llvm::SmallVector<LValue, 8> castArgList;
   // The argList of the CallExpr, may be update for out parameter
   llvm::SmallVector<const Stmt *, 8> argList(CE->arg_begin(), CE->arg_end());
-  ConstExprIterator argBegin = argList.data();
-  ConstExprIterator argEnd = argList.data() + CE->getNumArgs();
   // out param conversion
   CodeGenFunction::HLSLOutParamScope OutParamScope(*this);
   auto MapTemp = [&](const VarDecl *LocalVD, llvm::Value *TmpArg) {
@@ -122,8 +120,6 @@ RValue CodeGenFunction::EmitCXXStructorCall(
   llvm::SmallVector<LValue, 8> castArgList;
   // The argList of the CallExpr, may be update for out parameter
   llvm::SmallVector<const Stmt *, 8> argList(CE->arg_begin(), CE->arg_end());
-  ConstExprIterator argBegin = argList.data();
-  ConstExprIterator argEnd = argList.data() + CE->getNumArgs();
   // out param conversion
   CodeGenFunction::HLSLOutParamScope OutParamScope(*this);
   auto MapTemp = [&](const VarDecl *LocalVD, llvm::Value *TmpArg) {

+ 0 - 31
tools/clang/lib/CodeGen/CGHLSLMS.cpp

@@ -916,7 +916,6 @@ unsigned CGMSHLSLRuntime::ConstructStructAnnotation(DxilStructAnnotation *annota
 
     unsigned CBufferOffset = offset;
 
-    bool userOffset = false;
     // Try to get info from fieldDecl.
     for (const hlsl::UnusualAnnotation *it :
          fieldDecl->getUnusualAnnotations()) {
@@ -931,7 +930,6 @@ unsigned CGMSHLSLRuntime::ConstructStructAnnotation(DxilStructAnnotation *annota
         CBufferOffset += cp->ComponentOffset;
         // Change to byte.
         CBufferOffset <<= 2;
-        userOffset = true;
       } break;
       case hlsl::UnusualAnnotation::UA_RegisterAssignment: {
         // register assignment only works on global constant.
@@ -2119,27 +2117,6 @@ uint32_t CGMSHLSLRuntime::AddSampler(VarDecl *samplerDecl) {
   return m_pHLModule->AddSampler(std::move(hlslRes));
 }
 
-static void CollectScalarTypes(std::vector<llvm::Type *> &scalarTys, llvm::Type *Ty) {
-  if (llvm::StructType *ST = dyn_cast<llvm::StructType>(Ty)) {
-    for (llvm::Type *EltTy : ST->elements()) {
-      CollectScalarTypes(scalarTys, EltTy);
-    }
-  } else if (llvm::ArrayType *AT = dyn_cast<llvm::ArrayType>(Ty)) {
-    llvm::Type *EltTy = AT->getElementType();
-    for (unsigned i=0;i<AT->getNumElements();i++) {
-      CollectScalarTypes(scalarTys, EltTy);
-    }
-  } else if (llvm::VectorType *VT = dyn_cast<llvm::VectorType>(Ty)) {
-    llvm::Type *EltTy = VT->getElementType();
-    for (unsigned i=0;i<VT->getNumElements();i++) {
-      CollectScalarTypes(scalarTys, EltTy);
-    }
-  } else {
-    scalarTys.emplace_back(Ty);
-  }
-}
-
-
 static void CollectScalarTypes(std::vector<QualType> &ScalarTys, QualType Ty) {
   if (Ty->isRecordType()) {
     if (hlsl::IsHLSLMatType(Ty)) {
@@ -4375,8 +4352,6 @@ RValue CGMSHLSLRuntime::EmitHLSLBuiltinCallExpr(CodeGenFunction &CGF,
                                                 const FunctionDecl *FD,
                                                 const CallExpr *E,
                                                 ReturnValueSlot ReturnValue) {
-  StringRef name = FD->getName();
-
   const Decl *TargetDecl = E->getCalleeDecl();
   llvm::Value *Callee = CGF.EmitScalarExpr(E->getCallee());
   RValue RV = CGF.EmitCall(E->getCallee()->getType(), Callee, E, ReturnValue,
@@ -4924,8 +4899,6 @@ static bool ExpTypeMatch(Expr *E, QualType Ty, ASTContext &Ctx, CodeGenTypes &Ty
     if (Ty->isStructureOrClassType()) {
       RecordDecl *record = Ty->castAs<RecordType>()->getDecl();
       bool bMatch = true;
-      auto It = record->field_begin();
-      auto ItEnd = record->field_end();
       unsigned i = 0;
       for (auto it = record->field_begin(), end = record->field_end();
            it != end; it++) {
@@ -5834,8 +5807,6 @@ void CGMSHLSLRuntime::FlattenAggregatePtrToGepList(
     const clang::RecordType *RT = Type->getAsStructureType();
     RecordDecl *RD = RT->getDecl();
 
-    auto fieldIter = RD->field_begin();
-
     const CGRecordLayout &RL = CGF.getTypes().getCGRecordLayout(RD);
 
     if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD)) {
@@ -5920,7 +5891,6 @@ void CGMSHLSLRuntime::LoadFlattenedGepList(CodeGenFunction &CGF,
   unsigned eltSize = GepList.size();
   for (unsigned i = 0; i < eltSize; i++) {
     Value *Ptr = GepList[i];
-    QualType Type = EltTyList[i];
     // Everying is element type.
     EltList.push_back(CGF.Builder.CreateLoad(Ptr));
   }
@@ -6181,7 +6151,6 @@ void CGMSHLSLRuntime::EmitHLSLFlatConversionToAggregate(
 
     const clang::RecordType *RT = Type->getAsStructureType();
     RecordDecl *RD = RT->getDecl();
-    auto fieldIter = RD->field_begin();
 
     const CGRecordLayout &RL = CGF.getTypes().getCGRecordLayout(RD);
     // Take care base.

+ 1 - 2
tools/clang/lib/Parse/HLSLRootSignature.cpp

@@ -505,9 +505,8 @@ HRESULT RootSignatureParser::Error(uint32_t uErrorNum, LPCSTR pError, ...)
 {
     va_list Args;
     char msg[512];
-    int len;
     va_start(Args, pError);
-    len = vsprintf_s(msg, pError, Args);
+    vsprintf_s(msg, pError, Args);
     va_end(Args);
     try {
       m_OS << msg;

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

@@ -408,7 +408,6 @@ bool Parser::MaybeParseHLSLAttributes(std::vector<hlsl::UnusualAnnotation *> &ta
 
         ExprResult result;
         if (Tok.isNot(tok::r_square)) {
-          SourceLocation expressionLoc = Tok.getLocation();
           subcomponentResult = ParseConstantExpression();
           r.IsValid = r.IsValid && !subcomponentResult.isInvalid();
           Expr::EvalResult evalResult;

+ 2 - 4
tools/clang/lib/SPIRV/DeclResultIdMapper.cpp

@@ -709,8 +709,8 @@ uint32_t DeclResultIdMapper::getOrRegisterFnResultId(const FunctionDecl *fn) {
   auto &info = astDecls[fn].info;
 
   bool isAlias = false;
-  const uint32_t type =
-      getTypeAndCreateCounterForPotentialAliasVar(fn, &isAlias, &info);
+
+  (void)getTypeAndCreateCounterForPotentialAliasVar(fn, &isAlias, &info);
 
   const uint32_t id = theBuilder.getSPIRVContext()->takeNextId();
   info.setResultId(id);
@@ -1712,8 +1712,6 @@ bool DeclResultIdMapper::writeBackOutputStream(const NamedDecl *decl,
     // Found semantic attached directly to this Decl. Write the value for this
     // Decl to the corresponding stage output variable.
 
-    const uint32_t srcTypeId = typeTranslator.translateType(type);
-
     // Handle SV_Position, SV_ClipDistance, and SV_CullDistance
     if (glPerVertex.tryToAccess(
             hlsl::DXIL::SigPointKind::GSOut, semanticInfo.semantic->GetKind(),

+ 0 - 14
tools/clang/lib/SPIRV/SPIRVEmitter.cpp

@@ -24,15 +24,6 @@ namespace spirv {
 
 namespace {
 
-/// Returns the type of the given decl. If the given decl is a FunctionDecl,
-/// returns its result type.
-inline QualType getTypeOrFnRetType(const ValueDecl *decl) {
-  if (const auto *funcDecl = dyn_cast<FunctionDecl>(decl)) {
-    return funcDecl->getReturnType();
-  }
-  return decl->getType();
-}
-
 // Returns true if the given decl has the given semantic.
 bool hasSemantic(const DeclaratorDecl *decl,
                  hlsl::DXIL::SemanticKind semanticKind) {
@@ -5900,7 +5891,6 @@ SPIRVEmitter::processMatrixBinaryOp(const Expr *lhs, const Expr *rhs,
   case BO_MulAssign:
   case BO_DivAssign:
   case BO_RemAssign: {
-    const uint32_t vecType = typeTranslator.getComponentVectorType(lhsType);
     const auto actOnEachVec = [this, spvOp, rhsVal](uint32_t index,
                                                     uint32_t vecType,
                                                     uint32_t lhsVec) {
@@ -7165,7 +7155,6 @@ uint32_t SPIRVEmitter::processIntrinsicModf(const CallExpr *callExpr) {
   const auto ipType = ipArg->getType();
   const auto returnType = callExpr->getType();
   const auto returnTypeId = typeTranslator.translateType(returnType);
-  const auto ipTypeId = typeTranslator.translateType(ipType);
   const uint32_t argId = doExpr(arg);
   const uint32_t ipId = doExpr(ipArg);
 
@@ -7607,9 +7596,7 @@ uint32_t SPIRVEmitter::processNonFpMatrixTranspose(QualType matType,
       TypeTranslator::isMxNMatrix(matType, &elemType, &numRows, &numCols);
   assert(isMat && !elemType->isFloatingType());
 
-  const auto rowQualType = astContext.getExtVectorType(elemType, numCols);
   const auto colQualType = astContext.getExtVectorType(elemType, numRows);
-  const uint32_t rowTypeId = typeTranslator.translateType(rowQualType);
   const uint32_t colTypeId = typeTranslator.translateType(colQualType);
   const uint32_t elemTypeId = typeTranslator.translateType(elemType);
 
@@ -7801,7 +7788,6 @@ uint32_t SPIRVEmitter::processNonFpMatrixTimesMatrix(QualType lhsType,
 }
 
 uint32_t SPIRVEmitter::processIntrinsicMul(const CallExpr *callExpr) {
-  const QualType returnType = callExpr->getType();
   const uint32_t returnTypeId =
       typeTranslator.translateType(callExpr->getType());
 

+ 0 - 3
tools/clang/lib/SPIRV/TypeTranslator.cpp

@@ -24,9 +24,6 @@ namespace {
 /// The alignment for 4-component float vectors.
 constexpr uint32_t kStd140Vec4Alignment = 16u;
 
-/// Returns true if the given value is a power of 2.
-inline bool isPow2(int val) { return (val & (val - 1)) == 0; }
-
 /// Rounds the given value up to the given power of 2.
 inline uint32_t roundToPow2(uint32_t val, uint32_t pow2) {
   assert(pow2 != 0);

+ 0 - 12
tools/clang/lib/Sema/SemaExprObjC.cpp

@@ -283,18 +283,6 @@ bool Sema::isKnownName(StringRef name) {
   return LookupName(R, TUScope, false);
 }
 
-static void addFixitForObjCARCConversion(Sema &S,
-  DiagnosticBuilder &DiagB,
-  Sema::CheckedConversionKind CCK,
-  SourceLocation afterLParen,
-  QualType castType,
-  Expr *castExpr,
-  Expr *realCast,
-  const char *bridgeKeyword,
-  const char *CFBridgeName) {
-  llvm_unreachable("HLSL does not support ObjC constructs");
-}
-
 void Sema::CheckTollFreeBridgeCast(QualType castType, Expr *castExpr) {
   llvm_unreachable("HLSL does not support ObjC constructs");
 }

+ 0 - 78
tools/clang/lib/Sema/SemaHLSL.cpp

@@ -639,15 +639,9 @@ using namespace hlsl;
 
 extern const char *HLSLScalarTypeNames[];
 
-static const int FirstTemplateDepth = 0;
-static const int FirstParamPosition = 0;
 static const bool ExplicitConversionFalse = false;// a conversion operation is not the result of an explicit cast
-static const bool InheritedFalse = false;         // template parameter default value is not inherited.
 static const bool ParameterPackFalse = false;     // template parameter is not an ellipsis.
 static const bool TypenameTrue = false;           // 'typename' specified rather than 'class' for a template argument.
-static const bool DelayTypeCreationTrue = true;   // delay type creation for a declaration
-static const bool DelayTypeCreationFalse = false; // immediately create a type when the declaration is created
-static const unsigned int NoQuals = 0;            // no qualifiers in effect
 static const SourceLocation NoLoc;                // no source location attribution available
 static const SourceRange NoRange;                 // no source range attribution available
 static const bool HasWrittenPrototypeTrue = true; // function had the prototype written
@@ -655,8 +649,6 @@ static const bool InlineSpecifiedFalse = false;   // function was not specified
 static const bool IsConstexprFalse = false;       // function is not constexpr
 static const bool ListInitializationFalse = false;// not performing a list initialization
 static const bool SuppressWarningsFalse = false;  // do not suppress warning diagnostics
-static const bool SuppressWarningsTrue = true;    // suppress warning diagnostics
-static const bool SuppressErrorsFalse = false;    // do not suppress error diagnostics
 static const bool SuppressErrorsTrue = true;      // suppress error diagnostics
 static const int OneRow = 1;                      // a single row for a type
 static const bool MipsFalse = false;              // a type does not support the .mips member
@@ -1507,24 +1499,6 @@ const char* g_DeprecatedEffectObjectNames[] =
   "RenderTargetView", // 16
 };
 
-// The CompareStringsWithLen function lexicographically compares LHS and RHS and
-// returns a value indicating the relationship between the strings - < 0 if LHS is
-// less than RHS, 0 if they are equal, > 0 if LHS is greater than RHS.
-static
-int CompareStringsWithLen(
-  _In_count_(LHSlen) const char* LHS, size_t LHSlen,
-  _In_count_(RHSlen) const char* RHS, size_t RHSlen
-)
-{
-  // Check whether the name is greater or smaller (without walking past end).
-  size_t maxNameComparable = std::min(LHSlen, RHSlen);
-  int comparison = strncmp(LHS, RHS, maxNameComparable);
-  if (comparison != 0) return comparison;
-
-  // Check whether the name is greater or smaller based on extra characters.
-  return LHSlen - RHSlen;
-}
-
 static hlsl::ParameterModifier
 ParamModsFromIntrinsicArg(const HLSL_INTRINSIC_ARGUMENT *pArg) {
   if (pArg->qwUsage == AR_QUAL_IN_OUT) {
@@ -1581,7 +1555,6 @@ static void AddHLSLIntrinsicAttr(FunctionDecl *FD, ASTContext &context,
   unsigned opcode = (unsigned)pIntrinsic->Op;
   if (HasUnsignedOpcode(opcode) && IsBuiltinTable(tableName)) {
     QualType Ty = FD->getReturnType();
-    IntrinsicOp intrinOp = static_cast<IntrinsicOp>(pIntrinsic->Op);
     if (pIntrinsic->iOverloadParamIndex != -1) {
       const FunctionProtoType *FT =
           FD->getFunctionType()->getAs<FunctionProtoType>();
@@ -1637,7 +1610,6 @@ FunctionDecl *AddHLSLIntrinsicFunction(
   IdentifierInfo &functionId = context.Idents.get(
       StringRef(pIntrinsic->pArgs[0].pName), tok::TokenKind::identifier);
   DeclarationName functionName(&functionId);
-  QualType returnQualType = functionArgQualTypes[0];
   QualType functionType = context.getFunctionType(
       functionArgQualTypes[0],
       ArrayRef<QualType>(functionArgQualTypes + 1,
@@ -2119,32 +2091,6 @@ bool DoesLegalTemplateAcceptMultipleTypes(BYTE value)
   return DoesLegalTemplateAcceptMultipleTypes(static_cast<LEGAL_INTRINSIC_TEMPLATES>(value));
 }
 
-
-static
-bool DoesIntrinsicRequireTemplate(const HLSL_INTRINSIC* intrinsic)
-{
-  const HLSL_INTRINSIC_ARGUMENT* argument = intrinsic->pArgs;
-  for (size_t i = 0; i < intrinsic->uNumArgs; i++)
-  {
-    // The intrinsic will require a template for any of these reasons:
-    // - A type template (layout) or component needs to match something else.
-    // - A parameter can take multiple types.
-    // - Row or columns numbers may vary.
-    if (
-      argument->uTemplateId != i ||
-      DoesLegalTemplateAcceptMultipleTypes(argument->uLegalTemplates) ||
-      DoesComponentTypeAcceptMultipleTypes(argument->uLegalComponentTypes) ||
-      IsRowOrColumnVariable(argument->uCols) ||
-      IsRowOrColumnVariable(argument->uRows))
-    {
-      return true;
-    }
-    argument++;
-  }
-
-  return false;
-}
-
 static
 bool TemplateHasDefaultType(ArBasicKind kind)
 {
@@ -3235,12 +3181,10 @@ public:
         R.addDecl(typeDecl);
       }
       else if (rowCount == 0) { // vector
-        QualType qt = LookupVectorType(parsedType, colCount);
         TypedefDecl *qts = LookupVectorShorthandType(parsedType, colCount);
         R.addDecl(qts);
       }
       else { // matrix
-        QualType qt = LookupMatrixType(parsedType, rowCount, colCount);
         TypedefDecl* qts = LookupMatrixShorthandType(parsedType, rowCount, colCount);
         R.addDecl(qts);
       }
@@ -4560,19 +4504,6 @@ QualType GetFirstElementTypeFromDecl(const Decl* decl)
   return QualType();
 }
 
-static
-QualType GetFirstElementType(QualType type)
-{
-  if (!type.isNull()) {
-    const RecordType* record = type->getAs<RecordType>();
-    if (record) {
-      return GetFirstElementTypeFromDecl(record->getDecl());
-    }
-  }
-
-  return QualType();
-}
-
 void HLSLExternalSource::AddBaseTypes()
 {
   DXASSERT(m_baseTypes[HLSLScalarType_unknown].isNull(), "otherwise unknown was initialized to an actual type");
@@ -8718,7 +8649,6 @@ bool HLSLExternalSource::TryStaticCastForHLSL(ExprResult &SrcExpr,
   DXASSERT(!SrcExpr.isInvalid(), "caller should check for invalid expressions and placeholder types");
   bool explicitConversion
     = (CCK == Sema::CCK_CStyleCast || CCK == Sema::CCK_FunctionalCast);
-  QualType sourceType = SrcExpr.get()->getType();
   bool suppressWarnings = explicitConversion || SuppressWarnings;
   SourceLocation loc = OpRange.getBegin();
   if (ValidateCast(loc, SrcExpr.get(), DestType, explicitConversion, suppressWarnings, SuppressErrors, standard)) {
@@ -9277,7 +9207,6 @@ void hlsl::DiagnoseTranslationUnit(clang::Sema *self) {
 
   // TODO: make these error 'real' errors rather than on-the-fly things
   // Validate that the entry point is available.
-  ASTContext &Ctx = self->getASTContext();
   DiagnosticsEngine &Diags = self->getDiagnostics();
   FunctionDecl *pEntryPointDecl = nullptr;
   FunctionDecl *pPatchFnDecl = nullptr;
@@ -10706,7 +10635,6 @@ Decl* Sema::ActOnStartHLSLBuffer(
   SourceLocation LBrace)
 {
   // For anonymous namespace, take the location of the left brace.
-  SourceLocation Loc = Ident ? IdentLoc : LBrace;
   DeclContext* lexicalParent = getCurLexicalContext();
   clang::HLSLBufferDecl *result = HLSLBufferDecl::Create(
       Context, lexicalParent, cbuffer, /*isConstantBufferView*/ false, KwLoc,
@@ -11064,9 +10992,6 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC,
 
   // Validate attributes
   clang::AttributeList
-    *pPrecise = nullptr,
-    *pShared = nullptr,
-    *pGroupShared = nullptr,
     *pUniform = nullptr,
     *pUsage = nullptr,
     *pNoInterpolation = nullptr,
@@ -11086,7 +11011,6 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC,
 
     switch (pAttr->getKind()) {
     case AttributeList::AT_HLSLPrecise: // precise is applicable everywhere.
-      pPrecise = pAttr;
       break;
     case AttributeList::AT_HLSLShared:
       if (!isGlobal) {
@@ -11100,7 +11024,6 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC,
             << pAttr->getRange();
         result = false;
       }
-      pShared = pAttr;
       break;
     case AttributeList::AT_HLSLGroupShared:
       if (!isGlobal) {
@@ -11114,7 +11037,6 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC,
             << pAttr->getRange();
         result = false;
       }
-      pGroupShared = pAttr;
       break;
     case AttributeList::AT_HLSLGloballyCoherent:
       if (!bIsObject) {

+ 0 - 6
tools/clang/lib/Sema/SemaOpenMP.cpp

@@ -455,12 +455,6 @@ OMPClause *Sema::ActOnOpenMPLinearClause(ArrayRef<Expr *> VarList, Expr *Step,
   llvm_unreachable("HLSL does not support OpenMP constructs");
 }
 
-static bool FinishOpenMPLinearClause(OMPLinearClause &Clause, DeclRefExpr *IV,
-  Expr *NumIterations, Sema &SemaRef,
-  Scope *S) {
-  llvm_unreachable("HLSL does not support OpenMP constructs");
-}
-
 OMPClause *Sema::ActOnOpenMPAlignedClause(
   ArrayRef<Expr *> VarList, Expr *Alignment, SourceLocation StartLoc,
   SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc) {

+ 0 - 5
tools/clang/tools/dxcompiler/dxcdisassembler.cpp

@@ -35,11 +35,6 @@ using namespace hlsl;
 namespace {
 // Disassemble helper functions.
 
-void PrintDiagnosticHandler(const DiagnosticInfo &DI, void *Context) {
-  DiagnosticPrinter *printer = reinterpret_cast<DiagnosticPrinter *>(Context);
-  DI.print(*printer);
-}
-
 template <typename T>
 const T *ByteOffset(LPCVOID p, uint32_t byteOffset) {
   return reinterpret_cast<const T *>((const uint8_t *)p + byteOffset);