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 | b191f5a7ef6e1e5006bb5b15b25b1dd5199b499c (patch) | |
tree | 80830e1d1e01c9659ffb09a0a8fc877c6fd620b8 /tools/llvm-config-2 | |
parent | bd165eac9d4823eb043e965d9aec62a8fb9118a4 (diff) | |
download | llvm-b191f5a7ef6e1e5006bb5b15b25b1dd5199b499c.tar.gz llvm-b191f5a7ef6e1e5006bb5b15b25b1dd5199b499c.tar.bz2 llvm-b191f5a7ef6e1e5006bb5b15b25b1dd5199b499c.tar.xz |
llvm-config-2: Fix thinko in maintenance of visited component set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config-2')
-rw-r--r-- | tools/llvm-config-2/llvm-config.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/llvm-config-2/llvm-config.cpp b/tools/llvm-config-2/llvm-config.cpp index ec0daad035..30ace56f4c 100644 --- a/tools/llvm-config-2/llvm-config.cpp +++ b/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; |