projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove dead code. Fixes pr20544.
[oota-llvm.git]
/
lib
/
Support
/
CommandLine.cpp
diff --git
a/lib/Support/CommandLine.cpp
b/lib/Support/CommandLine.cpp
index 87348f7342e528580467ac0063d990368cbb6573..4c1df5c47dd544f497be52c3f6cc57d898eca9f6 100644
(file)
--- a/
lib/Support/CommandLine.cpp
+++ b/
lib/Support/CommandLine.cpp
@@
-635,11
+635,11
@@
static bool ExpandResponseFile(const char *FName, StringSaver &Saver,
MemoryBuffer::getFile(FName);
if (!MemBufOrErr)
return false;
MemoryBuffer::getFile(FName);
if (!MemBufOrErr)
return false;
-
std::unique_ptr<MemoryBuffer> MemBuf = std::move(MemBufOrErr.get()
);
- StringRef Str(MemBuf
->getBufferStart(), MemBuf->
getBufferSize());
+
MemoryBuffer &MemBuf = *MemBufOrErr.get(
);
+ StringRef Str(MemBuf
.getBufferStart(), MemBuf.
getBufferSize());
// If we have a UTF-16 byte order mark, convert to UTF-8 for parsing.
// If we have a UTF-16 byte order mark, convert to UTF-8 for parsing.
- ArrayRef<char> BufRef(MemBuf
->getBufferStart(), MemBuf->
getBufferEnd());
+ ArrayRef<char> BufRef(MemBuf
.getBufferStart(), MemBuf.
getBufferEnd());
std::string UTF8Buf;
if (hasUTF16ByteOrderMark(BufRef)) {
if (!convertUTF16ToUTF8String(BufRef, UTF8Buf))
std::string UTF8Buf;
if (hasUTF16ByteOrderMark(BufRef)) {
if (!convertUTF16ToUTF8String(BufRef, UTF8Buf))
@@
-1018,13
+1018,12
@@
void cl::ParseCommandLineOptions(int argc, const char * const *argv,
}
// Loop over args and make sure all required args are specified!
}
// Loop over args and make sure all required args are specified!
- for (StringMap<Option*>::iterator I = Opts.begin(),
- E = Opts.end(); I != E; ++I) {
- switch (I->second->getNumOccurrencesFlag()) {
+ for (const auto &Opt : Opts) {
+ switch (Opt.second->getNumOccurrencesFlag()) {
case Required:
case OneOrMore:
case Required:
case OneOrMore:
- if (
I->
second->getNumOccurrences() == 0) {
-
I->
second->error("must be specified at least once!");
+ if (
Opt.
second->getNumOccurrences() == 0) {
+
Opt.
second->error("must be specified at least once!");
ErrorParsing = true;
}
// Fall through
ErrorParsing = true;
}
// Fall through