22# project using clang-cl. Tracked in https://github.com/envoyproxy/envoy/issues/11974.
33
44diff --git a/base/compiler_specific.h b/base/compiler_specific.h
5- index 0cd36dc..8c4cbd4 100644
5+ index 6651220..a469c19 100644
66--- a/base/compiler_specific.h
77+++ b/base/compiler_specific.h
88@@ -7,10 +7,6 @@
9-
9+
1010 #include "build/build_config.h"
11-
11+
1212- #if defined(COMPILER_MSVC) && !defined(__clang__)
1313- #error "Only clang-cl is supported on Windows, see https://crbug.com/988071"
1414- #endif
1515-
16- // Annotate a variable indicating it's ok if the variable is not used.
17- // (Typically used to silence a compiler warning when the assignment
18- // is important for some other reason.)
19- @@ -55 ,8 +51 ,12 @@
20- // prevent code folding, see gurl_base:: debug::Alias .
16+ // This is a wrapper around `__has_cpp_attribute`, which can be used to test for
17+ // the presence of an attribute. In case the compiler does not support this
18+ // macro it will simply evaluate to 0.
19+ @@ -75 ,8 +71 ,12 @@
20+ // prevent code folding, see NO_CODE_FOLDING() in base/ debug/alias.h .
2121 // Use like:
2222 // void NOT_TAIL_CALLED FooBar();
2323- #if defined(__clang__) && __has_attribute(not_tail_called)
@@ -30,18 +30,18 @@ index 0cd36dc..8c4cbd4 100644
3030 #else
3131 #define NOT_TAIL_CALLED
3232 #endif
33- @@ -226 ,7 +226 ,9 @@
33+ @@ -273 ,7 +273 ,9 @@
3434 #endif
3535 #endif
36-
36+
3737- #if defined(__clang__) && __has_attribute(uninitialized)
3838+ #if defined(__clang__)
3939+ #if defined(__has_attribute)
4040+ #if __has_attribute(uninitialized)
4141 // Attribute "uninitialized" disables -ftrivial-auto-var-init=pattern for
4242 // the specified variable.
4343 // Library-wide alternative is
44- @@ -257 ,6 +259 ,8 @@
44+ @@ -304 ,6 +306 ,8 @@
4545 // E.g. platform, bot, benchmark or test name in patch description or next to
4646 // the attribute.
4747 #define STACK_UNINITIALIZED __attribute__((uninitialized))
@@ -50,13 +50,55 @@ index 0cd36dc..8c4cbd4 100644
5050 #else
5151 #define STACK_UNINITIALIZED
5252 #endif
53+ @@ -365,8 +369,12 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
54+ #endif // defined(__clang_analyzer__)
55+
56+ // Use nomerge attribute to disable optimization of merging multiple same calls.
57+ - #if defined(__clang__) && __has_attribute(nomerge)
58+ + #if defined(__clang__)
59+ + #if defined(__has_attribute)
60+ + #if __has_attribute(nomerge)
61+ #define NOMERGE [[clang::nomerge]]
62+ + #endif
63+ + #endif
64+ #else
65+ #define NOMERGE
66+ #endif
67+ @@ -392,8 +400,12 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
68+ // See also:
69+ // https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
70+ // https://libcxx.llvm.org/docs/DesignDocs/UniquePtrTrivialAbi.html
71+ - #if defined(__clang__) && __has_attribute(trivial_abi)
72+ + #if defined(__clang__)
73+ + #if defined(__has_attribute)
74+ + #if __has_attribute(trivial_abi)
75+ #define TRIVIAL_ABI [[clang::trivial_abi]]
76+ + #endif
77+ + #endif
78+ #else
79+ #define TRIVIAL_ABI
80+ #endif
81+ @@ -401,8 +413,12 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
82+ // Marks a member function as reinitializing a moved-from variable.
83+ // See also
84+ // https://clang.llvm.org/extra/clang-tidy/checks/bugprone-use-after-move.html#reinitialization
85+ - #if defined(__clang__) && __has_attribute(reinitializes)
86+ + #if defined(__clang__)
87+ + #if defined(__has_attribute)
88+ + #if __has_attribute(reinitializes)
89+ #define REINITIALIZES_AFTER_MOVE [[clang::reinitializes]]
90+ + #endif
91+ + #endif
92+ #else
93+ #define REINITIALIZES_AFTER_MOVE
94+ #endif
5395
5496# TODO(dio): Consider to remove the following patch when we have IDN-free optional build for URL
5597# library from the upstream Chromium project. This is tracked in:
5698# https://github.com/envoyproxy/envoy/issues/14743.
5799
58100diff --git a/url/BUILD b/url/BUILD
59- index f2ec8da..4e2d55b 100644
101+ index f2ec8da..951039b 100644
60102--- a/url/BUILD
61103+++ b/url/BUILD
62104@@ -52,3 +52,27 @@ cc_library(
0 commit comments