mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 23:26:25 +00:00
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
This commit is contained in:
@@ -54,18 +54,19 @@ using namespace llvm;
|
|||||||
/// \param RequiredLibs [out] - The ordered list of required libraries.
|
/// \param RequiredLibs [out] - The ordered list of required libraries.
|
||||||
static void VisitComponent(StringRef Name,
|
static void VisitComponent(StringRef Name,
|
||||||
const StringMap<AvailableComponent*> &ComponentMap,
|
const StringMap<AvailableComponent*> &ComponentMap,
|
||||||
std::set<StringRef> &VisitedComponents,
|
std::set<AvailableComponent*> &VisitedComponents,
|
||||||
std::vector<StringRef> &RequiredLibs) {
|
std::vector<StringRef> &RequiredLibs) {
|
||||||
|
// Lookup the component.
|
||||||
|
AvailableComponent *AC = ComponentMap.lookup(Name);
|
||||||
|
assert(AC && "Invalid component name!");
|
||||||
|
|
||||||
// Add to the visited table.
|
// 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.
|
// We are done if the component has already been visited.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, visit all the dependencies.
|
// Otherwise, visit all the dependencies.
|
||||||
AvailableComponent *AC = ComponentMap.lookup(Name);
|
|
||||||
assert(AC && "Invalid component name!");
|
|
||||||
|
|
||||||
for (unsigned i = 0; AC->RequiredLibraries[i]; ++i) {
|
for (unsigned i = 0; AC->RequiredLibraries[i]; ++i) {
|
||||||
VisitComponent(AC->RequiredLibraries[i], ComponentMap, VisitedComponents,
|
VisitComponent(AC->RequiredLibraries[i], ComponentMap, VisitedComponents,
|
||||||
RequiredLibs);
|
RequiredLibs);
|
||||||
@@ -85,8 +86,7 @@ static void VisitComponent(StringRef Name,
|
|||||||
/// are required to link the given components.
|
/// are required to link the given components.
|
||||||
void ComputeLibsForComponents(const std::vector<StringRef> &Components,
|
void ComputeLibsForComponents(const std::vector<StringRef> &Components,
|
||||||
std::vector<StringRef> &RequiredLibs) {
|
std::vector<StringRef> &RequiredLibs) {
|
||||||
std::set<StringRef> VisitedComponents;
|
std::set<AvailableComponent*> VisitedComponents;
|
||||||
std::vector<StringRef> ToVisit = Components;
|
|
||||||
|
|
||||||
// Build a map of component names to information.
|
// Build a map of component names to information.
|
||||||
StringMap<AvailableComponent*> ComponentMap;
|
StringMap<AvailableComponent*> ComponentMap;
|
||||||
|
Reference in New Issue
Block a user