From 97878fcf7d3ecec59ba290988d7624b24bb0033e Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 9 Sep 2015 18:38:30 +0000 Subject: [PATCH] allow unpredictable metadata on switch statements git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247174 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/IRBuilder.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/llvm/IR/IRBuilder.h b/include/llvm/IR/IRBuilder.h index 778a58a8b87..a515e165c50 100644 --- a/include/llvm/IR/IRBuilder.h +++ b/include/llvm/IR/IRBuilder.h @@ -632,10 +632,10 @@ public: /// and with a hint for the number of cases that will be added (for efficient /// allocation). SwitchInst *CreateSwitch(Value *V, BasicBlock *Dest, unsigned NumCases = 10, - MDNode *BranchWeights = nullptr) { - // TODO: Add unpredictable metadata for a switch. + MDNode *BranchWeights = nullptr, + MDNode *Unpredictable = nullptr) { return Insert(addBranchMetadata(SwitchInst::Create(V, Dest, NumCases), - BranchWeights, nullptr)); + BranchWeights, Unpredictable)); } /// \brief Create an indirect branch instruction with the specified address -- 2.34.1