forked from OSchip/llvm-project
Slightly improve the code to derive target from program name to not
fault if no arguments are given. llvm-svn: 134618
This commit is contained in:
parent
e0cbf7409c
commit
39ec119132
|
@ -327,9 +327,11 @@ static void ParseProgName(llvm::SmallVectorImpl<const char *> &ArgVector,
|
|||
|
||||
std::string IgnoredError;
|
||||
if (llvm::TargetRegistry::lookupTarget(Prefix, IgnoredError)) {
|
||||
ArgVector.insert(&ArgVector[1],
|
||||
SaveStringInSet(SavedStrings, Prefix));
|
||||
ArgVector.insert(&ArgVector[1],
|
||||
llvm::SmallVectorImpl<const char *>::iterator it = ArgVector.begin();
|
||||
if (it != ArgVector.end())
|
||||
++it;
|
||||
ArgVector.insert(it, SaveStringInSet(SavedStrings, Prefix));
|
||||
ArgVector.insert(it,
|
||||
SaveStringInSet(SavedStrings, std::string("-ccc-host-triple")));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue