From 1bfdab52a76bf667aa345b5026f1d524ed6d4ac8 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Sat, 21 Sep 2019 19:09:24 +0000 Subject: [PATCH] [CodeView] Add pragma push/pop_macro for ARM64_FPSR to enum header This fixes (one aspect of) compilation of LLDB with MSVC for ARM64. LLDB source files include intrin.h, and the MSVC intrin.h transitively includes arm64intr.h, which has an ARM64_FPSR define, which clashes with the enum declaration. Differential Revision: https://reviews.llvm.org/D67864 llvm-svn: 372481 --- llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def index ee81313..ed5c143 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def +++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def @@ -489,6 +489,11 @@ CV_REGISTER(ARM_NQ15, 415) #if defined(CV_REGISTERS_ALL) || defined(CV_REGISTERS_ARM64) +// arm64intr.h from MSVC defines ARM64_FPSR, which conflicts with +// these declarations. +#pragma push_macro("ARM64_FPSR") +#undef ARM64_FPSR + // ARM64 registers CV_REGISTER(ARM64_NOREG, 0) @@ -677,4 +682,6 @@ CV_REGISTER(ARM64_Q31, 211) CV_REGISTER(ARM64_FPSR, 220) +#pragma pop_macro("ARM64_FPSR") + #endif // defined(CV_REGISTERS_ALL) || defined(CV_REGISTERS_ARM64) -- 2.7.4