diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2011-11-10 14:53:23 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2011-11-10 14:53:23 +0000 |
| commit | fe999b4799a0e05a9721c1a20427875ada0a341f (patch) | |
| tree | 92b779a6fe7a9eb0c9576fe699fada73803a6638 /llvm | |
| parent | 270354100ae0cb75ddff650cbabcf639aa764f81 (diff) | |
| download | bcm5719-llvm-fe999b4799a0e05a9721c1a20427875ada0a341f.tar.gz bcm5719-llvm-fe999b4799a0e05a9721c1a20427875ada0a341f.zip | |
llvm-config-2: Fix thinko in maintenance of visited component set.
llvm-svn: 144291
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/tools/llvm-config-2/llvm-config.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/tools/llvm-config-2/llvm-config.cpp b/llvm/tools/llvm-config-2/llvm-config.cpp index ec0daad0356..30ace56f4ca 100644 --- a/llvm/tools/llvm-config-2/llvm-config.cpp +++ b/llvm/tools/llvm-config-2/llvm-config.cpp @@ -54,18 +54,19 @@ using namespace llvm; /// \param RequiredLibs [out] - The ordered list of required libraries. static void VisitComponent(StringRef Name, const StringMap<AvailableComponent*> &ComponentMap, - std::set<StringRef> &VisitedComponents, + std::set<AvailableComponent*> &VisitedComponents, std::vector<StringRef> &RequiredLibs) { + // Lookup the component. + AvailableComponent *AC = ComponentMap.lookup(Name); + assert(AC && "Invalid component name!"); + // Add to the visited table. - if (!VisitedComponents.insert(Name).second) { + if (!VisitedComponents.insert(AC).second) { // We are done if the component has already been visited. return; } // Otherwise, visit all the dependencies. - AvailableComponent *AC = ComponentMap.lookup(Name); - assert(AC && "Invalid component name!"); - for (unsigned i = 0; AC->RequiredLibraries[i]; ++i) { VisitComponent(AC->RequiredLibraries[i], ComponentMap, VisitedComponents, RequiredLibs); @@ -85,8 +86,7 @@ static void VisitComponent(StringRef Name, /// are required to link the given components. void ComputeLibsForComponents(const std::vector<StringRef> &Components, std::vector<StringRef> &RequiredLibs) { - std::set<StringRef> VisitedComponents; - std::vector<StringRef> ToVisit = Components; + std::set<AvailableComponent*> VisitedComponents; // Build a map of component names to information. StringMap<AvailableComponent*> ComponentMap; |

