aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ArgList.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2011-08-02 17:58:04 +0000
committerChad Rosier <mcrosier@apple.com>2011-08-02 17:58:04 +0000
commit2b81910618f63e4ce2373c926a26e76b4b91373f (patch)
tree48cef925cb1f3b951d23d5e7edea779d5505c6c1 /lib/Driver/ArgList.cpp
parentc24a1eef40207457692a1ad597cefdd0dc8fa149 (diff)
When the compiler crashes, the compiler driver now produces diagnostic
information including the fully preprocessed source file(s) and command line arguments. The developer is asked to attach this diagnostic information to a bug report. rdar://9575623 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ArgList.cpp')
-rw-r--r--lib/Driver/ArgList.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index 86da885a40..e5341884ee 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -46,6 +46,16 @@ void ArgList::append(Arg *A) {
Args.push_back(A);
}
+void ArgList::eraseArg(OptSpecifier Id) {
+ for (iterator it = begin(), ie = end(); it != ie; ++it) {
+ if ((*it)->getOption().matches(Id)) {
+ Args.erase(it);
+ it = begin();
+ ie = end();
+ }
+ }
+}
+
Arg *ArgList::getLastArgNoClaim(OptSpecifier Id) const {
// FIXME: Make search efficient?
for (const_reverse_iterator it = rbegin(), ie = rend(); it != ie; ++it)
@@ -192,6 +202,12 @@ void ArgList::ClaimAllArgs(OptSpecifier Id0) const {
(*it)->claim();
}
+void ArgList::ClaimAllArgs() const {
+ for (const_iterator it = begin(), ie = end(); it != ie; ++it)
+ if (!(*it)->isClaimed())
+ (*it)->claim();
+}
+
const char *ArgList::MakeArgString(const Twine &T) const {
llvm::SmallString<256> Str;
T.toVector(Str);