[cfe-commits] [PATCH] [VCPP] Add __ptr64 qualifier

pravic ehysta at gmail.com
Mon Nov 5 14:35:56 PST 2012


  > Test cases are required for this sort of thing.  Also, you're not
  > checking whether it has the __ptr64 attribute before performing the
  > mangle, are you sure that's what you want?  Is there a __ptr32 mangle
  > we should be emitting if the pointer width is 32?


  Idk, I just compared mangled names from VC and Clang.

  Compile x86 code:
  $ bin\cl.exe /nologo /c ms-ptr64.cpp&&  strings -n 6 ms-ptr64.obj | grep VS
  mangle-ms-ptr64.cpp
  ??0?$VS@$$$V@@QAE at XZ
  ??0?$VS at H@@QAE at H@Z
  ??0?$VS at HN@@QAE at HN@Z

  Compile x64 code:
  $ bin\amd64\cl.exe /nologo /c ms-ptr64.cpp&&  strings -n 6 ms-ptr64.obj
  | grep VS
  mangle-ms-ptr64.cpp
  ??0?$VS@$$$V@@QEAA at XZ
  ??0?$VS at H@@QEAA at H@Z
  ??0?$VS at HN@@QEAA at HN@Z

  Undecorate x86 signature:
  $ undname.exe ??0?$VS at H@@QAE at H@Z
  Undecoration of :- "??0?$VS at H@@QAE at H@Z"
  is :- "public: __thiscall VS<int>::VS<int>(int)"

  Undecorate x64 signature:
  $ undname.exe ??0?$VS at H@@QEAA at H@Z
  Undecoration of :- "??0?$VS at H@@QEAA at H@Z"
  is :- "public: __cdecl VS<int>::VS<int>(int) __ptr64"

  Intel C++ with /Qms does same (QAE on ia32 and QEAA on intel64). Clang
  was produced just "QAA" (__cdecl) on x64.

http://llvm-reviews.chandlerc.com/D101



More information about the cfe-commits mailing list