[llvm] r372481 - [CodeView] Add pragma push/pop_macro for ARM64_FPSR to enum header

Martin Storsjo via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 21 12:09:24 PDT 2019


Author: mstorsjo
Date: Sat Sep 21 12:09:24 2019
New Revision: 372481

URL: http://llvm.org/viewvc/llvm-project?rev=372481&view=rev
Log:
[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

Modified:
    llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def?rev=372481&r1=372480&r2=372481&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def Sat Sep 21 12:09:24 2019
@@ -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)




More information about the llvm-commits mailing list