[cfe-commits] r61430 - in /cfe/trunk: include/clang/Basic/TokenKinds.def lib/Lex/Preprocessor.cpp lib/Parse/ParseDecl.cpp test/Parser/MicrosoftExtensions.c

Anton Korobeynikov anton at korobeynikov.info
Thu Dec 25 06:36:10 PST 2008


Hi, Steve

> Add parser support for __cdecl, __stdcall, and __fastcall.
> Change preprocessor implementation of _cdecl to reference __cdecl.
This breaks at least mingw heavily. Why do you need to make __cdecl /
__stdcall / __fastcall to be keywords? At least in gcc they are
builtin defines, which are expanded to attributes like the follows
(excerpt from windef.h):

#ifdef __GNUC__
#ifndef _fastcall
#define _fastcall __attribute__((fastcall))
#endif
#ifndef __fastcall
#define __fastcall __attribute__((fastcall))
#endif
#ifndef _stdcall
#define _stdcall __attribute__((stdcall))
#endif
#ifndef __stdcall
#define __stdcall __attribute__((stdcall))
#endif
#ifndef _cdecl
#define _cdecl __attribute__((cdecl))
#endif
#ifndef __cdecl
#define __cdecl __attribute__((cdecl))
#endif
#ifndef __declspec
#define __declspec(e) __attribute__((e))
#endif
#ifndef _declspec
#define _declspec(e) __attribute__((e))
#endif
#endif

Currently we even have full support for sema checks for stdcall /
fastcall attributes (I'm going to add bunch of tests today). And will
have full sema support for dllimport /dllexport pretty soon.

Codegen for these attributes was already completed.

Thus I think these keywords are really bogus.
-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the cfe-commits mailing list