Rename argument strings of codegen passes to avoid collisions with command line
authorAkira Hatanaka <ahatanaka@apple.com>
Sat, 13 Dec 2014 04:52:04 +0000 (04:52 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Sat, 13 Dec 2014 04:52:04 +0000 (04:52 +0000)
commit7ba78302b59a0cf7d2bc90a831ca201e107f4d47
tree009f28ff358b9337a0910bac473b7a5c84496917
parent70a1568d91fb1acb155bbed9eb18c4ffdb6c3f18
Rename argument strings of codegen passes to avoid collisions with command line
options.

This commit changes the command line arguments (PassInfo::PassArgument) of two
passes, MachineFunctionPrinter and MachineScheduler, to avoid collisions with
command line options that have the same argument strings.

This bug manifests when the PassList construct (defined in opt.cpp) is used
in a tool that links with codegen passes. To reproduce the bug, paste the
following lines into llc.cpp and run llc.

#include "llvm/IR/LegacyPassNameParser.h"
static llvm::cl::list<const llvm::PassInfo*, bool, llvm::PassNameParser>
PassList(llvm::cl::desc("Optimizations available:"));

rdar://problem/19212448

llvm-svn: 224186
llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp
llvm/lib/CodeGen/MachineScheduler.cpp
llvm/lib/CodeGen/Passes.cpp
llvm/test/CodeGen/Generic/print-machineinstrs.ll