summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
committerpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
commitb773203fb58f3ef282fb69c832d8710cab5bc82d (patch)
treee75913f147570fbd75169647b144df85b88a038c /gnu/llvm/tools/llvm-config/llvm-config.cpp
parenttweak errno in previous (diff)
downloadwireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz
wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r--gnu/llvm/tools/llvm-config/llvm-config.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/gnu/llvm/tools/llvm-config/llvm-config.cpp b/gnu/llvm/tools/llvm-config/llvm-config.cpp
index 08b096afb05..892adc3b9dd 100644
--- a/gnu/llvm/tools/llvm-config/llvm-config.cpp
+++ b/gnu/llvm/tools/llvm-config/llvm-config.cpp
@@ -17,15 +17,16 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Config/llvm-config.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/config.h"
-#include "llvm/Config/llvm-config.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
+#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdlib>
#include <set>
@@ -62,7 +63,7 @@ enum LinkMode {
LinkModeStatic = 2,
};
-/// \brief Traverse a single component adding to the topological ordering in
+/// Traverse a single component adding to the topological ordering in
/// \arg RequiredLibs.
///
/// \param Name - The component to traverse.
@@ -129,7 +130,7 @@ static void VisitComponent(const std::string &Name,
}
}
-/// \brief Compute the list of required libraries for a given list of
+/// Compute the list of required libraries for a given list of
/// components, in an order suitable for passing to a linker (that is, libraries
/// appear prior to their dependencies).
///
@@ -223,7 +224,7 @@ Typical components:\n\
exit(1);
}
-/// \brief Compute the path to the main executable.
+/// Compute the path to the main executable.
std::string GetExecutablePath(const char *Argv0) {
// This just needs to be some symbol in the binary; C++ doesn't
// allow taking the address of ::main however.
@@ -231,7 +232,7 @@ std::string GetExecutablePath(const char *Argv0) {
return llvm::sys::fs::getMainExecutable(Argv0, P);
}
-/// \brief Expand the semi-colon delimited LLVM_DYLIB_COMPONENTS into
+/// Expand the semi-colon delimited LLVM_DYLIB_COMPONENTS into
/// the full list of components.
std::vector<std::string> GetAllDyLibComponents(const bool IsInDevelopmentTree,
const bool GetComponentNames,
@@ -522,7 +523,7 @@ int main(int argc, char **argv) {
if (DyLibExists && !sys::fs::exists(path)) {
Components =
GetAllDyLibComponents(IsInDevelopmentTree, true, DirSep);
- std::sort(Components.begin(), Components.end());
+ llvm::sort(Components.begin(), Components.end());
break;
}
}
@@ -579,7 +580,7 @@ int main(int argc, char **argv) {
usage();
if (LinkMode == LinkModeShared && !DyLibExists && !BuiltSharedLibs) {
- errs() << "llvm-config: error: " << DyLibName << " is missing\n";
+ WithColor::error(errs(), "llvm-config") << DyLibName << " is missing\n";
return 1;
}
@@ -612,19 +613,19 @@ int main(int argc, char **argv) {
break;
// Using component shared libraries.
for (auto &Lib : MissingLibs)
- errs() << "llvm-config: error: missing: " << Lib << "\n";
+ WithColor::error(errs(), "llvm-config") << "missing: " << Lib << "\n";
return 1;
case LinkModeAuto:
if (DyLibExists) {
LinkMode = LinkModeShared;
break;
}
- errs()
- << "llvm-config: error: component libraries and shared library\n\n";
+ WithColor::error(errs(), "llvm-config")
+ << "component libraries and shared library\n\n";
LLVM_FALLTHROUGH;
case LinkModeStatic:
for (auto &Lib : MissingLibs)
- errs() << "llvm-config: error: missing: " << Lib << "\n";
+ WithColor::error(errs(), "llvm-config") << "missing: " << Lib << "\n";
return 1;
}
} else if (LinkMode == LinkModeAuto) {
@@ -707,7 +708,8 @@ int main(int argc, char **argv) {
OS << (LinkMode == LinkModeStatic ? LLVM_SYSTEM_LIBS : "") << '\n';
}
} else if (!Components.empty()) {
- errs() << "llvm-config: error: components given, but unused\n\n";
+ WithColor::error(errs(), "llvm-config")
+ << "components given, but unused\n\n";
usage();
}