<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span style="font-size: 14px;" class="">Hi,</span><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><span style="font-size: 14px;" class="">I have to pass different values to my instrumented function based on types. Right now this is what I am doing -</span></div><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><table class="js-file-line-container highlight tab-size" data-tab-size="8" style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; tab-size: 8; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";"><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box;" class=""><td id="L595" class="blob-num js-line-number" data-line-number="595" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; color: rgba(27, 31, 35, 0.298039); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none;"></td><td id="LC595" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; line-height: 20px; vertical-align: top; overflow: visible; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; white-space: pre;"><span style="font-size: 14px;" class="">    </span></td></tr><tr style="box-sizing: border-box;" class=""><td id="L596" class="blob-num js-line-number" data-line-number="596" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; color: rgba(27, 31, 35, 0.298039); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none;"></td><td id="LC596" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; line-height: 20px; vertical-align: top; overflow: visible; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; white-space: pre;"><span style="font-size: 14px;" class="">    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">if</span> (fpConstant_op0-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getTypeID</span>() == Type::FloatTyID && fpConstant_op1-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getTypeID</span>() == Type::DoubleTyID)</span></td></tr><tr style="box-sizing: border-box;" class=""><td id="L597" class="blob-num js-line-number" data-line-number="597" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; color: rgba(27, 31, 35, 0.298039); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none;"></td><td id="LC597" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; line-height: 20px; vertical-align: top; overflow: visible; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; white-space: pre;"><span style="font-size: 14px;" class="">      HandleOp = M-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getOrInsertFunction</span>(<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);"><span class="pl-pds" style="box-sizing: border-box;">"</span>handleOp_fd<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, void_ptr_ty, int_ty, float_ty, double_ty);</span></td></tr><tr style="box-sizing: border-box;" class=""><td id="L598" class="blob-num js-line-number" data-line-number="598" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; color: rgba(27, 31, 35, 0.298039); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none;"></td><td id="LC598" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; line-height: 20px; vertical-align: top; overflow: visible; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; white-space: pre;"><span style="font-size: 14px;" class="">    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">else</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">if</span> (fpConstant_op0-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getTypeID</span>() == Type::DoubleTyID && fpConstant_op1-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getTypeID</span>() == Type::FloatTyID)</span></td></tr><tr style="box-sizing: border-box;" class=""><td id="L599" class="blob-num js-line-number" data-line-number="599" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; color: rgba(27, 31, 35, 0.298039); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none;"></td><td id="LC599" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; line-height: 20px; vertical-align: top; overflow: visible; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; white-space: pre;"><span style="font-size: 14px;" class="">      HandleOp = M-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getOrInsertFunction</span>(<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);"><span class="pl-pds" style="box-sizing: border-box;">"</span>handleOp_df<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, void_ptr_ty, int_ty, double_ty, float_ty);</span></td></tr><tr style="box-sizing: border-box;" class=""><td id="L600" class="blob-num js-line-number" data-line-number="600" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; color: rgba(27, 31, 35, 0.298039); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none;"></td><td id="LC600" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; line-height: 20px; vertical-align: top; overflow: visible; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; white-space: pre;"><span style="font-size: 14px;" class="">    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">else</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">if</span> (fpConstant_op0-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getTypeID</span>() == Type::DoubleTyID && fpConstant_op1-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getTypeID</span>() == Type::DoubleTyID)</span></td></tr><tr style="box-sizing: border-box;" class=""><td id="L601" class="blob-num js-line-number" data-line-number="601" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; color: rgba(27, 31, 35, 0.298039); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none;"></td><td id="LC601" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; line-height: 20px; vertical-align: top; overflow: visible; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; white-space: pre;"><span style="font-size: 14px;" class="">      HandleOp = M-><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">getOrInsertFunction</span>(<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);"><span class="pl-pds" style="box-sizing: border-box;">"</span>handleOp_dd<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, void_ptr_ty, int_ty, double_ty, double_ty);</span></td></tr></tbody></table><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div></div><div class=""><span style="font-size: 14px;" class="">I am having different functions based on types. My handles look like this</span></div><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><span style="font-size: 14px;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;"><span class="Apple-tab-span" style="white-space:pre">      </span>extern</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;"><span class="pl-pds" style="box-sizing: border-box;">"</span>C<span class="pl-pds" style="box-sizing: border-box;">"</span></span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">void</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">* </span><span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">handleOp_fd</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">(</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">size_t</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> opCode, </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">float</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> op1, </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">double</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> op2)</span></span></div><div class=""><span style="font-size: 14px;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;"><span class="Apple-tab-span" style="white-space:pre">      </span>extern</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;"><span class="pl-pds" style="box-sizing: border-box;">"</span>C<span class="pl-pds" style="box-sizing: border-box;">"</span></span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">void</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">* </span><span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">handleOp_df</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">(</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">size_t</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> opCode, </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">double</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> op1, </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">float</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> op2)</span></span></div><div class=""><span style="font-size: 14px;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;"><span class="Apple-tab-span" style="white-space:pre">      </span>extern</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;"><span class="pl-pds" style="box-sizing: border-box;">"</span>C<span class="pl-pds" style="box-sizing: border-box;">"</span></span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">void</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">* </span><span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">handleOp_dd</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">(</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">size_t</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> opCode, </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">double</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> op1, </span><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre;">double</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> op2)</span></span></div><div class=""><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255); font-size: 14px;" class=""><br class=""></span></div><div class=""><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255); font-size: 14px;" class="">How can I unify this?. Instead of having many functions based on types, I want to have only one function and pass different values with their types. </span></div><div class=""><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; white-space: pre; background-color: rgb(255, 255, 255); font-size: 14px;" class="">Any help would be much appreciated.</span></div></body></html>