diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2014-12-13 04:52:04 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2014-12-13 04:52:04 +0000 |
commit | 7ba78302b59a0cf7d2bc90a831ca201e107f4d47 (patch) | |
tree | 009f28ff358b9337a0910bac473b7a5c84496917 /llvm | |
parent | 70a1568d91fb1acb155bbed9eb18c4ffdb6c3f18 (diff) | |
download | bcm5719-llvm-7ba78302b59a0cf7d2bc90a831ca201e107f4d47.tar.gz bcm5719-llvm-7ba78302b59a0cf7d2bc90a831ca201e107f4d47.zip |
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
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/Passes.cpp | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/Generic/print-machineinstrs.ll | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp b/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp index dee3977cd08..790f5accdb2 100644 --- a/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp +++ b/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp @@ -52,7 +52,7 @@ char MachineFunctionPrinterPass::ID = 0; } char &llvm::MachineFunctionPrinterPassID = MachineFunctionPrinterPass::ID; -INITIALIZE_PASS(MachineFunctionPrinterPass, "print-machineinstrs", +INITIALIZE_PASS(MachineFunctionPrinterPass, "machineinstr-printer", "Machine Function Printer", false, false) namespace llvm { diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index cc8f3a075e9..9fe23c5b227 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -144,12 +144,12 @@ char MachineScheduler::ID = 0; char &llvm::MachineSchedulerID = MachineScheduler::ID; -INITIALIZE_PASS_BEGIN(MachineScheduler, "misched", +INITIALIZE_PASS_BEGIN(MachineScheduler, "machine-scheduler", "Machine Instruction Scheduler", false, false) INITIALIZE_AG_DEPENDENCY(AliasAnalysis) INITIALIZE_PASS_DEPENDENCY(SlotIndexes) INITIALIZE_PASS_DEPENDENCY(LiveIntervals) -INITIALIZE_PASS_END(MachineScheduler, "misched", +INITIALIZE_PASS_END(MachineScheduler, "machine-scheduler", "Machine Instruction Scheduler", false, false) MachineScheduler::MachineScheduler() diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp index 453d5cf77d3..5e1117522db 100644 --- a/llvm/lib/CodeGen/Passes.cpp +++ b/llvm/lib/CodeGen/Passes.cpp @@ -520,7 +520,7 @@ void TargetPassConfig::addMachinePasses() { .equals("option-unspecified")) { const PassRegistry *PR = PassRegistry::getPassRegistry(); const PassInfo *TPI = PR->getPassInfo(PrintMachineInstrs.getValue()); - const PassInfo *IPI = PR->getPassInfo(StringRef("print-machineinstrs")); + const PassInfo *IPI = PR->getPassInfo(StringRef("machineinstr-printer")); assert (TPI && IPI && "Pass ID not registered!"); const char *TID = (const char *)(TPI->getTypeInfo()); const char *IID = (const char *)(IPI->getTypeInfo()); diff --git a/llvm/test/CodeGen/Generic/print-machineinstrs.ll b/llvm/test/CodeGen/Generic/print-machineinstrs.ll index 75dceb5b262..26bccaae572 100644 --- a/llvm/test/CodeGen/Generic/print-machineinstrs.ll +++ b/llvm/test/CodeGen/Generic/print-machineinstrs.ll @@ -3,7 +3,7 @@ ; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -o /dev/null 2>&1 | FileCheck %s define i64 @foo(i64 %a, i64 %b) nounwind { -; CHECK: -branch-folder -print-machineinstrs +; CHECK: -branch-folder -machineinstr-printer ; CHECK: Control Flow Optimizer ; CHECK-NEXT: MachineFunction Printer ; CHECK: Machine code for function foo: |