summaryrefslogtreecommitdiff
path: root/lib/Option/ArgList.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-07-15 16:40:52 +0000
committerReid Kleckner <reid@kleckner.net>2013-07-15 16:40:52 +0000
commitf73f80975639a7413bee66391556f7ea51f83423 (patch)
treeb5bee42dfd6f23ac453ca72c18e911876863ca44 /lib/Option/ArgList.cpp
parent0bf3c99886bed6796eada8f65942ee6023fc6e89 (diff)
downloadllvm-f73f80975639a7413bee66391556f7ea51f83423.tar.gz
llvm-f73f80975639a7413bee66391556f7ea51f83423.tar.bz2
llvm-f73f80975639a7413bee66391556f7ea51f83423.tar.xz
Revert "[Option] Store arg strings in a set backed by a BumpPtrAllocator"
This broke clang's crash-report.c test, and I haven't been able to figure it out yet. This reverts commit r186319. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Option/ArgList.cpp')
-rw-r--r--lib/Option/ArgList.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/Option/ArgList.cpp b/lib/Option/ArgList.cpp
index 18a7b5982b..15f7e8bf4b 100644
--- a/lib/Option/ArgList.cpp
+++ b/lib/Option/ArgList.cpp
@@ -323,18 +323,9 @@ InputArgList::~InputArgList() {
unsigned InputArgList::MakeIndex(StringRef String0) const {
unsigned Index = ArgStrings.size();
- // If necessary, make a copy so we can null terminate it.
- std::string NullTerminated;
- if (String0.back() != '\0') {
- NullTerminated.append(String0.data(), String0.size());
- NullTerminated.push_back('\0');
- String0 = StringRef(&NullTerminated[0], NullTerminated.size());
- }
-
// Tuck away so we have a reliable const char *.
- String0 = SynthesizedStrings.GetOrCreateValue(String0).getKey();
- assert(String0.back() == '\0');
- ArgStrings.push_back(String0.data());
+ SynthesizedStrings.push_back(String0);
+ ArgStrings.push_back(SynthesizedStrings.back().c_str());
return Index;
}