[PATCH] D39982: [IRBuilder] Set the insert point and debug location together

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 13:18:53 PST 2017


davide added inline comments.


================
Comment at: lib/IR/Core.cpp:2393
 
+void LLVMPositionBuilder2(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
+                          LLVMValueRef Instr, LLVMValueRef Loc) {
----------------
vsk wrote:
> davide wrote:
> > The *2 variants are probably OK, and other projects seem to use it successfully.
> > http://man7.org/linux/man-pages/man2/rename.2.html
> > Not sure if we have a precedent, but it doesn't seem a bad path forward.
> I've seen this pattern floating around, e.g LLVMParseBitcodeInContext2, clang_createTranslationUnit2, etc. IMO '2' implies 'newer', which is good.
In general these are slightly more counterintuitive to use.
I'd say people shouldn't be really concerned with the past when using an API. I have no strong feelings about it, but maybe it's better to choose a better name.


https://reviews.llvm.org/D39982





More information about the llvm-commits mailing list