From a9ad60c412327bc124258d4b9926436087e68ac4 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 10 Jan 2014 13:42:12 +0000 Subject: [PATCH] Use 'w' instead of 'c' to represent the win32 mangling. This change was requested to avoid confusion if we ever support non windows coff systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198938 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.rst | 2 +- include/llvm/IR/DataLayout.h | 8 ++++---- lib/IR/DataLayout.cpp | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/LangRef.rst b/docs/LangRef.rst index d4a7725d1fd..ffe3f09d83b 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -1165,7 +1165,7 @@ as follows: * ``m``: Mips mangling: Private symbols get a ``$`` prefix. * ``o``: Mach-O mangling: Private symbols get ``L`` prefix. Other symbols get a ``_`` prefix. - * ``c``: COFF prefix: Similar to Mach-O, but stdcall and fastcall + * ``w``: Windows COFF prefix: Similar to Mach-O, but stdcall and fastcall functions also get a suffix based on the frame size. ``n::...`` This specifies a set of native integer widths for the target CPU in diff --git a/include/llvm/IR/DataLayout.h b/include/llvm/IR/DataLayout.h index 9ffa056355d..acd3d825550 100644 --- a/include/llvm/IR/DataLayout.h +++ b/include/llvm/IR/DataLayout.h @@ -104,7 +104,7 @@ private: MM_None, MM_ELF, MM_MachO, - MM_COFF, + MM_WINCOFF, MM_Mips }; ManglingModeT ManglingMode; @@ -234,7 +234,7 @@ public: } bool hasMicrosoftFastStdCallMangling() const { - return ManglingMode == MM_COFF; + return ManglingMode == MM_WINCOFF; } bool hasLinkerPrivateGlobalPrefix() const { @@ -254,7 +254,7 @@ public: case MM_Mips: return '\0'; case MM_MachO: - case MM_COFF: + case MM_WINCOFF: return '_'; } llvm_unreachable("invalid mangling mode"); @@ -269,7 +269,7 @@ public: case MM_Mips: return "$"; case MM_MachO: - case MM_COFF: + case MM_WINCOFF: return "L"; } llvm_unreachable("invalid mangling mode"); diff --git a/lib/IR/DataLayout.cpp b/lib/IR/DataLayout.cpp index 6f32be08c5b..7df867279b2 100644 --- a/lib/IR/DataLayout.cpp +++ b/lib/IR/DataLayout.cpp @@ -159,7 +159,7 @@ const char *DataLayout::getManglingComponent(const Triple &T) { if (T.isOSBinFormatELF() || T.isArch64Bit()) return "-m:e"; assert(T.isOSBinFormatCOFF()); - return "-m:c"; + return "-m:w"; } static const LayoutAlignElem DefaultAlignments[] = { @@ -334,8 +334,8 @@ void DataLayout::parseSpecifier(StringRef Desc) { case 'm': ManglingMode = MM_Mips; break; - case 'c': - ManglingMode = MM_COFF; + case 'w': + ManglingMode = MM_WINCOFF; break; } break; @@ -525,8 +525,8 @@ std::string DataLayout::getStringRepresentation() const { case MM_MachO: OS << "-m:o"; break; - case MM_COFF: - OS << "-m:c"; + case MM_WINCOFF: + OS << "-m:w"; break; case MM_Mips: OS << "-m:m"; -- 2.34.1