llvm-config: Users are allowed to provide component names in mixed case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143881 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2011-11-06 18:04:49 +00:00
parent 589fbb1770
commit 51dc528e30

View File

@ -97,14 +97,17 @@ void ComputeLibsForComponents(const std::vector<StringRef> &Components,
// Visit the components.
for (unsigned i = 0, e = Components.size(); i != e; ++i) {
// Users are allowed to provide mixed case component names.
std::string ComponentLower = Components[i].lower();
// Validate that the user supplied a valid component name.
if (!ComponentMap.count(Components[i])) {
if (!ComponentMap.count(ComponentLower)) {
llvm::errs() << "llvm-config: unknown component name: " << Components[i]
<< "\n";
exit(1);
}
VisitComponent(Components[i], ComponentMap, VisitedComponents,
VisitComponent(ComponentLower, ComponentMap, VisitedComponents,
RequiredLibs);
}