From 42a8832ff7441e4c64eabfe7d2ec09278cca8813 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 22 Oct 2009 00:50:24 +0000 Subject: this doesn't use EH either. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84818 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-prof/CMakeLists.txt | 1 - tools/llvm-prof/Makefile | 1 - tools/llvm-prof/llvm-prof.cpp | 65 +++++++++++++++++++----------------------- 3 files changed, 29 insertions(+), 38 deletions(-) (limited to 'tools/llvm-prof') diff --git a/tools/llvm-prof/CMakeLists.txt b/tools/llvm-prof/CMakeLists.txt index 9a5115085d..442112bc88 100644 --- a/tools/llvm-prof/CMakeLists.txt +++ b/tools/llvm-prof/CMakeLists.txt @@ -1,5 +1,4 @@ set(LLVM_LINK_COMPONENTS bitreader analysis) -set(LLVM_REQUIRES_EH 1) add_llvm_tool(llvm-prof llvm-prof.cpp diff --git a/tools/llvm-prof/Makefile b/tools/llvm-prof/Makefile index 3c4948e615..86eb54d51b 100644 --- a/tools/llvm-prof/Makefile +++ b/tools/llvm-prof/Makefile @@ -10,7 +10,6 @@ LEVEL = ../.. TOOLNAME = llvm-prof LINK_COMPONENTS = bitreader analysis -REQUIRES_EH := 1 # This tool has no plugins, optimize startup time. TOOL_NO_EXPORTS = 1 diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp index cff139e125..88adeb43e6 100644 --- a/tools/llvm-prof/llvm-prof.cpp +++ b/tools/llvm-prof/llvm-prof.cpp @@ -255,41 +255,34 @@ int main(int argc, char **argv) { LLVMContext &Context = getGlobalContext(); llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. - try { - cl::ParseCommandLineOptions(argc, argv, "llvm profile dump decoder\n"); - - // Read in the bitcode file... - std::string ErrorMessage; - Module *M = 0; - if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile, - &ErrorMessage)) { - M = ParseBitcodeFile(Buffer, Context, &ErrorMessage); - delete Buffer; - } - if (M == 0) { - errs() << argv[0] << ": " << BitcodeFile << ": " - << ErrorMessage << "\n"; - return 1; - } - - // Read the profiling information. This is redundant since we load it again - // using the standard profile info provider pass, but for now this gives us - // access to additional information not exposed via the ProfileInfo - // interface. - ProfileInfoLoader PIL(argv[0], ProfileDataFile, *M); - - // Run the printer pass. - PassManager PassMgr; - PassMgr.add(createProfileLoaderPass(ProfileDataFile)); - PassMgr.add(new ProfileInfoPrinterPass(PIL)); - PassMgr.run(*M); - - return 0; - } catch (const std::string& msg) { - errs() << argv[0] << ": " << msg << "\n"; - } catch (...) { - errs() << argv[0] << ": Unexpected unknown exception occurred.\n"; - } - return 1; + cl::ParseCommandLineOptions(argc, argv, "llvm profile dump decoder\n"); + + // Read in the bitcode file... + std::string ErrorMessage; + Module *M = 0; + if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile, + &ErrorMessage)) { + M = ParseBitcodeFile(Buffer, Context, &ErrorMessage); + delete Buffer; + } + if (M == 0) { + errs() << argv[0] << ": " << BitcodeFile << ": " + << ErrorMessage << "\n"; + return 1; + } + + // Read the profiling information. This is redundant since we load it again + // using the standard profile info provider pass, but for now this gives us + // access to additional information not exposed via the ProfileInfo + // interface. + ProfileInfoLoader PIL(argv[0], ProfileDataFile, *M); + + // Run the printer pass. + PassManager PassMgr; + PassMgr.add(createProfileLoaderPass(ProfileDataFile)); + PassMgr.add(new ProfileInfoPrinterPass(PIL)); + PassMgr.run(*M); + + return 0; } -- cgit v1.2.3