diff options
author | Zack Rusin <[email protected]> | 2007-10-29 13:20:55 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-10-30 05:15:06 -0400 |
commit | 75a9018fb90c93033ee5cbade9dd2febdc195d11 (patch) | |
tree | 8ef8fe7600bf3dbd040242eeb2a8082b87533881 | |
parent | fd908ce234d1f553b59d65afb7e4243ffee24018 (diff) |
Dump only relevant functions when in the debugging output.
-rw-r--r-- | src/mesa/pipe/llvm/llvmtgsi.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/mesa/pipe/llvm/llvmtgsi.cpp b/src/mesa/pipe/llvm/llvmtgsi.cpp index 797843c7c36..94fc708606b 100644 --- a/src/mesa/pipe/llvm/llvmtgsi.cpp +++ b/src/mesa/pipe/llvm/llvmtgsi.cpp @@ -802,14 +802,20 @@ void gallivm_prog_dump(struct gallivm_prog *prog, const char *file_prefix) out << (*mod); out.close(); } else { - std::ostringstream stream; - stream << "execute_shader"; - stream << prog->id; - std::string func_name = stream.str(); - llvm::Function *func = mod->getFunction(func_name.c_str()); - assert(func); + const llvm::Module::FunctionListType &funcs = mod->getFunctionList(); + llvm::Module::FunctionListType::const_iterator itr; std::cout<<"; ---------- Start shader "<<prog->id<<std::endl; - std::cout<<*mod<<std::endl; + for (itr = funcs.begin(); itr != funcs.end(); ++itr) { + const llvm::Function &func = (*itr); + std::string name = func.getName(); + const llvm::Function *found = 0; + if (name.find("execute_shader") != std::string::npos || + name.find("function") != std::string::npos) + found = &func; + if (found) { + std::cout<<*found<<std::endl; + } + } std::cout<<"; ---------- End shader "<<prog->id<<std::endl; } } |