[PATCH] D31057: Make Argument::getArgNo() constant time, not O(#args)

Sameer AbuAsal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 15:53:36 PDT 2017


sabuasal added a comment.

Hi, 
This seems like a nice optimization.

I was just wondering if it is a good idea to silently push this with a default argument for ArgNo. there is other locations in LLVM where an Argument object is constructed with the default parameter without realizing that this will break their getArgNo.

for example:
git grep -n  "new Argument("
lib/AsmParser/LLParser.cpp:2533:    FwdVal = new Argument(Ty, Name);
lib/AsmParser/LLParser.cpp:2573:    FwdVal = new Argument(Ty);
lib/Bitcode/Reader/ValueList.cpp:116:  Value *V = new Argument(Ty);


Repository:
  rL LLVM

https://reviews.llvm.org/D31057





More information about the llvm-commits mailing list