[llvm-commits] [llvm] r143881 - /llvm/trunk/tools/llvm-config-2/llvm-config.cpp

Daniel Dunbar daniel at zuster.org
Sun Nov 6 10:04:50 PST 2011


Author: ddunbar
Date: Sun Nov  6 12:04:49 2011
New Revision: 143881

URL: http://llvm.org/viewvc/llvm-project?rev=143881&view=rev
Log:
llvm-config: Users are allowed to provide component names in mixed case.

Modified:
    llvm/trunk/tools/llvm-config-2/llvm-config.cpp

Modified: llvm/trunk/tools/llvm-config-2/llvm-config.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config-2/llvm-config.cpp?rev=143881&r1=143880&r2=143881&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config-2/llvm-config.cpp (original)
+++ llvm/trunk/tools/llvm-config-2/llvm-config.cpp Sun Nov  6 12:04:49 2011
@@ -97,14 +97,17 @@
 
   // 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);
   }
 





More information about the llvm-commits mailing list