Added macro to abstract differences in sytax string parsing between GAS and Clang integrated assembler. Also see LLVM Bug 18916 (https://llvm.org/bugs/show_bug.cgi?id=18916)

pull/35/head
Jeffrey Walton 2015-07-21 13:48:48 -04:00
parent 945c358785
commit 5e8b114e58
1 changed files with 12 additions and 0 deletions

12
cpu.h
View File

@ -228,6 +228,18 @@ inline int GetCacheLineSize()
#define AS_HEX(y) 0x##y
#endif
// https://llvm.org/bugs/show_bug.cgi?id=18916
#if defined(__clang__)
# define GNU_ATT_SYNTAX ".att_syntax;"
# define GNU_INTEL_SYNTAX ".intel_syntax;"
#elif defined(__GNUC__)
# define GNU_ATT_SYNTAX ".att_syntax prefix;"
# define GNU_INTEL_SYNTAX ".intel_syntax noprefix;"
#else
# define GNU_ATT_SYNTAX ".att_syntax prefix;"
# define GNU_INTEL_SYNTAX ".intel_syntax noprefix;"
#endif
#define IF0(y)
#define IF1(y) y