Skip to content

Include LLVM_VERSION_SUFFIX in the Clang version string. #74469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ endif()
if(NOT DEFINED CLANG_VERSION_PATCHLEVEL)
set(CLANG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH})
endif()
# Unlike PACKAGE_VERSION, CLANG_VERSION does not include LLVM_VERSION_SUFFIX.
set(CLANG_VERSION "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}.${CLANG_VERSION_PATCHLEVEL}")
if(NOT DEFINED CLANG_VERSION_SUFFIX)
set(CLANG_VERSION_SUFFIX ${LLVM_VERSION_SUFFIX})
endif()
set(CLANG_VERSION "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}.${CLANG_VERSION_PATCHLEVEL}${CLANG_VERSION_SUFFIX}")
message(STATUS "Clang version: ${CLANG_VERSION}")

# Configure the Version.inc file.
Expand Down Expand Up @@ -650,6 +652,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
CLANG_VERSION_MAJOR
CLANG_VERSION_MINOR
CLANG_VERSION_PATCHLEVEL
CLANG_VERSION_SUFFIX
CLANG_VENDOR
LLVM_VERSION_SUFFIX
LLVM_BINUTILS_INCDIR
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Frontend/sarif-diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ void f1(t1 x, t1 y) {
// CHECK: {"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"{{[0-9]+}}","name":""},{"defaultConfiguration":
// CHECK: {"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"{{[0-9]+}}","name":""},{"defaultConfiguration":
// CHECK: {"enabled":true,"level":"error","rank":50},"fullDescription":
// CHECK: {"text":""},"id":"{{[0-9]+}}","name":""}],"version":"{{[0-9]+\.[0-9]+\.[0-9]+}}"}}}],"version":"2.1.0"}
// CHECK: 2 warnings and 6 errors generated.
// CHECK: {"text":""},"id":"{{[0-9]+}}","name":""}],"version":"{{[0-9]+\.[0-9]+\.[0-9]+[^" ]*}}"}}}],"version":"2.1.0"}
// CHECK: 2 warnings and 6 errors generated.
2 changes: 1 addition & 1 deletion llvm/utils/UpdateTestChecks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@ def add(var):

METADATA_FILTERS = [
(
r"(?<=\")(\w+ )?(\w+ version )[\d.]+(?: \([^)]+\))?",
r"(?<=\")(\w+ )?(\w+ version )[\d.]+(?:[^\" ]*)(?: \([^)]+\))?",
r"{{.*}}\2{{.*}}",
), # preface with glob also, to capture optional CLANG_VENDOR
(r'(!DIFile\(filename: ".+", directory: )".+"', r"\1{{.*}}"),
Expand Down