aboutsummaryrefslogtreecommitdiff
path: root/bolt/lib/Utils/CommandLineOpts.cpp
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2022-04-15 06:13:19 -0700
committerAmir Ayupov <aaupov@fb.com>2022-04-15 06:33:14 -0700
commit4f277f28ab88bb96c8da1da96dda11bab17a3da7 (patch)
tree2e320b01745f429e44099c7929a1346887fb9388 /bolt/lib/Utils/CommandLineOpts.cpp
parent57a4f9bd493bca0dc78b16951c7d3f3fadfbc2f2 (diff)
downloadllvm-4f277f28ab88bb96c8da1da96dda11bab17a3da7.zip
llvm-4f277f28ab88bb96c8da1da96dda11bab17a3da7.tar.gz
llvm-4f277f28ab88bb96c8da1da96dda11bab17a3da7.tar.bz2
[BOLT] Check if LLVM_REVISION is defined
Handle the case where LLVM_REVISION is undefined (due to LLVM_APPEND_VC_REV=OFF or otherwise) by setting "<unknown>" value as before D123549. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D123852
Diffstat (limited to 'bolt/lib/Utils/CommandLineOpts.cpp')
-rw-r--r--bolt/lib/Utils/CommandLineOpts.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/bolt/lib/Utils/CommandLineOpts.cpp b/bolt/lib/Utils/CommandLineOpts.cpp
index 6aa1b777..cdf75ac 100644
--- a/bolt/lib/Utils/CommandLineOpts.cpp
+++ b/bolt/lib/Utils/CommandLineOpts.cpp
@@ -17,7 +17,12 @@ using namespace llvm;
namespace llvm {
namespace bolt {
-const char *BoltRevision = LLVM_REVISION;
+const char *BoltRevision =
+#ifdef LLVM_REVISION
+ LLVM_REVISION;
+#else
+ "<unknown>";
+#endif
}
}