[cfe-commits] r67120 - in /cfe/trunk: include/clang/Driver/Tool.h lib/Driver/Tool.cpp lib/Driver/ToolChains.h lib/Driver/Tools.h
Daniel Dunbar
daniel at zuster.org
Tue Mar 17 15:45:24 PDT 2009
Author: ddunbar
Date: Tue Mar 17 17:45:24 2009
New Revision: 67120
URL: http://llvm.org/viewvc/llvm-project?rev=67120&view=rev
Log:
Driver: Add name to Tool (for testing/debugging) and move GCC_* tools
into gcc:: namespace.
Modified:
cfe/trunk/include/clang/Driver/Tool.h
cfe/trunk/lib/Driver/Tool.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/lib/Driver/Tools.h
Modified: cfe/trunk/include/clang/Driver/Tool.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Tool.h?rev=67120&r1=67119&r2=67120&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Tool.h (original)
+++ cfe/trunk/include/clang/Driver/Tool.h Tue Mar 17 17:45:24 2009
@@ -16,14 +16,20 @@
/// Tool - Information on a specific compilation tool.
class Tool {
+ /// The tool name (for debugging).
+ const char *Name;
+
+ /// The tool chain this tool is a part of.
const ToolChain &TheToolChain;
public:
- Tool(const ToolChain &TC);
+ Tool(const char *Name, const ToolChain &TC);
public:
virtual ~Tool();
+ const char *getName() const { return Name; }
+
const ToolChain &getToolChain() const { return TheToolChain; }
virtual bool acceptsPipedInput() const = 0;
Modified: cfe/trunk/lib/Driver/Tool.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tool.cpp?rev=67120&r1=67119&r2=67120&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tool.cpp (original)
+++ cfe/trunk/lib/Driver/Tool.cpp Tue Mar 17 17:45:24 2009
@@ -11,7 +11,8 @@
using namespace clang::driver;
-Tool::Tool(const ToolChain &TC) : TheToolChain(TC) {
+Tool::Tool(const char *_Name, const ToolChain &TC) : Name(_Name),
+ TheToolChain(TC) {
}
Tool::~Tool() {
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=67120&r1=67119&r2=67120&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Tue Mar 17 17:45:24 2009
@@ -47,17 +47,17 @@
default:
assert(0 && "Invalid tool kind.");
case Action::PreprocessJobClass:
- T = new tools::GCC_Preprocess(*this); break;
+ T = new tools::gcc::Preprocess(*this); break;
case Action::PrecompileJobClass:
- T = new tools::GCC_Precompile(*this); break;
+ T = new tools::gcc::Precompile(*this); break;
case Action::AnalyzeJobClass:
T = new tools::Clang(*this); break;
case Action::CompileJobClass:
- T = new tools::GCC_Compile(*this); break;
+ T = new tools::gcc::Compile(*this); break;
case Action::AssembleJobClass:
- T = new tools::GCC_Assemble(*this); break;
+ T = new tools::gcc::Assemble(*this); break;
case Action::LinkJobClass:
- T = new tools::GCC_Assemble(*this); break;
+ T = new tools::gcc::Link(*this); break;
}
}
Modified: cfe/trunk/lib/Driver/Tools.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=67120&r1=67119&r2=67120&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.h (original)
+++ cfe/trunk/lib/Driver/Tools.h Tue Mar 17 17:45:24 2009
@@ -20,57 +20,60 @@
class VISIBILITY_HIDDEN Clang : public Tool {
public:
- Clang(const ToolChain &TC) : Tool(TC) {}
+ Clang(const ToolChain &TC) : Tool("clang", TC) {}
virtual bool acceptsPipedInput() const { return true; }
virtual bool canPipeOutput() const { return true; }
virtual bool hasIntegratedCPP() const { return true; }
};
- class VISIBILITY_HIDDEN GCC_Preprocess : public Tool {
+ /// gcc - Generic GCC tool implementations.
+namespace gcc {
+ class VISIBILITY_HIDDEN Preprocess : public Tool {
public:
- GCC_Preprocess(const ToolChain &TC) : Tool(TC) {}
+ Preprocess(const ToolChain &TC) : Tool("gcc::Preprocess", TC) {}
virtual bool acceptsPipedInput() const { return true; }
virtual bool canPipeOutput() const { return true; }
virtual bool hasIntegratedCPP() const { return false; }
};
- class VISIBILITY_HIDDEN GCC_Precompile : public Tool {
+ class VISIBILITY_HIDDEN Precompile : public Tool {
public:
- GCC_Precompile(const ToolChain &TC) : Tool(TC) {}
+ Precompile(const ToolChain &TC) : Tool("gcc::Precompile", TC) {}
virtual bool acceptsPipedInput() const { return true; }
virtual bool canPipeOutput() const { return false; }
virtual bool hasIntegratedCPP() const { return true; }
};
- class VISIBILITY_HIDDEN GCC_Compile : public Tool {
+ class VISIBILITY_HIDDEN Compile : public Tool {
public:
- GCC_Compile(const ToolChain &TC) : Tool(TC) {}
+ Compile(const ToolChain &TC) : Tool("gcc::Compile", TC) {}
virtual bool acceptsPipedInput() const { return true; }
virtual bool canPipeOutput() const { return true; }
virtual bool hasIntegratedCPP() const { return true; }
};
- class VISIBILITY_HIDDEN GCC_Assemble : public Tool {
+ class VISIBILITY_HIDDEN Assemble : public Tool {
public:
- GCC_Assemble(const ToolChain &TC) : Tool(TC) {}
+ Assemble(const ToolChain &TC) : Tool("gcc::Assemble", TC) {}
virtual bool acceptsPipedInput() const { return true; }
virtual bool canPipeOutput() const { return false; }
virtual bool hasIntegratedCPP() const { return false; }
};
- class VISIBILITY_HIDDEN GCC_Link : public Tool {
+ class VISIBILITY_HIDDEN Link : public Tool {
public:
- GCC_Link(const ToolChain &TC) : Tool(TC) {}
+ Link(const ToolChain &TC) : Tool("gcc::Link", TC) {}
virtual bool acceptsPipedInput() const { return false; }
virtual bool canPipeOutput() const { return false; }
virtual bool hasIntegratedCPP() const { return false; }
};
+} // end namespace gcc
} // end namespace toolchains
} // end namespace driver
More information about the cfe-commits
mailing list