summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/callingconv.c
Commit message (Collapse)AuthorAgeFilesLines
* Renamed and changed the wording of warn_cconv_ignoredSunil Srivastava2019-07-171-6/+6
| | | | | | | | As discussed in D64780 the wording of this warning message is being changed to say 'is not supported' instead of 'ignored', and the diag ID itself is being changed to warn_cconv_not_supported. llvm-svn: 366368
* Permit redeclarations of a builtin to specify calling convention.Erich Keane2019-03-211-3/+5
| | | | | | | | | | | | | | | | | | | | After https://reviews.llvm.org/rL355317 we noticed that quite a decent amount of code redeclares builtins (memcpy in particular, I believe reduced from an MSVC header) with a calling convention specified. This gets particularly troublesome when the user specifies a new 'default' calling convention on the command line. When looking to add a diagnostic for this case, it was noticed that we had 3 other diagnostics that differed only slightly. This patch ALSO unifies those under a 'select'. Unfortunately, the order of words in ONE of these diagnostics was reversed ("'thiscall' calling convention" vs "calling convention 'thiscall'"), so this patch also standardizes on the former. Differential Revision: https://reviews.llvm.org/D59560 Change-Id: I79f99fe7c2301640755ffdd774b46eb44526bb22 llvm-svn: 356663
* [AArch64] Add aarch64_vector_pcs function attribute to ClangSander de Smalen2018-11-261-0/+2
| | | | | | | | | | | | | | | | | | | | This is the Clang patch to complement the following LLVM patches: https://reviews.llvm.org/D51477 https://reviews.llvm.org/D51479 More information describing the vector ABI and procedure call standard can be found here: https://developer.arm.com/products/software-development-tools/\ hpc/arm-compiler-for-hpc/vector-function-abi Patch by Kerry McLaughlin. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D54425 llvm-svn: 347571
* Remove support for pnaclcall attributeDerek Schuff2015-01-281-2/+0
| | | | | | | | | | | | | | | | | | Summary: It was used for interoperability with PNaCl's calling conventions, but it's no longer needed. Also Remove NaCl*ABIInfo which just existed to delegate to either the portable or native ABIInfo, and remove checkCallingConvention which was now a no-op override. Reviewers: jvoung Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D7206 llvm-svn: 227362
* Don't diagnose no-prototype callee-cleanup function definitionsReid Kleckner2014-11-031-1/+1
| | | | | | | | | | | | We already have a warning on the call sites of code like this: void f() { } void g() { f(1, 2, 3); } t.c:2:21: warning: too many arguments in call to 'f' We can limit ourselves to diagnosing unprototyped forward declarations of f to cut down on noise. llvm-svn: 221184
* Add frontend support for __vectorcallReid Kleckner2014-10-241-1/+1
| | | | | | | | | | | | | Wire it through everywhere we have support for fastcall, essentially. This allows us to parse the MSVC "14" CTP headers, but we will miscompile them because LLVM doesn't support __vectorcall yet. Reviewed By: Aaron Ballman Differential Revision: http://reviews.llvm.org/D5808 llvm-svn: 220573
* Downgrade error about stdcall decls with no prototype to a warningReid Kleckner2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | Fixes PR21027. The MIDL compiler produces code that does this. If we wanted to improve the warning, I think we could do this: void __stdcall f(); // Don't warn without -Wstrict-prototypes. void g() { f(); // Might warn, the user probably meant for f to take no args. f(1, 2, 3); // Warn, we have no idea what args f takes. f(1); // Error, this is insane, one of these calls is broken. } Reviewers: thakis Differential Revision: http://reviews.llvm.org/D5481 llvm-svn: 218394
* Improving calling convention test coverage by adding tests for things not ↵Aaron Ballman2013-11-191-0/+2
| | | | | | currently handled. Specifically: the diagnostics in SemaDeclAttr.cpp, and ensuring that calling convention attributes are applied to ObjC method declarations. No functional changes. llvm-svn: 195098
* Tighten diagnostics for calling conventions on variadic functionsHans Wennborg2013-10-091-4/+3
| | | | | | | | | | | | Follow-up from r192240. This makes it an error to use callee-cleanup conventions on variadic functions, except for __fastcall and __stdcall, which we ignore with a warning for GCC and MSVC compatibility. Differential Revision: http://llvm-reviews.chandlerc.com/D1870 llvm-svn: 192308
* Turn error about fastcall variadic function into warning in MS mode (PR12535)Hans Wennborg2013-10-081-0/+6
| | | | | | | | | | MSVC allows this and silently falls back to __cdecl for variadic functions. This patch turns Clang's error into a warning in MS mode and adds a test to make sure we generate correct code. Differential Revision: http://llvm-reviews.chandlerc.com/D1861 llvm-svn: 192240
* Updated the PCS calling convention to use the new checkStringLiteralArgument ↵Aaron Ballman2013-09-131-1/+2
| | | | | | helper function. llvm-svn: 190710
* Consolidating the notion of a GNU attribute parameter with the attribute ↵Aaron Ballman2013-08-311-1/+1
| | | | | | argument list. llvm-svn: 189711
* Delete CC_Default and use the target default CC everywhereReid Kleckner2013-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Makes functions with implicit calling convention compatible with function types with a matching explicit calling convention. This fixes things like calls to qsort(), which has an explicit __cdecl attribute on the comparator in Windows headers. Clang will now infer the calling convention from the declarator. There are two cases when the CC must be adjusted during redeclaration: 1. When defining a non-inline static method. 2. When redeclaring a function with an implicit or mismatched convention. Fixes PR13457, and allows clang to compile CommandLine.cpp for the Microsoft C++ ABI. Excellent test cases provided by Alexander Zinenko! Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1231 llvm-svn: 189412
* err_attribute_not_string has been subsumed by err_attribute_argument_type.Aaron Ballman2013-07-301-1/+1
| | | | llvm-svn: 187400
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-231-7/+7
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-291-1/+1
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Add intel_ocl_bicc calling convention as a function attribute to clang. The ↵Guy Benyei2012-12-251-0/+2
| | | | | | calling convention is already implemented in LLVM. llvm-svn: 171056
* Add pnaclcall convention to Native Client targets.Derek Schuff2012-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because PNaCl bitcode must be target-independent, it uses some different bitcode representations from other targets (e.g. byval and sret for structures). This means that without additional type information, it cannot meet some native ABI requirements for some targets (e.g. passing structures containing unions by value on x86-64). To allow generation of code which uses the correct native ABIs, we also support triples such as x86_64-nacl, which uses target-dependent IR (as opposed to le32-nacl, which uses byval and sret). To allow interoperation between the two types of code, this patch adds a calling convention attribute to be used in code compiled with the target-dependent triple, which will generate code using the le32-style bitcode. This calling convention does not need to be explicitly supported in the backend because it determines bitcode representation rather than native conventions (the backend just needs to undersand how to handle byval and sret for the Native Client OS). This patch implements __attribute__((pnaclcall)) to generate calls in bitcode according to the le32 bitcode conventions, an attribute which is accepted by any Native Client target, but issues a warning otherwise. llvm-svn: 166065
* Allowing individual targets to determine whether a given calling convention ↵Aaron Ballman2012-10-021-3/+4
| | | | | | | | is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs. Fixes PR13782 llvm-svn: 165015
* Fix horribly broken sema of __attribute__((pcs())).Benjamin Kramer2012-08-141-0/+8
| | | | llvm-svn: 161863
* Pretty up the wrong-number-of-arguments-for-attribute diagnostic byJohn McCall2011-03-021-2/+2
| | | | | | | using a custom plural form. Split out the range diagnostics as their own message. llvm-svn: 126840
* When we encounter a function-specific attribute in a declaration specifier,Charles Davis2010-02-241-0/+4
| | | | | | | apply it only to the function itself, and never to the return type. Fixes part of PR6408. llvm-svn: 97015
* When comparing two calling conventions after redeclaring a function, compareCharles Davis2010-02-231-0/+4
| | | | | | | the canonical calling conventions instead of comparing the raw calling conventions directly. Fixes PR6361. llvm-svn: 96895
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-2/+5
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Allow calling convention attributes to apply to types. Patch by Chip Davis!John McCall2010-02-041-0/+12
| | | | llvm-svn: 95291
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGenEli Friedman2009-11-091-0/+4
| | | | | | | | unless we start implementing command-line switches which override the default calling convention, so the effect is mostly to silence unknown attribute warnings.) llvm-svn: 86571
* Diagnose the use of 'fastcall' on functions without prototypes or withJohn McCall2009-11-041-0/+9
| | | | | | varargs prototypes. llvm-svn: 86001
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Add new testNate Begeman2008-03-071-0/+10
llvm-svn: 48018
OpenPOWER on IntegriCloud