make print-after= print-before= option work for clang driver

Xinliang David Li xinliangli at gmail.com
Tue Jun 18 16:18:16 PDT 2013


In current implementation, Dumping IR using clang driver for a given
pass will give you option parsing error:

clang -O2 -mllvm -print-after=gvn -c ...t.c

The LLVM option parser will complain that 'Cannot find option named gvn'.

The root cause is that the option parser assumes the passe have been
registered, but this is not true for pass manager scheduled passes.

The option works for 'opt' driver. The proposed fix is similar to what
opt driver does.

The change is in clang, but LLVM specific.

Does it look ok?

thanks,

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: print-after.p
Type: application/octet-stream
Size: 1604 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130618/380feed1/attachment.obj>


More information about the llvm-commits mailing list