1515#include " llvm/ADT/Twine.h"
1616#include " llvm/Analysis/DXILMetadataAnalysis.h"
1717#include " llvm/Analysis/DXILResource.h"
18+ #include " llvm/IR/BasicBlock.h"
1819#include " llvm/IR/Constants.h"
1920#include " llvm/IR/DiagnosticInfo.h"
2021#include " llvm/IR/DiagnosticPrinter.h"
@@ -299,11 +300,11 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode *RMD,
299300// TODO: We might need to refactor this to be more generic,
300301// in case we need more metadata to be replaced.
301302static void translateBranchMetadata (Module &M) {
302- for (auto &F : M) {
303- for (auto &BB : F) {
304- auto *BBTerminatorInst = BB.getTerminator ();
303+ for (Function &F : M) {
304+ for (BasicBlock &BB : F) {
305+ Instruction *BBTerminatorInst = BB.getTerminator ();
305306
306- auto *HlslControlFlowMD =
307+ MDNode *HlslControlFlowMD =
307308 BBTerminatorInst->getMetadata (" hlsl.controlflow.hint" );
308309
309310 if (!HlslControlFlowMD)
@@ -313,14 +314,14 @@ static void translateBranchMetadata(Module &M) {
313314 " invalid operands for hlsl.controlflow.hint" );
314315
315316 MDBuilder MDHelper (M.getContext ());
316- auto *Op1 =
317+ ConstantInt *Op1 =
317318 mdconst::extract<ConstantInt>(HlslControlFlowMD->getOperand (1 ));
318319
319320 SmallVector<llvm::Metadata *, 2 > Vals (
320321 ArrayRef<Metadata *>{MDHelper.createString (" dx.controlflow.hints" ),
321322 MDHelper.createConstant (Op1)});
322323
323- auto *MDNode = llvm::MDNode::get (M.getContext (), Vals);
324+ MDNode *MDNode = llvm::MDNode::get (M.getContext (), Vals);
324325
325326 BBTerminatorInst->setMetadata (" dx.controlflow.hints" , MDNode);
326327 BBTerminatorInst->setMetadata (" hlsl.controlflow.hint" , nullptr );
0 commit comments