mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.
With this change, I can now move -stats to print when llvm_shutdown is called. llvm-svn: 32250
This commit is contained in:
parent
30bf130327
commit
41c5ddb8cb
@ -18,6 +18,7 @@
|
|||||||
#include "llvm/LinkAllPasses.h"
|
#include "llvm/LinkAllPasses.h"
|
||||||
#include "llvm/Support/PassNameParser.h"
|
#include "llvm/Support/PassNameParser.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/PluginLoader.h"
|
#include "llvm/Support/PluginLoader.h"
|
||||||
#include "llvm/System/Process.h"
|
#include "llvm/System/Process.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
@ -59,6 +60,7 @@ static void BugpointInterruptFunction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
cl::ParseCommandLineOptions(argc, argv,
|
cl::ParseCommandLineOptions(argc, argv,
|
||||||
" LLVM automatic testcase reducer. See\nhttp://"
|
" LLVM automatic testcase reducer. See\nhttp://"
|
||||||
"llvm.org/docs/CommandGuide/bugpoint.html"
|
"llvm.org/docs/CommandGuide/bugpoint.html"
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -133,6 +134,7 @@ void AddConfiguredTransformationPasses(PassManager &PM) {
|
|||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv,
|
cl::ParseCommandLineOptions(argc, argv,
|
||||||
" llvm .s -> .o assembler for GCC\n");
|
" llvm .s -> .o assembler for GCC\n");
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/FileUtilities.h"
|
#include "llvm/Support/FileUtilities.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
@ -214,6 +215,7 @@ static void BuildLinkItems(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv, char **envp ) {
|
int main(int argc, char **argv, char **envp ) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "llvm/PassManager.h"
|
#include "llvm/PassManager.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/PluginLoader.h"
|
#include "llvm/Support/PluginLoader.h"
|
||||||
#include "llvm/Support/FileUtilities.h"
|
#include "llvm/Support/FileUtilities.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
@ -168,6 +169,7 @@ static std::ostream *GetOutputStream(const char *ProgName) {
|
|||||||
// main - Entry point for the llc compiler.
|
// main - Entry point for the llc compiler.
|
||||||
//
|
//
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm system compiler\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm system compiler\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "llvm/ExecutionEngine/Interpreter.h"
|
#include "llvm/ExecutionEngine/Interpreter.h"
|
||||||
#include "llvm/ExecutionEngine/GenericValue.h"
|
#include "llvm/ExecutionEngine/GenericValue.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/PluginLoader.h"
|
#include "llvm/Support/PluginLoader.h"
|
||||||
#include "llvm/System/Process.h"
|
#include "llvm/System/Process.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
@ -56,6 +57,7 @@ namespace {
|
|||||||
// main Driver function
|
// main Driver function
|
||||||
//
|
//
|
||||||
int main(int argc, char **argv, char * const *envp) {
|
int main(int argc, char **argv, char * const *envp) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv,
|
cl::ParseCommandLineOptions(argc, argv,
|
||||||
" llvm interpreter & dynamic compiler\n");
|
" llvm interpreter & dynamic compiler\n");
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
#include "llvm/Bytecode/Archive.h"
|
#include "llvm/Bytecode/Archive.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/Compressor.h"
|
#include "llvm/Support/Compressor.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
// Option for compatibility with ASIX, not used but must allow it to be present.
|
// Option for compatibility with ASIX, not used but must allow it to be present.
|
||||||
@ -696,6 +696,7 @@ doReplaceOrInsert(std::string* ErrMsg) {
|
|||||||
|
|
||||||
// main - main program for llvm-ar .. see comments in the code
|
// main - main program for llvm-ar .. see comments in the code
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
|
|
||||||
// Have the command line options parsed and handle things
|
// Have the command line options parsed and handle things
|
||||||
// like --help and --version.
|
// like --help and --version.
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "llvm/Bytecode/Writer.h"
|
#include "llvm/Bytecode/Writer.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
@ -50,6 +51,7 @@ DisableVerify("disable-verify", cl::Hidden,
|
|||||||
cl::desc("Do not run verifier on input LLVM (dangerous!)"));
|
cl::desc("Do not run verifier on input LLVM (dangerous!)"));
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/Bytecode/Analyzer.h"
|
#include "llvm/Bytecode/Analyzer.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -48,8 +49,8 @@ static cl::opt<bool> NoDetails ("nodetails", cl::desc("Skip detailed output"));
|
|||||||
static cl::opt<bool> Dump ("dump", cl::desc("Dump low level bytecode trace"));
|
static cl::opt<bool> Dump ("dump", cl::desc("Dump low level bytecode trace"));
|
||||||
static cl::opt<bool> Verify ("verify", cl::desc("Progressively verify module"));
|
static cl::opt<bool> Verify ("verify", cl::desc("Progressively verify module"));
|
||||||
|
|
||||||
int
|
int main(int argc, char **argv) {
|
||||||
main(int argc, char **argv) {
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv,
|
cl::ParseCommandLineOptions(argc, argv,
|
||||||
" llvm-bcanalyzer Analysis of ByteCode Dumper\n");
|
" llvm-bcanalyzer Analysis of ByteCode Dumper\n");
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
|
|
||||||
#include "CLIDebugger.h"
|
#include "CLIDebugger.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -49,6 +49,7 @@ namespace {
|
|||||||
// main Driver function
|
// main Driver function
|
||||||
//
|
//
|
||||||
int main(int argc, char **argv, char * const *envp) {
|
int main(int argc, char **argv, char * const *envp) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
std::cout << "NOTE: llvm-db is known useless right now.\n";
|
std::cout << "NOTE: llvm-db is known useless right now.\n";
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv,
|
cl::ParseCommandLineOptions(argc, argv,
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "llvm/Bytecode/Reader.h"
|
#include "llvm/Bytecode/Reader.h"
|
||||||
#include "llvm/Assembly/PrintModulePass.h"
|
#include "llvm/Assembly/PrintModulePass.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -39,6 +40,7 @@ static cl::opt<bool>
|
|||||||
Force("f", cl::desc("Overwrite output files"));
|
Force("f", cl::desc("Overwrite output files"));
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
@ -115,6 +117,7 @@ int main(int argc, char **argv) {
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
|
llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "llvm/Transforms/IPO.h"
|
#include "llvm/Transforms/IPO.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -47,6 +48,7 @@ ExtractFunc("func", cl::desc("Specify function to extract"), cl::init("main"),
|
|||||||
cl::value_desc("function"));
|
cl::value_desc("function"));
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm extractor\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm extractor\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "llvm/Target/TargetMachineRegistry.h"
|
#include "llvm/Target/TargetMachineRegistry.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/FileUtilities.h"
|
#include "llvm/Support/FileUtilities.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
@ -433,6 +434,7 @@ extern void Optimize(Module*);
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv, char **envp) {
|
int main(int argc, char **argv, char **envp) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
// Initial global variable above for convenience printing of program name.
|
// Initial global variable above for convenience printing of program name.
|
||||||
progname = sys::Path(argv[0]).getBasename();
|
progname = sys::Path(argv[0]).getBasename();
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "llvm/Bytecode/Reader.h"
|
#include "llvm/Bytecode/Reader.h"
|
||||||
#include "llvm/Bytecode/Writer.h"
|
#include "llvm/Bytecode/Writer.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include "llvm/System/Path.h"
|
#include "llvm/System/Path.h"
|
||||||
@ -75,6 +76,7 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm linker\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm linker\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "llvm/Bytecode/Reader.h"
|
#include "llvm/Bytecode/Reader.h"
|
||||||
#include "llvm/Bytecode/Archive.h"
|
#include "llvm/Bytecode/Archive.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
@ -65,18 +66,18 @@ namespace {
|
|||||||
std::string ToolName;
|
std::string ToolName;
|
||||||
}
|
}
|
||||||
|
|
||||||
char TypeCharForSymbol (GlobalValue &GV) {
|
static char TypeCharForSymbol(GlobalValue &GV) {
|
||||||
if (GV.isExternal ()) return 'U';
|
if (GV.isExternal()) return 'U';
|
||||||
if (GV.hasLinkOnceLinkage ()) return 'C';
|
if (GV.hasLinkOnceLinkage()) return 'C';
|
||||||
if (GV.hasWeakLinkage ()) return 'W';
|
if (GV.hasWeakLinkage()) return 'W';
|
||||||
if (isa<Function> (GV) && GV.hasInternalLinkage ()) return 't';
|
if (isa<Function>(GV) && GV.hasInternalLinkage()) return 't';
|
||||||
if (isa<Function> (GV)) return 'T';
|
if (isa<Function>(GV)) return 'T';
|
||||||
if (isa<GlobalVariable> (GV) && GV.hasInternalLinkage ()) return 'd';
|
if (isa<GlobalVariable>(GV) && GV.hasInternalLinkage()) return 'd';
|
||||||
if (isa<GlobalVariable> (GV)) return 'D';
|
if (isa<GlobalVariable>(GV)) return 'D';
|
||||||
return '?';
|
return '?';
|
||||||
}
|
}
|
||||||
|
|
||||||
void DumpSymbolNameForGlobalValue (GlobalValue &GV) {
|
static void DumpSymbolNameForGlobalValue(GlobalValue &GV) {
|
||||||
const std::string SymbolAddrStr = " "; // Not used yet...
|
const std::string SymbolAddrStr = " "; // Not used yet...
|
||||||
char TypeChar = TypeCharForSymbol (GV);
|
char TypeChar = TypeCharForSymbol (GV);
|
||||||
if ((TypeChar != 'U') && UndefinedOnly)
|
if ((TypeChar != 'U') && UndefinedOnly)
|
||||||
@ -101,7 +102,7 @@ void DumpSymbolNameForGlobalValue (GlobalValue &GV) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DumpSymbolNamesFromModule (Module *M) {
|
static void DumpSymbolNamesFromModule(Module *M) {
|
||||||
const std::string &Filename = M->getModuleIdentifier ();
|
const std::string &Filename = M->getModuleIdentifier ();
|
||||||
if (OutputFormat == posix && MultipleFiles) {
|
if (OutputFormat == posix && MultipleFiles) {
|
||||||
std::cout << Filename << ":\n";
|
std::cout << Filename << ":\n";
|
||||||
@ -116,7 +117,7 @@ void DumpSymbolNamesFromModule (Module *M) {
|
|||||||
std::for_each (M->global_begin (), M->global_end (), DumpSymbolNameForGlobalValue);
|
std::for_each (M->global_begin (), M->global_end (), DumpSymbolNameForGlobalValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DumpSymbolNamesFromFile (std::string &Filename) {
|
static void DumpSymbolNamesFromFile(std::string &Filename) {
|
||||||
std::string ErrorMessage;
|
std::string ErrorMessage;
|
||||||
sys::Path aPath(Filename);
|
sys::Path aPath(Filename);
|
||||||
if (Filename != "-") {
|
if (Filename != "-") {
|
||||||
@ -135,16 +136,16 @@ void DumpSymbolNamesFromFile (std::string &Filename) {
|
|||||||
}
|
}
|
||||||
} else if (aPath.isArchive()) {
|
} else if (aPath.isArchive()) {
|
||||||
std::string ErrMsg;
|
std::string ErrMsg;
|
||||||
Archive* archive = Archive::OpenAndLoad(sys::Path(Filename),&ErrorMessage);
|
Archive* archive = Archive::OpenAndLoad(sys::Path(Filename), &ErrorMessage);
|
||||||
if (!archive)
|
if (!archive)
|
||||||
std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
|
std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
|
||||||
std::vector<Module *> Modules;
|
std::vector<Module *> Modules;
|
||||||
if (archive->getAllModules(Modules,&ErrorMessage)) {
|
if (archive->getAllModules(Modules, &ErrorMessage)) {
|
||||||
std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
|
std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MultipleFiles = true;
|
MultipleFiles = true;
|
||||||
std::for_each (Modules.begin (), Modules.end (), DumpSymbolNamesFromModule);
|
std::for_each (Modules.begin(), Modules.end(), DumpSymbolNamesFromModule);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << ToolName << ": " << Filename << ": "
|
std::cerr << ToolName << ": " << Filename << ": "
|
||||||
<< "unrecognizable file type\n";
|
<< "unrecognizable file type\n";
|
||||||
@ -153,6 +154,7 @@ void DumpSymbolNamesFromFile (std::string &Filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm symbol table dumper\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm symbol table dumper\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "llvm/Analysis/ProfileInfoLoader.h"
|
#include "llvm/Analysis/ProfileInfoLoader.h"
|
||||||
#include "llvm/Bytecode/Reader.h"
|
#include "llvm/Bytecode/Reader.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@ -107,6 +108,7 @@ namespace {
|
|||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm profile dump decoder\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm profile dump decoder\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Bytecode/Archive.h"
|
#include "llvm/Bytecode/Archive.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@ -41,6 +42,7 @@ void printSymbolTable(Archive* TheArchive) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
|
|
||||||
// Have the command line options parsed and handle things
|
// Have the command line options parsed and handle things
|
||||||
// like --help and --version.
|
// like --help and --version.
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "ParserInternals.h"
|
#include "ParserInternals.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
@ -44,6 +45,7 @@ Debug("debug", cl::desc("Print debug output from yacc parser"),cl::Hidden,
|
|||||||
cl::init(false));
|
cl::init(false));
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
|
||||||
|
@ -20,11 +20,12 @@
|
|||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/Support/CFG.h"
|
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/MathExtras.h"
|
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/CFG.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "llvm/Bytecode/Reader.h"
|
#include "llvm/Bytecode/Reader.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include "CppWriter.h"
|
#include "CppWriter.h"
|
||||||
@ -41,6 +42,7 @@ static cl::opt<bool>
|
|||||||
Force("f", cl::desc("Overwrite output files"));
|
Force("f", cl::desc("Overwrite output files"));
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .cpp assembler\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .cpp assembler\n");
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
|
||||||
|
@ -17,17 +17,16 @@
|
|||||||
#include "CompilerDriver.h"
|
#include "CompilerDriver.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/System/Signals.h"
|
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
|
#include "llvm/System/Signals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//=== PHASE OPTIONS
|
//=== PHASE OPTIONS
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
cl::opt<CompilerDriver::Phases> FinalPhase(cl::Optional,
|
static cl::opt<CompilerDriver::Phases> FinalPhase(cl::Optional,
|
||||||
cl::desc("Choose final phase of compilation:"),
|
cl::desc("Choose final phase of compilation:"),
|
||||||
cl::init(CompilerDriver::LINKING),
|
cl::init(CompilerDriver::LINKING),
|
||||||
cl::values(
|
cl::values(
|
||||||
@ -46,7 +45,7 @@ cl::opt<CompilerDriver::Phases> FinalPhase(cl::Optional,
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//=== OPTIMIZATION OPTIONS
|
//=== OPTIMIZATION OPTIONS
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
cl::opt<CompilerDriver::OptimizationLevels> OptLevel(cl::ZeroOrMore,
|
static cl::opt<CompilerDriver::OptimizationLevels> OptLevel(cl::ZeroOrMore,
|
||||||
cl::desc("Choose level of optimization to apply:"),
|
cl::desc("Choose level of optimization to apply:"),
|
||||||
cl::init(CompilerDriver::OPT_FAST_COMPILE),
|
cl::init(CompilerDriver::OPT_FAST_COMPILE),
|
||||||
cl::values(
|
cl::values(
|
||||||
@ -70,48 +69,48 @@ cl::opt<CompilerDriver::OptimizationLevels> OptLevel(cl::ZeroOrMore,
|
|||||||
//=== TOOL OPTIONS
|
//=== TOOL OPTIONS
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
cl::list<std::string> PreprocessorToolOpts("Tpre", cl::ZeroOrMore,
|
static cl::list<std::string> PreprocessorToolOpts("Tpre", cl::ZeroOrMore,
|
||||||
cl::desc("Pass specific options to the pre-processor"),
|
cl::desc("Pass specific options to the pre-processor"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::alias PreprocessorToolOptsAlias("Wp,", cl::ZeroOrMore,
|
static cl::alias PreprocessorToolOptsAlias("Wp,", cl::ZeroOrMore,
|
||||||
cl::desc("Alias for -Tpre"), cl::aliasopt(PreprocessorToolOpts));
|
cl::desc("Alias for -Tpre"), cl::aliasopt(PreprocessorToolOpts));
|
||||||
|
|
||||||
cl::list<std::string> TranslatorToolOpts("Ttrn", cl::ZeroOrMore,
|
static cl::list<std::string> TranslatorToolOpts("Ttrn", cl::ZeroOrMore,
|
||||||
cl::desc("Pass specific options to the assembler"),
|
cl::desc("Pass specific options to the assembler"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::list<std::string> AssemblerToolOpts("Tasm", cl::ZeroOrMore,
|
static cl::list<std::string> AssemblerToolOpts("Tasm", cl::ZeroOrMore,
|
||||||
cl::desc("Pass specific options to the assembler"),
|
cl::desc("Pass specific options to the assembler"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::alias AssemblerToolOptsAlias("Wa,", cl::ZeroOrMore,
|
static cl::alias AssemblerToolOptsAlias("Wa,", cl::ZeroOrMore,
|
||||||
cl::desc("Alias for -Tasm"), cl::aliasopt(AssemblerToolOpts));
|
cl::desc("Alias for -Tasm"), cl::aliasopt(AssemblerToolOpts));
|
||||||
|
|
||||||
cl::list<std::string> OptimizerToolOpts("Topt", cl::ZeroOrMore,
|
static cl::list<std::string> OptimizerToolOpts("Topt", cl::ZeroOrMore,
|
||||||
cl::desc("Pass specific options to the optimizer"),
|
cl::desc("Pass specific options to the optimizer"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::list<std::string> LinkerToolOpts("Tlnk", cl::ZeroOrMore,
|
static cl::list<std::string> LinkerToolOpts("Tlnk", cl::ZeroOrMore,
|
||||||
cl::desc("Pass specific options to the linker"),
|
cl::desc("Pass specific options to the linker"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::alias LinkerToolOptsAlias("Wl,", cl::ZeroOrMore,
|
static cl::alias LinkerToolOptsAlias("Wl,", cl::ZeroOrMore,
|
||||||
cl::desc("Alias for -Tlnk"), cl::aliasopt(LinkerToolOpts));
|
cl::desc("Alias for -Tlnk"), cl::aliasopt(LinkerToolOpts));
|
||||||
|
|
||||||
cl::list<std::string> fOpts("f", cl::ZeroOrMore, cl::Prefix,
|
static cl::list<std::string> fOpts("f", cl::ZeroOrMore, cl::Prefix,
|
||||||
cl::desc("Pass through -f options to compiler tools"),
|
cl::desc("Pass through -f options to compiler tools"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::list<std::string> MOpts("M", cl::ZeroOrMore, cl::Prefix,
|
static cl::list<std::string> MOpts("M", cl::ZeroOrMore, cl::Prefix,
|
||||||
cl::desc("Pass through -M options to compiler tools"),
|
cl::desc("Pass through -M options to compiler tools"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::list<std::string> WOpts("W", cl::ZeroOrMore, cl::Prefix,
|
static cl::list<std::string> WOpts("W", cl::ZeroOrMore, cl::Prefix,
|
||||||
cl::desc("Pass through -W options to compiler tools"),
|
cl::desc("Pass through -W options to compiler tools"),
|
||||||
cl::value_desc("option"));
|
cl::value_desc("option"));
|
||||||
|
|
||||||
cl::list<std::string> BOpt("B", cl::ZeroOrMore, cl::Prefix,
|
static cl::list<std::string> BOpt("B", cl::ZeroOrMore, cl::Prefix,
|
||||||
cl::desc("Specify path to find llvmc sub-tools"),
|
cl::desc("Specify path to find llvmc sub-tools"),
|
||||||
cl::value_desc("dir"));
|
cl::value_desc("dir"));
|
||||||
|
|
||||||
@ -119,17 +118,17 @@ cl::list<std::string> BOpt("B", cl::ZeroOrMore, cl::Prefix,
|
|||||||
//=== INPUT OPTIONS
|
//=== INPUT OPTIONS
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
cl::list<std::string> LibPaths("L", cl::Prefix,
|
static cl::list<std::string> LibPaths("L", cl::Prefix,
|
||||||
cl::desc("Specify a library search path"), cl::value_desc("dir"));
|
cl::desc("Specify a library search path"), cl::value_desc("dir"));
|
||||||
|
|
||||||
cl::list<std::string> Libraries("l", cl::Prefix,
|
static cl::list<std::string> Libraries("l", cl::Prefix,
|
||||||
cl::desc("Specify base name of libraries to link to"), cl::value_desc("lib"));
|
cl::desc("Specify base name of libraries to link to"), cl::value_desc("lib"));
|
||||||
|
|
||||||
cl::list<std::string> Includes("I", cl::Prefix,
|
static cl::list<std::string> Includes("I", cl::Prefix,
|
||||||
cl::desc("Specify location to search for included source"),
|
cl::desc("Specify location to search for included source"),
|
||||||
cl::value_desc("dir"));
|
cl::value_desc("dir"));
|
||||||
|
|
||||||
cl::list<std::string> Defines("D", cl::Prefix,
|
static cl::list<std::string> Defines("D", cl::Prefix,
|
||||||
cl::desc("Specify a pre-processor symbol to define"),
|
cl::desc("Specify a pre-processor symbol to define"),
|
||||||
cl::value_desc("symbol"));
|
cl::value_desc("symbol"));
|
||||||
|
|
||||||
@ -137,22 +136,22 @@ cl::list<std::string> Defines("D", cl::Prefix,
|
|||||||
//=== OUTPUT OPTIONS
|
//=== OUTPUT OPTIONS
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
cl::opt<std::string> OutputFilename("o",
|
static cl::opt<std::string> OutputFilename("o",
|
||||||
cl::desc("Override output filename"), cl::value_desc("file"));
|
cl::desc("Override output filename"), cl::value_desc("file"));
|
||||||
|
|
||||||
cl::opt<std::string> OutputMachine("m", cl::Prefix,
|
static cl::opt<std::string> OutputMachine("m", cl::Prefix,
|
||||||
cl::desc("Specify a target machine"), cl::value_desc("machine"));
|
cl::desc("Specify a target machine"), cl::value_desc("machine"));
|
||||||
|
|
||||||
cl::opt<bool> Native("native", cl::init(false),
|
static cl::opt<bool> Native("native", cl::init(false),
|
||||||
cl::desc("Generative native code instead of bytecode"));
|
cl::desc("Generative native code instead of bytecode"));
|
||||||
|
|
||||||
cl::opt<bool> DebugOutput("g", cl::init(false),
|
static cl::opt<bool> DebugOutput("g", cl::init(false),
|
||||||
cl::desc("Generate objects that include debug symbols"));
|
cl::desc("Generate objects that include debug symbols"));
|
||||||
|
|
||||||
cl::opt<bool> StripOutput("strip", cl::init(false),
|
static cl::opt<bool> StripOutput("strip", cl::init(false),
|
||||||
cl::desc("Strip all symbols from linked output file"));
|
cl::desc("Strip all symbols from linked output file"));
|
||||||
|
|
||||||
cl::opt<std::string> PrintFileName("print-fname", cl::Optional,
|
static cl::opt<std::string> PrintFileName("print-fname", cl::Optional,
|
||||||
cl::value_desc("file"),
|
cl::value_desc("file"),
|
||||||
cl::desc("Print the full path for the option's value"));
|
cl::desc("Print the full path for the option's value"));
|
||||||
|
|
||||||
@ -160,28 +159,28 @@ cl::opt<std::string> PrintFileName("print-fname", cl::Optional,
|
|||||||
//=== INFORMATION OPTIONS
|
//=== INFORMATION OPTIONS
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
cl::opt<bool> DryRun("dry-run", cl::Optional, cl::init(false),
|
static cl::opt<bool> DryRun("dry-run", cl::Optional, cl::init(false),
|
||||||
cl::desc("Do everything but perform the compilation actions"));
|
cl::desc("Do everything but perform the compilation actions"));
|
||||||
|
|
||||||
cl::alias DryRunAlias("y", cl::Optional,
|
static cl::alias DryRunAlias("y", cl::Optional,
|
||||||
cl::desc("Alias for -dry-run"), cl::aliasopt(DryRun));
|
cl::desc("Alias for -dry-run"), cl::aliasopt(DryRun));
|
||||||
|
|
||||||
cl::opt<bool> Verbose("verbose", cl::Optional, cl::init(false),
|
static cl::opt<bool> Verbose("verbose", cl::Optional, cl::init(false),
|
||||||
cl::desc("Print out each action taken"));
|
cl::desc("Print out each action taken"));
|
||||||
|
|
||||||
cl::alias VerboseAlias("v", cl::Optional,
|
static cl::alias VerboseAlias("v", cl::Optional,
|
||||||
cl::desc("Alias for -verbose"), cl::aliasopt(Verbose));
|
cl::desc("Alias for -verbose"), cl::aliasopt(Verbose));
|
||||||
|
|
||||||
cl::opt<bool> Debug("debug", cl::Optional, cl::init(false),
|
static cl::opt<bool> Debug("debug", cl::Optional, cl::init(false),
|
||||||
cl::Hidden, cl::desc("Print out debugging information"));
|
cl::Hidden, cl::desc("Print out debugging information"));
|
||||||
|
|
||||||
cl::alias DebugAlias("d", cl::Optional,
|
static cl::alias DebugAlias("d", cl::Optional,
|
||||||
cl::desc("Alias for -debug"), cl::aliasopt(Debug));
|
cl::desc("Alias for -debug"), cl::aliasopt(Debug));
|
||||||
|
|
||||||
cl::opt<bool> TimeActions("time-actions", cl::Optional, cl::init(false),
|
static cl::opt<bool> TimeActions("time-actions", cl::Optional, cl::init(false),
|
||||||
cl::desc("Print execution time for each action taken"));
|
cl::desc("Print execution time for each action taken"));
|
||||||
|
|
||||||
cl::opt<bool> ShowStats("stats", cl::Optional, cl::init(false),
|
static cl::opt<bool> ShowStats("stats", cl::Optional, cl::init(false),
|
||||||
cl::desc("Print statistics accumulated during optimization"));
|
cl::desc("Print statistics accumulated during optimization"));
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
@ -215,7 +214,7 @@ static cl::list<std::string> Languages("x", cl::ZeroOrMore,
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//=== GetFileType - determine type of a file
|
//=== GetFileType - determine type of a file
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
const std::string GetFileType(const std::string& fname, unsigned pos) {
|
static const std::string GetFileType(const std::string& fname, unsigned pos) {
|
||||||
static std::vector<std::string>::iterator langIt = Languages.begin();
|
static std::vector<std::string>::iterator langIt = Languages.begin();
|
||||||
static std::string CurrLang = "";
|
static std::string CurrLang = "";
|
||||||
|
|
||||||
@ -236,9 +235,7 @@ const std::string GetFileType(const std::string& fname, unsigned pos) {
|
|||||||
return fname.substr(fname.rfind('.', fname.size()) + 1);
|
return fname.substr(fname.rfind('.', fname.size()) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end anonymous namespace
|
static void handleTerminatingOptions(CompilerDriver* CD) {
|
||||||
|
|
||||||
void handleTerminatingOptions(CompilerDriver* CD) {
|
|
||||||
if (!PrintFileName.empty()) {
|
if (!PrintFileName.empty()) {
|
||||||
sys::Path path = CD->GetPathForLinkageItem(PrintFileName, false);
|
sys::Path path = CD->GetPathForLinkageItem(PrintFileName, false);
|
||||||
std::string p = path.toString();
|
std::string p = path.toString();
|
||||||
@ -252,6 +249,7 @@ void handleTerminatingOptions(CompilerDriver* CD) {
|
|||||||
|
|
||||||
/// @brief The main program for llvmc
|
/// @brief The main program for llvmc
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
// Make sure we print stack trace if we get bad signals
|
// Make sure we print stack trace if we get bad signals
|
||||||
sys::PrintStackTraceOnErrorSignal();
|
sys::PrintStackTraceOnErrorSignal();
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Support/PassNameParser.h"
|
#include "llvm/Support/PassNameParser.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/PluginLoader.h"
|
#include "llvm/Support/PluginLoader.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
@ -156,6 +157,7 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
|
|||||||
// main for opt
|
// main for opt
|
||||||
//
|
//
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
try {
|
try {
|
||||||
cl::ParseCommandLineOptions(argc, argv,
|
cl::ParseCommandLineOptions(argc, argv,
|
||||||
" llvm .bc -> .bc modular optimizer and analysis printer \n");
|
" llvm .bc -> .bc modular optimizer and analysis printer \n");
|
||||||
|
Loading…
Reference in New Issue
Block a user