allow unpredictable metadata on switch statements
authorSanjay Patel <spatel@rotateright.com>
Wed, 9 Sep 2015 18:38:30 +0000 (18:38 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 9 Sep 2015 18:38:30 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247174 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/IRBuilder.h

index 778a58a8b87b374a22728ae155d62de9cea6d0e3..a515e165c5074a329a2b017019c540ba8a66d5cd 100644 (file)
@@ -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