[AMDGPU] prevent shrinking udiv/urem if either operand is in (SignedMax,UnsignedMax...
[llvm-project.git] / clang-tools-extra / clangd / Feature.cpp
blobec707a33f656be006d4949aaeabfa82fd639cc82
1 //===--- Feature.cpp - Compile-time configuration ------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "Feature.h"
10 #include "clang/Basic/Version.h"
11 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
12 #include "llvm/Support/Compiler.h"
13 #include "llvm/TargetParser/Host.h"
15 namespace clang {
16 namespace clangd {
18 std::string versionString() { return clang::getClangToolFullVersion("clangd"); }
20 std::string platformString() {
21 static std::string PlatformString = []() {
22 std::string Host = llvm::sys::getProcessTriple();
23 std::string Target = llvm::sys::getDefaultTargetTriple();
24 if (Host != Target) {
25 Host += "; target=";
26 Host += Target;
28 return Host;
29 }();
30 return PlatformString;
33 std::string featureString() {
34 return
35 #if defined(_WIN32)
36 "windows"
37 #elif defined(__APPLE__)
38 "mac"
39 #elif defined(__linux__)
40 "linux"
41 #elif defined(LLVM_ON_UNIX)
42 "unix"
43 #else
44 "unknown"
45 #endif
47 #ifndef NDEBUG
48 "+debug"
49 #endif
50 #if LLVM_ADDRESS_SANITIZER_BUILD
51 "+asan"
52 #endif
53 #if LLVM_THREAD_SANITIZER_BUILD
54 "+tsan"
55 #endif
56 #if LLVM_MEMORY_SANITIZER_BUILD
57 "+msan"
58 #endif
60 #if CLANGD_ENABLE_REMOTE
61 "+grpc"
62 #endif
63 #if CLANGD_BUILD_XPC
64 "+xpc"
65 #endif
67 #if !CLANGD_TIDY_CHECKS
68 "-tidy"
69 #endif
71 #if !CLANGD_DECISION_FOREST
72 "-decision_forest"
73 #endif
77 } // namespace clangd
78 } // namespace clang