Commit 97558d89 authored by nagayama15's avatar nagayama15

出力を関数毎のみに変更

parent b8e98f4a
...@@ -19,6 +19,7 @@ namespace ...@@ -19,6 +19,7 @@ namespace
*/ */
explicit BlockCounterPass() explicit BlockCounterPass()
: FunctionPass(ID) : FunctionPass(ID)
, module_name_()
{ {
} }
...@@ -40,8 +41,7 @@ namespace ...@@ -40,8 +41,7 @@ namespace
*/ */
bool doInitialization(llvm::Module& module) override bool doInitialization(llvm::Module& module) override
{ {
llvm::errs() module_name_ = module.getName();
<< "[BlockCounter - module ] start: " << module.getName() << "\n";
return false; return false;
} }
...@@ -55,8 +55,7 @@ namespace ...@@ -55,8 +55,7 @@ namespace
*/ */
bool doFinalization(llvm::Module& module) override bool doFinalization(llvm::Module& module) override
{ {
llvm::errs() module_name_.clear();
<< "[BlockCounter - module ] finish: " << module.getName() << "\n";
return false; return false;
} }
...@@ -71,10 +70,13 @@ namespace ...@@ -71,10 +70,13 @@ namespace
bool runOnFunction(llvm::Function& func) override bool runOnFunction(llvm::Function& func) override
{ {
llvm::errs() llvm::errs()
<< "[BlockCounter - function ] '" << func.getName() << "' Basic blocks: " << func.getBasicBlockList().size() << "\n"; << "[BlockCounter - '" << func.getName() << "' in " << module_name_ << "] Basic blocks: " << func.getBasicBlockList().size() << "\n";
return false; return false;
} }
private:
std::string module_name_;
}; };
char BlockCounterPass::ID; char BlockCounterPass::ID;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment