X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllvm-config%2Fllvm-config.cpp;h=80f627936d0cf1068245f0d1ad81ef4bfe469e4a;hb=3bca2f2bf524a858b83210a9b71c5b1e7e0020aa;hp=f6d55b42260ad26ecff1686b94124440cbafb28b;hpb=53b5ea7f56654f675eb197bece7af6c348fdf7d8;p=oota-llvm.git diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp index f6d55b42260..80f627936d0 100644 --- a/tools/llvm-config/llvm-config.cpp +++ b/tools/llvm-config/llvm-config.cpp @@ -56,10 +56,10 @@ using namespace llvm; /// libraries. /// \param GetComponentNames - Get the component names instead of the /// library name. -static void VisitComponent(StringRef Name, +static void VisitComponent(const std::string& Name, const StringMap &ComponentMap, std::set &VisitedComponents, - std::vector &RequiredLibs, + std::vector &RequiredLibs, bool IncludeNonInstalled, bool GetComponentNames, const std::string *ActiveLibDir, bool *HasMissing) { // Lookup the component. @@ -102,16 +102,14 @@ static void VisitComponent(StringRef Name, /// appear prior to their dependencies). /// /// \param Components - The names of the components to find libraries for. -/// \param RequiredLibs [out] - On return, the ordered list of libraries that -/// are required to link the given components. /// \param IncludeNonInstalled - Whether non-installed components should be /// reported. /// \param GetComponentNames - True if one would prefer the component names. -static std::vector +static std::vector ComputeLibsForComponents(const std::vector &Components, bool IncludeNonInstalled, bool GetComponentNames, const std::string *ActiveLibDir, bool *HasMissing) { - std::vector RequiredLibs; + std::vector RequiredLibs; std::set VisitedComponents; // Build a map of component names to information. @@ -197,8 +195,8 @@ std::string GetExecutablePath(const char *Argv0) { /// \brief Expand the semi-colon delimited LLVM_DYLIB_COMPONENTS into /// the full list of components. -std::vector GetAllDyLibComponents(const bool IsInDevelopmentTree, - const bool GetComponentNames) { +std::vector GetAllDyLibComponents(const bool IsInDevelopmentTree, + const bool GetComponentNames) { std::vector DyLibComponents; StringRef DyLibComponentsStr(LLVM_DYLIB_COMPONENTS); @@ -333,7 +331,7 @@ int main(int argc, char **argv) { StaticExt = "a"; SharedDir = ActiveBinDir; StaticDir = ActiveLibDir; - StaticPrefix = SharedPrefix = ""; + StaticPrefix = SharedPrefix = "lib"; } else if (HostTriple.isOSDarwin()) { SharedExt = "dylib"; SharedVersionedExt = PACKAGE_VERSION ".dylib"; @@ -455,7 +453,7 @@ int main(int argc, char **argv) { /// If there are missing static archives and a dylib was /// built, print LLVM_DYLIB_COMPONENTS instead of everything /// in the manifest. - std::vector Components; + std::vector Components; for (unsigned j = 0; j != array_lengthof(AvailableComponents); ++j) { // Only include non-installed components when in a development tree. if (!AvailableComponents[j].IsInstalled && !IsInDevelopmentTree) @@ -528,14 +526,14 @@ int main(int argc, char **argv) { // Construct the list of all the required libraries. bool HasMissing = false; - std::vector RequiredLibs = + std::vector RequiredLibs = ComputeLibsForComponents(Components, /*IncludeNonInstalled=*/IsInDevelopmentTree, false, &ActiveLibDir, &HasMissing); if (PrintSharedMode) { std::unordered_set FullDyLibComponents; - std::vector DyLibComponents = + std::vector DyLibComponents = GetAllDyLibComponents(IsInDevelopmentTree, false); for (auto &Component : DyLibComponents) { @@ -587,7 +585,7 @@ int main(int argc, char **argv) { PrintForLib(DyLibName, true); } else { for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) { - StringRef Lib = RequiredLibs[i]; + auto Lib = RequiredLibs[i]; if (i) OS << ' ';