diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Driver/Action.cpp | 6 | ||||
-rw-r--r-- | lib/Driver/Driver.cpp | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/Driver/Action.cpp b/lib/Driver/Action.cpp index 62434893f9..b9a3306d53 100644 --- a/lib/Driver/Action.cpp +++ b/lib/Driver/Action.cpp @@ -13,8 +13,10 @@ using namespace clang::driver; Action::~Action() { - // FIXME: Free the inputs. The problem is that BindArchAction shares - // inputs; so we can't just walk the inputs. + if (OwnsInputs) { + for (iterator it = begin(), ie = end(); it != ie; ++it) + delete *it; + } } const char *Action::getClassName(ActionClass AC) { diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 64168b4d83..3257ee55a7 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -503,8 +503,11 @@ void Driver::BuildUniversalActions(const ArgList &Args, << types::getTypeName(Act->getType()); ActionList Inputs; - for (unsigned i = 0, e = Archs.size(); i != e; ++i) + for (unsigned i = 0, e = Archs.size(); i != e; ++i) { Inputs.push_back(new BindArchAction(Act, Archs[i])); + if (i != 0) + Inputs.back()->setOwnsInputs(false); + } // Lipo if necessary, we do it this way because we need to set the arch flag // so that -Xarch_ gets overwritten. |