diff options
Diffstat (limited to 'lib/CompilerDriver')
-rw-r--r-- | lib/CompilerDriver/Action.cpp | 5 | ||||
-rw-r--r-- | lib/CompilerDriver/CompilationGraph.cpp | 8 | ||||
-rw-r--r-- | lib/CompilerDriver/Plugin.cpp | 8 | ||||
-rw-r--r-- | lib/CompilerDriver/Tool.cpp | 8 |
4 files changed, 14 insertions, 15 deletions
diff --git a/lib/CompilerDriver/Action.cpp b/lib/CompilerDriver/Action.cpp index c0a1b84..816f793 100644 --- a/lib/CompilerDriver/Action.cpp +++ b/lib/CompilerDriver/Action.cpp @@ -12,8 +12,8 @@ //===----------------------------------------------------------------------===// #include "llvm/CompilerDriver/Action.h" +#include "llvm/CompilerDriver/BuiltinOptions.h" -#include "llvm/Support/CommandLine.h" #include "llvm/System/Program.h" #include <iostream> @@ -22,9 +22,6 @@ using namespace llvm; using namespace llvmc; -extern cl::opt<bool> DryRun; -extern cl::opt<bool> VerboseMode; - namespace { int ExecuteProgram(const std::string& name, const StrVector& args) { diff --git a/lib/CompilerDriver/CompilationGraph.cpp b/lib/CompilerDriver/CompilationGraph.cpp index dece4e8..1212a21 100644 --- a/lib/CompilerDriver/CompilationGraph.cpp +++ b/lib/CompilerDriver/CompilationGraph.cpp @@ -11,11 +11,11 @@ // //===----------------------------------------------------------------------===// +#include "llvm/CompilerDriver/BuiltinOptions.h" #include "llvm/CompilerDriver/CompilationGraph.h" #include "llvm/CompilerDriver/Error.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Support/DOTGraphTraits.h" #include "llvm/Support/GraphWriter.h" @@ -30,9 +30,6 @@ using namespace llvm; using namespace llvmc; -extern cl::list<std::string> InputFilenames; -extern cl::list<std::string> Languages; - namespace llvmc { const std::string& LanguageMap::GetLanguage(const sys::Path& File) const { @@ -477,7 +474,8 @@ namespace llvm { { template<typename GraphType> - static std::string getNodeLabel(const Node* N, const GraphType&) + static std::string getNodeLabel(const Node* N, const GraphType&, + bool ShortNames) { if (N->ToolPtr) if (N->ToolPtr->IsJoin()) diff --git a/lib/CompilerDriver/Plugin.cpp b/lib/CompilerDriver/Plugin.cpp index 75abbd0..cb3c7be 100644 --- a/lib/CompilerDriver/Plugin.cpp +++ b/lib/CompilerDriver/Plugin.cpp @@ -12,7 +12,8 @@ //===----------------------------------------------------------------------===// #include "llvm/CompilerDriver/Plugin.h" - +#include "llvm/Support/ManagedStatic.h" +#include "llvm/System/Mutex.h" #include <algorithm> #include <vector> @@ -28,6 +29,7 @@ namespace { static bool pluginListInitialized = false; typedef std::vector<const llvmc::BasePlugin*> PluginList; static PluginList Plugins; + static llvm::ManagedStatic<llvm::sys::SmartMutex<true> > PluginMutex; struct ByPriority { bool operator()(const llvmc::BasePlugin* lhs, @@ -40,6 +42,7 @@ namespace { namespace llvmc { PluginLoader::PluginLoader() { + llvm::sys::SmartScopedLock<true> Lock(&*PluginMutex); if (!pluginListInitialized) { for (PluginRegistry::iterator B = PluginRegistry::begin(), E = PluginRegistry::end(); B != E; ++B) @@ -50,6 +53,7 @@ namespace llvmc { } PluginLoader::~PluginLoader() { + llvm::sys::SmartScopedLock<true> Lock(&*PluginMutex); if (pluginListInitialized) { for (PluginList::iterator B = Plugins.begin(), E = Plugins.end(); B != E; ++B) @@ -59,12 +63,14 @@ namespace llvmc { } void PluginLoader::PopulateLanguageMap(LanguageMap& langMap) { + llvm::sys::SmartScopedLock<true> Lock(&*PluginMutex); for (PluginList::iterator B = Plugins.begin(), E = Plugins.end(); B != E; ++B) (*B)->PopulateLanguageMap(langMap); } void PluginLoader::PopulateCompilationGraph(CompilationGraph& graph) { + llvm::sys::SmartScopedLock<true> Lock(&*PluginMutex); for (PluginList::iterator B = Plugins.begin(), E = Plugins.end(); B != E; ++B) (*B)->PopulateCompilationGraph(graph); diff --git a/lib/CompilerDriver/Tool.cpp b/lib/CompilerDriver/Tool.cpp index 886b26b..e704dd9 100644 --- a/lib/CompilerDriver/Tool.cpp +++ b/lib/CompilerDriver/Tool.cpp @@ -11,16 +11,14 @@ // //===----------------------------------------------------------------------===// +#include "llvm/CompilerDriver/BuiltinOptions.h" #include "llvm/CompilerDriver/Tool.h" #include "llvm/System/Path.h" -#include "llvm/Support/CommandLine.h" using namespace llvm; using namespace llvmc; -extern cl::opt<std::string> OutputFilename; - namespace { sys::Path MakeTempFile(const sys::Path& TempDir, const std::string& BaseName, const std::string& Suffix) { @@ -39,7 +37,7 @@ namespace { // NOTE: makeUnique always *creates* a unique temporary file, // which is good, since there will be no races. However, some // tools do not like it when the output file already exists, so - // they have to be placated with -f or something like that. + // they need to be placated with -f or something like that. Out.makeUnique(true, NULL); return Out; } @@ -52,7 +50,7 @@ sys::Path Tool::OutFilename(const sys::Path& In, sys::Path Out; if (StopCompilation) { - if (!OutputFilename.empty()) { + if (!OutputFilename.empty() && SaveTemps != SaveTempsEnum::Obj ) { Out.set(OutputFilename); } else if (IsJoin()) { |