[PATCH] D30913: [NFC] Feature generic options to setup start/stop-after/before

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 14:57:55 PDT 2017


qcolombet created this revision.

Hi,

This patch refactors the code used in llc such that all the users of the addPassesToEmitFile API have access to a homogeneous way of handling start/stop-after/before options right out of the box.

Previously each user would have needed to duplicate this logic and set up its own options.

Note:
I am not super happy about the error reporting. I would have preferred this to be handled by the caller of the getPassXXX methods. However, since I wanted to have the start/stop-after/before options working out-of-the-box, that's not possible. Indeed that would mean that every user of the getPassXXX API would need to have code to unbox/treat the error case. Thus, I settle for a direct reporting. Given this is more of a developer capability, I thought it would be good enough.

Moreover, the current patch loses the prefix "llc: " or "stop-after" in the error message. I initially thought about passing an additional prefix to the error message (with a default "LLVM: "), but again I thought given the usage of that stuff, this was not worth the effort/complexity.

What do people think?

Cheers,
-Quentin


Repository:
  rL LLVM

https://reviews.llvm.org/D30913

Files:
  include/llvm/Target/TargetMachine.h
  lib/Target/TargetMachine.cpp
  test/CodeGen/Generic/llc-start-stop.ll
  tools/llc/llc.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30913.91624.patch
Type: text/x-patch
Size: 13315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170313/5f2583af/attachment.bin>


More information about the llvm-commits mailing list