forked from OSchip/llvm-project
Teach -callgraph to always print the callgraph (as the
description says it does), not just when -analyze is used as well. This means printing to stderr, so adjust some tests. llvm-svn: 56337
This commit is contained in:
parent
a8e88ecda6
commit
938e8f60d6
|
@ -1,4 +1,4 @@
|
|||
; RUN: llvm-as < %s | opt -analyze -callgraph -disable-output | grep {Calls function 'callee'} | count 2
|
||||
; RUN: llvm-as < %s | opt -callgraph -disable-output |& grep {Calls function 'callee'} | count 2
|
||||
|
||||
define internal void @callee(...) {
|
||||
entry:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: llvm-as < %s | opt -analyze -callgraph -disable-output | grep {Calls function}
|
||||
; RUN: llvm-as < %s | opt -callgraph -disable-output |& grep {Calls function}
|
||||
|
||||
@a = global void ()* @f ; <void ()**> [#uses=0]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
; Call graph construction crash: Not handling indirect calls right
|
||||
;
|
||||
; RUN: llvm-as < %s | opt -analyze -callgraph
|
||||
; RUN: llvm-as < %s | opt -analyze -callgraph >& /dev/null
|
||||
;
|
||||
|
||||
%FunTy = type i32 (i32)
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace {
|
|||
char ExternalFunctionsPassedConstants::ID = 0;
|
||||
RegisterPass<ExternalFunctionsPassedConstants>
|
||||
P1("externalfnconstants", "Print external fn callsites passed constants");
|
||||
|
||||
|
||||
struct CallGraphPrinter : public ModulePass {
|
||||
static char ID; // Pass ID, replacement for typeid
|
||||
CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
|
||||
|
@ -75,13 +75,12 @@ namespace {
|
|||
AU.setPreservesAll();
|
||||
AU.addRequiredTransitive<CallGraph>();
|
||||
}
|
||||
virtual bool runOnModule(Module &M) { return false; }
|
||||
|
||||
virtual void print(std::ostream &OS, const Module *M) const {
|
||||
getAnalysis<CallGraph>().print(OS, M);
|
||||
virtual bool runOnModule(Module &M) {
|
||||
getAnalysis<CallGraph>().print(std::cerr, &M);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
char CallGraphPrinter::ID = 0;
|
||||
RegisterPass<CallGraphPrinter>
|
||||
P2("callgraph", "Print a call graph");
|
||||
|
|
Loading…
Reference in New Issue