summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Compilation.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-25 04:13:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-25 04:13:45 +0000
commitdac54a81df89223b6887408d9427501603d8648d (patch)
tree9bc9a6b8b42475cc1d67aa5cb9ccd4d6587abb45 /clang/lib/Driver/Compilation.cpp
parent68b0881d94f3b46d173038865b9fc02eb9b5f5d7 (diff)
downloadbcm5719-llvm-dac54a81df89223b6887408d9427501603d8648d.tar.gz
bcm5719-llvm-dac54a81df89223b6887408d9427501603d8648d.zip
Driver: Prep for tool chain specific argument translation.
- Lift ArgList to a base class for InputArgList and DerivedArgList. - This is not a great decomposition, but it does embed the translation into the type system, and keep things efficient for tool chains that don't want to do any translation. - No intended functionality change. Eventually I hope to get rid of tool chain specific translation and have each tool do the right thing, but for now this is the easiest way to match gcc precisely (which is good for testing). llvm-svn: 67676
Diffstat (limited to 'clang/lib/Driver/Compilation.cpp')
-rw-r--r--clang/lib/Driver/Compilation.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp
index 2165bb74018..1e044c6b8fd 100644
--- a/clang/lib/Driver/Compilation.cpp
+++ b/clang/lib/Driver/Compilation.cpp
@@ -23,7 +23,7 @@ using namespace clang::driver;
Compilation::Compilation(Driver &D,
ToolChain &_DefaultToolChain,
- ArgList *_Args)
+ InputArgList *_Args)
: TheDriver(D), DefaultToolChain(_DefaultToolChain), Args(_Args) {
}
@@ -31,12 +31,9 @@ Compilation::~Compilation() {
delete Args;
// Free any derived arg lists.
- for (llvm::DenseMap<const ToolChain*, ArgList*>::iterator
- it = TCArgs.begin(), ie = TCArgs.end(); it != ie; ++it) {
- ArgList *A = it->second;
- if (A != Args)
- delete Args;
- }
+ for (llvm::DenseMap<const ToolChain*, DerivedArgList*>::iterator
+ it = TCArgs.begin(), ie = TCArgs.end(); it != ie; ++it)
+ delete it->second;
// Free the actions, if built.
for (ActionList::iterator it = Actions.begin(), ie = Actions.end();
@@ -44,11 +41,11 @@ Compilation::~Compilation() {
delete *it;
}
-const ArgList &Compilation::getArgsForToolChain(const ToolChain *TC) {
+const DerivedArgList &Compilation::getArgsForToolChain(const ToolChain *TC) {
if (!TC)
TC = &DefaultToolChain;
- ArgList *&Entry = TCArgs[TC];
+ DerivedArgList *&Entry = TCArgs[TC];
if (!Entry)
Entry = TC->TranslateArgs(*Args);
OpenPOWER on IntegriCloud