summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/builtins.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [opaque pointer types] Cleanup CGBuilder's Create*GEP.James Y Knight2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Some of these functions take some extraneous arguments, e.g. EltSize, Offset, which are computable from the Type and DataLayout. Add some asserts to ensure that the computed values are consistent with the passed-in values, in preparation for eliminating the extraneous arguments. This also asserts that the Type is an Array for the calls named "Array" and a Struct for the calls named "Struct". Then, correct a couple of errors: 1. Using CreateStructGEP on an array type. (this causes the majority of the test differences, as struct GEPs are created with i32 indices, while array GEPs are created with i64 indices) 2. Passing the wrong Offset to CreateStructGEP in TargetInfo.cpp on x86-64 NACL (which uses 32-bit pointers). Differential Revision: https://reviews.llvm.org/D57766 llvm-svn: 353529
* Fix __builtin_*_overflow when out-param isn't constexprErich Keane2018-07-051-0/+16
| | | | | | | | | | | | | | | As brought up on cfe-commits[1], r334650 causes the dependency of the out parameter to the __builtin_*_overflow functions to be ignored. The result was a usage that was otherwise constexpr (both operands to the operation were constexpr) would be evaluated, but the out parameter wouldn't be modified, so it would still be 'undef'. This patch correctly handles the return value of handleAssignment to ensure that this value is properly considered/evaluated. [1] http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180702/233667.html llvm-svn: 336364
* P0426: Make the library implementation of constexpr char_traits a little easierRichard Smith2017-01-201-0/+4
| | | | | | | | | by providing a memchr builtin that returns char* instead of void*. Also add a __has_feature flag to indicate the presence of constexpr forms of the relevant <string> functions. llvm-svn: 292555
* clang/test/CodeGenCXX/builtins.cpp: Fix for -Asserts.NAKAMURA Takumi2013-11-021-4/+3
| | | | | | | - Don't seek "entry:" It dosen't appear with -Asserts. - Take care that Codegen'ed Instruction(s) wouldn't have name(s) in -Asserts. llvm-svn: 193908
* Adding triple to lit test fixed in r193901Warren Hunt2013-11-021-4/+4
| | | | llvm-svn: 193902
* Fixes lit test that doesn't fail on windowsWarren Hunt2013-11-021-3/+3
| | | | | | | long in linux 64 is 64 bits but is always 32 bits on windows. The lit test was modified to use long long instead of long and check for 64-bit mangling. llvm-svn: 193901
* Wraps lazily generated builtins in an extern "C" contextWarren Hunt2013-11-011-0/+12
| | | | | | | | | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2082 Adds a lang_c LinkageSpecDecl to lazily generated builtins. This enforces correct behavior for builtins in a variety of cases without special treatment elsewhere within the compiler (special treatment is removed by the patch). It also allows for C++ overloads of builtin functions, which Microsoft uses in their headers e.g. _InterlockedExchangeAdd is an extern C builtin for the long type but an inline wrapper for int type. llvm-svn: 193896
* Add a __builtin_addressof that performs the same functionality as the built-inRichard Smith2013-07-111-0/+8
| | | | | | | | | | | & operator (ignoring any overloaded operator& for the type). The purpose of this builtin is for use in std::addressof, to allow it to be made constexpr; the existing implementation technique (reinterpret_cast to some reference type, take address, reinterpert_cast back) does not permit this because reinterpret_cast between reference types is not permitted in a constant expression in C++11 onwards. llvm-svn: 186053
* Permit ABIs where the caller extends the result (test change).Tim Northover2013-02-071-1/+1
| | | | | | | | | This test was written to make sure *something* sane is generated, not to test any ABI's signedness semantics. This should allow the test to pass if AArch64 is the default target. llvm-svn: 174618
* Change the representation of builtin functions in the ASTEli Friedman2012-08-311-12/+0
| | | | | | | | | (__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
* When extracting the callee declaration from a call expression, be sureDouglas Gregor2011-09-061-0/+12
| | | | | | | | | | to look through SubstNonTypeTemplateParmExprs. Then, update the IR generation of CallExprs to actually use CallExpr::getCalleeDecl() rather than attempting to mimick its behavior (badly). Fixes <rdar://problem/10063539>. llvm-svn: 139185
* In C++, if the user redeclares a builtin function with a type that isDouglas Gregor2010-12-211-0/+9
inconsistent with the type that the builtin *should* have, forget about the builtin altogether: we don't want subsequence analyses, CodeGen, etc., to think that we have a proper builtin function. C is protected from errors here because it allows one to use a library builtin without having a declaration, and detects inconsistent (re-)declarations of builtins during declaration merging. C++ was unprotected, and therefore would crash. Fixes PR8839. llvm-svn: 122351
OpenPOWER on IntegriCloud