[clang] e55d52c - [AArch64] Don't redefine _LP64 and __LP64__

John Brawn via cfe-commits cfe-commits at lists.llvm.org
Wed May 17 07:23:16 PDT 2023


Author: John Brawn
Date: 2023-05-17T15:21:20+01:00
New Revision: e55d52cd34fb7a6a6617639d147b9d0abaceeeab

URL: https://github.com/llvm/llvm-project/commit/e55d52cd34fb7a6a6617639d147b9d0abaceeeab
DIFF: https://github.com/llvm/llvm-project/commit/e55d52cd34fb7a6a6617639d147b9d0abaceeeab.diff

LOG: [AArch64] Don't redefine _LP64 and __LP64__

Don't define these macros in AArch64TargetInfo::getTargetDefines, as
they're already defined in InitializePredefinedMacros and the
redefinition causes unwanted warnings with -Wsystem-headers.

Added: 
    

Modified: 
    clang/lib/Basic/Targets/AArch64.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 3840139d27434..d661f25ea00f2 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -340,12 +340,6 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
       getTriple().isOSBinFormatELF())
     Builder.defineMacro("__ELF__");
 
-  // Target properties.
-  if (!getTriple().isOSWindows() && getTriple().isArch64Bit()) {
-    Builder.defineMacro("_LP64");
-    Builder.defineMacro("__LP64__");
-  }
-
   std::string CodeModel = getTargetOpts().CodeModel;
   if (CodeModel == "default")
     CodeModel = "small";


        


More information about the cfe-commits mailing list