[compiler-rt] [compiler-rt] Fix '-Wmacro-redefined' errors (PR #100337)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 02:37:07 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Dmitry Chestnykh (chestnykh)

<details>
<summary>Changes</summary>

https://lab.llvm.org/buildbot/#/builders/186/builds/880

---
Full diff: https://github.com/llvm/llvm-project/pull/100337.diff


1 Files Affected:

- (modified) compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp (+9) 


``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index bc2cb247f2a8a..bdc79778be631 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -2173,6 +2173,9 @@ static const char *RegNumToRegName(int reg) {
     case REG_ESP:
       return "esp";
 #    elif defined(__arm__)
+#      ifdef MAKE_CASE
+#        undef MAKE_CASE
+#      endif
 #      define REG_STR(reg) #reg
 #      define MAKE_CASE(N) \
         case REG_R##N:     \
@@ -2197,6 +2200,9 @@ static const char *RegNumToRegName(int reg) {
     case REG_R15:
       return "pc";
 #    elif defined(__aarch64__)
+#      ifdef MAKE_CASE
+#        undef MAKE_CASE
+#      endif
 #      define REG_STR(reg) #reg
 #      define MAKE_CASE(N) \
         case N:            \
@@ -2247,6 +2253,9 @@ static const char *RegNumToRegName(int reg) {
 static uptr GetArmRegister(ucontext_t *ctx, int RegNum) {
   switch (RegNum) {
 #      if defined(__arm__)
+#        ifdef MAKE_CASE
+#          undef MAKE_CASE
+#        endif
 #        define MAKE_CASE(N) \
           case REG_R##N:     \
             return ctx->uc_mcontext.arm_r##N

``````````

</details>


https://github.com/llvm/llvm-project/pull/100337


More information about the llvm-commits mailing list