Skip to content

Commit 96eb2c8

Browse files
committed
fixup! [Clang][HIP] Deprecate the AMDGCN_WAVEFRONT_SIZE macros
use plain Twine with empty string instead of optional
1 parent adcdba4 commit 96eb2c8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/include/clang/Basic/MacroBuilder.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "clang/Basic/LLVM.h"
1818
#include "llvm/ADT/Twine.h"
1919
#include "llvm/Support/raw_ostream.h"
20-
#include <optional>
2120

2221
namespace clang {
2322

@@ -30,11 +29,11 @@ class MacroBuilder {
3029
/// If DeprecationMsg is provided, also append a pragma to deprecate the
3130
/// defined macro.
3231
void defineMacro(const Twine &Name, const Twine &Value = "1",
33-
std::optional<Twine> DeprecationMsg = std::nullopt) {
32+
Twine DeprecationMsg = "") {
3433
Out << "#define " << Name << ' ' << Value << '\n';
35-
if (DeprecationMsg.has_value())
36-
Out << "#pragma clang deprecated(" << Name << ", \""
37-
<< DeprecationMsg.value() << "\")\n";
34+
if (!DeprecationMsg.isTriviallyEmpty())
35+
Out << "#pragma clang deprecated(" << Name << ", \"" << DeprecationMsg
36+
<< "\")\n";
3837
}
3938

4039
/// Append a \#undef line for Name. Name should be of the form XXX

0 commit comments

Comments
 (0)