summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* [DeclPrinter] Don't crash when printing a using decl with a special nameBenjamin Kramer2015-09-231-1/+1
| | | | | | Fixes PR24872. llvm-svn: 248376
* [CUDA] Allow parsing of host and device code simultaneously.Artem Belevich2015-09-221-6/+8
| | | | | | | | | | | | * adds -aux-triple option to specify target triple * propagates aux target info to AST context and Preprocessor * pulls in target specific preprocessor macros. * pulls in target-specific builtins from aux target. * sets appropriate host or device attribute on builtins. Differential Revision: http://reviews.llvm.org/D12917 llvm-svn: 248299
* Rename ASTSourceDescriptor::ModuleName to FullModuleName for clarity.Adrian Prantl2015-09-191-1/+1
| | | | llvm-svn: 248070
* Refactor ASTReader::getSourceDescriptor(const Module &) into a constructorAdrian Prantl2015-09-191-3/+7
| | | | | | | | of ASTSourceDescriptor. It was effectively a static function. NFC. llvm-svn: 248069
* [OPENMP 4.0] Add 'if' clause for 'cancel' directive.Alexey Bataev2015-09-182-7/+12
| | | | | | Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive. llvm-svn: 247976
* Support __builtin_ms_va_list.Charles Davis2015-09-172-6/+24
| | | | | | | | | | | | | | | | | | Summary: This change adds support for `__builtin_ms_va_list`, a GCC extension for variadic `ms_abi` functions. The existing `__builtin_va_list` support is inadequate for this because `va_list` is defined differently in the Win64 ABI vs. the System V/AMD64 ABI. Depends on D1622. Reviewers: rsmith, rnk, rjmccall CC: cfe-commits Differential Revision: http://reviews.llvm.org/D1623 llvm-svn: 247941
* Don't crash when passing &@selector to a _Nonnull parameter. Fixes PR24774.Nico Weber2015-09-151-2/+3
| | | | | | | | | The root cause here is that ObjCSelectorExpr is an rvalue, yet it can have its address taken. That's kind of awkward, but fixing this is awkward in other ways, see https://llvm.org/bugs/show_bug.cgi?id=24774#c16 . For now, just fix the crash. llvm-svn: 247740
* [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only ↵Alexey Bataev2015-09-151-15/+19
| | | | | | | | | | | | | | if 'cancel' is found. Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then ``` if (__kmpc_cancel_barrier()) exit from outer construct; ``` code is generated. Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive. llvm-svn: 247681
* Run clang-format to unify the switch statement style as suggest here: ↵Alexey Bader2015-09-153-114/+290
| | | | | | | | http://reviews.llvm.org/D12855#246073. NFC. llvm-svn: 247678
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-156-0/+141
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
* [OPENMP] Fix printing of array section with single index.Alexey Bataev2015-09-111-3/+5
| | | | llvm-svn: 247389
* [MS ABI] Make member pointers return true for isIncompleteTypeDavid Majnemer2015-09-101-0/+23
| | | | | | | The type of a member pointer is incomplete if it has no inheritance model. This lets us reuse more general logic already embedded in clang. llvm-svn: 247346
* CFI: Introduce -fsanitize=cfi-icall flag.Peter Collingbourne2015-09-102-34/+0
| | | | | | | | | | This flag causes the compiler to emit bit set entries for functions as well as runtime bitset checks at indirect call sites. Depends on the new function bitset mechanism. Differential Revision: http://reviews.llvm.org/D11857 llvm-svn: 247238
* Fix a bug in __builtin_object_size cast removalGeorge Burgess IV2015-09-041-3/+10
| | | | | | | | | | | Apparently there are many cast kinds that may cause implicit pointer arithmetic to happen. In light of this, the cast ignoring logic introduced in r246877 has been changed to only ignore a small set of cast kinds, and a test for this behavior has been added. Thanks to Richard for catching this before it became a bug report. :) llvm-svn: 246890
* Increase accuracy of __builtin_object_size.George Burgess IV2015-09-041-35/+96
| | | | | | | | | | | | | | | | | | | Improvements: - For all types, we would give up in a case such as: __builtin_object_size((char*)&foo, N); even if we could provide an answer to __builtin_object_size(&foo, N); We now provide the same answer for both of the above examples in all cases. - For type=1|3, we now support subobjects with unknown bases, as long as the designator is valid. Thanks to Richard Smith for the review + design planning. Review: http://reviews.llvm.org/D12169 llvm-svn: 246877
* [WebAssembly] Initial WebAssembly support in clangDan Gohman2015-09-031-0/+2
| | | | | | | | | | This implements basic support for compiling (though not yet assembling or linking) for a WebAssembly target. Note that ABI details are not yet finalized, and may change. Differential Revision: http://reviews.llvm.org/D12002 llvm-svn: 246814
* [OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.Alexey Bataev2015-09-031-0/+2
| | | | | | | | | | | | | | | | | OpenMP 4.1 added special 'directive-name-modifier' to the 'if' clause. Format of 'if' clause is as follows: ``` if([ directive-name-modifier :] scalar-logical-expression) ``` The restriction rules are also changed. 1. If any 'if' clause on the directive includes a 'directive-name-modifier' then all 'if' clauses on the directive must include a 'directive-name-modifier'. 2. At most one 'if' clause without a 'directive-name-modifier' can appear on the directive. 3. At most one 'if' clause with some particular 'directive-name-modifier' can appear on the directive. 'directive-name-modifier' is important for combined directives and allows to separate conditions in 'if' clause for simple sub-directives in combined directive. This 'directive-name-modifier' identifies the sub-directive to which this 'if' clause must be applied. llvm-svn: 246747
* [MS ABI] Number unnamed TagDecls which aren't externally visibleDavid Majnemer2015-09-021-1/+3
| | | | | | | | | | | | TagDecls (structs, enums, etc.) may have the same name for linkage purposes of one another; to disambiguate, we add a number to the mangled named. However, we didn't do this if the TagDecl has a pseudo-name for linkage purposes (it was defined alongside a DeclaratorDecl or a TypeNameDecl). This fixes PR24651. llvm-svn: 246659
* [MS ABI] Switch to the CRC implementation in LLVMDavid Majnemer2015-09-011-29/+5
| | | | | | | We now have an implementation of the CRC in LLVM's libSupport. Let's consolidate around that one. llvm-svn: 246591
* [MS ABI] Cleanup get*ForUnnamedTagDeclDavid Majnemer2015-09-011-4/+4
| | | | | | | Use "lookup" instead of operator[], it will not perform unnecessary insertions. No functionality change is intended. llvm-svn: 246523
* [MS ABI] Correctly mangle classes without names for linkage purposesDavid Majnemer2015-08-316-7/+92
| | | | | | | | | | | | | | | | A class without a name for linkage purposes gets a name along the lines of <unnamed-type-foo> where foo is either the name of a declarator which defined it (like a variable or field) or a typedef-name (like a typedef or alias-declaration). We handled the declarator case correctly but it would fall down during template instantiation if the declarator didn't share the tag's type. We failed to handle the typedef-name case at all. Instead, keep track of the association between the two and keep it up to date in the face of template instantiation. llvm-svn: 246469
* [OpenMP] Make the filetered clause iterator a real iterator and type safe.Benjamin Kramer2015-08-301-12/+0
| | | | | | | | | This replaces the filtered generic iterator with a type-specfic one based on dyn_cast instead of comparing the kind enum. This allows us to use range-based for loops and eliminates casts. No functionality change intended. llvm-svn: 246384
* [AST] Don't crash when comparing incomplete objectDavid Majnemer2015-08-291-1/+7
| | | | | | | | | | We cannot tell if an object is past-the-end if its type is incomplete. Zero sized objects satisfy past-the-end criteria and our object might turn out to be such an object. This fixes PR24622. llvm-svn: 246359
* PR24597: Fix in-place evaluation of call expressions to provide a proper "this"Richard Smith2015-08-281-17/+51
| | | | | | pointer to an RVO construction of a returned object. llvm-svn: 246263
* Corrected 3 typos. NFCCharles Li2015-08-261-3/+3
| | | | llvm-svn: 246093
* [OPENMP 4.0] Initial support for array sections.Alexey Bataev2015-08-2511-0/+30
| | | | | | | | Adds parsing/sema analysis/serialization/deserialization for array sections in OpenMP constructs (introduced in OpenMP 4.0). Currently it is allowed to use array sections only in OpenMP clauses that accepts list of expressions. Differential Revision: http://reviews.llvm.org/D10732 llvm-svn: 245937
* Changes missed from r245810Serge Pavlov2015-08-231-3/+3
| | | | llvm-svn: 245811
* Instantiate function declarations in instantiated functions.Serge Pavlov2015-08-231-0/+12
| | | | | | | | | | | | | | | | | If a function declaration is found inside a template function as in: template<class T> void f() { void g(int x = T::v) except(T::w); } it must be instantiated along with the enclosing template function, including default arguments and exception specification. Together with the patch committed in r240974 this implements DR1484. Differential Revision: http://reviews.llvm.org/D11194 llvm-svn: 245810
* [RecordLayoutBuilder] Remove duplicated diagnostic argument. NFC.Benjamin Kramer2015-08-211-3/+3
| | | | llvm-svn: 245700
* [OPENMP 4.1] Initial support for 'simdlen' clause.Alexey Bataev2015-08-212-0/+11
| | | | | | Add parsing/sema analysis for 'simdlen' clause in simd directives. Also add check that if both 'safelen' and 'simdlen' clauses are specified, the value of 'simdlen' parameter is less than the value of 'safelen' parameter. llvm-svn: 245692
* [OPENMP 4.1] Initial support for modifiers in 'linear' clause.Alexey Bataev2015-08-202-2/+9
| | | | | | | | | | | | | | | | | | | | | | OpenMP 4.1 adds 3 optional modifiers to 'linear' clause. Format of 'linear' clause has changed to: ``` linear(linear-list[ : linear-step]) ``` where linear-list is one of the following ``` list modifier(list) ``` where modifier is one of the following: ``` ref (C++) val (C/C++) uval (C++) ``` Patch adds parsing and sema analysis for these modifiers. llvm-svn: 245550
* Fix the layout of bitfields in ms_struct unions: theirJohn McCall2015-08-191-90/+152
| | | | | | | | | | | | | | | alignment is ignored, and they always allocate a complete storage unit. Also, change the dumping of AST record layouts: use the more readable C++-style dumping even in C, include bitfield offset information in the dump, and don't print sizeof/alignof information for fields of record type, since we don't do so for bases or other kinds of field. rdar://22275433 llvm-svn: 245514
* Internal-linkage variables with constant-evaluatable initializers do not ↵Richard Smith2015-08-191-1/+5
| | | | | | need to be emitted. (Also reduces the set of variables that need to be eagerly deserialized when using PCH / modules.) llvm-svn: 245497
* Make __builtin_object_size always answer correctlyGeorge Burgess IV2015-08-191-43/+88
| | | | | | | | | | | | | | | | | | __builtin_object_size would return incorrect answers for many uses where type=3. This fixes the inaccuracy by making us emit 0 instead of LLVM's objectsize intrinsic. Additionally, there are many cases where we would emit suboptimal (but correct) answers, such as when arrays are involved. This patch fixes some of these cases (please see new tests in test/CodeGen/object-size.c for specifics on which cases are improved) Resubmit of r245323 with PR24493 fixed. Patch mostly by Richard Smith. Differential Revision: http://reviews.llvm.org/D12000 This fixes PR15212. llvm-svn: 245403
* unique_ptrify CXXBasePaths::DeclsFound & remove the then-unnecessary ↵David Blaikie2015-08-181-4/+4
| | | | | | | | | user-defined dtor Maybe this and the NumDeclsFound member should just be a std::vector instead. (it could be a std::dynarray, but that missed standardization) llvm-svn: 245392
* Revert r245323, it caused PR24493.Nico Weber2015-08-181-82/+44
| | | | llvm-svn: 245342
* Make __builtin_object_size always answer correctlyGeorge Burgess IV2015-08-181-44/+82
| | | | | | | | | | | | | | | | | __builtin_object_size would return incorrect answers for many uses where type=3. This fixes the inaccuracy by making us emit 0 instead of LLVM's objectsize intrinsic. Additionally, there are many cases where we would emit suboptimal (but correct) answers, such as when arrays are involved. This patch fixes some of these cases (please see new tests in test/CodeGen/object-size.c for specifics on which cases are improved) Patch mostly by Richard Smith. Differential Revision: http://reviews.llvm.org/D12000 This fixes PR15212. llvm-svn: 245323
* [OPENMP 4.1] Allow variables with reference types in private clauses.Alexey Bataev2015-08-182-8/+17
| | | | | | OpenMP 4.1 allows to use variables with reference types in all private clauses (private, firstprivate, lastprivate, linear etc.). Patch allows to use such variables and fixes codegen for linear variables with reference types. llvm-svn: 245268
* [ASTContext] Call APValue destructors for MaterializedTemporaryValuesDavid Majnemer2015-08-141-0/+4
| | | | | | Hopefully this makes the sanitizer build bot happy. llvm-svn: 245054
* [OPENMP] Fix for http://llvm.org/PR24371: Assert failure compiling blender 2.75.Alexey Bataev2015-08-141-0/+11
| | | | | | | blender uses statements expression in condition of the loop under control of the '#pragma omp parallel for'. This condition is used several times in different expressions required for codegen of the loop directive. If there are some variables defined in statement expression, it fires an assert during codegen because of redefinition of the same variables. We have to rebuild several expression to be sure that all variables are unique. llvm-svn: 245041
* Avoid iteration invalidation issues around MaterializedTemporaryExprDavid Majnemer2015-08-131-5/+7
| | | | | | | | | | | | | | | | We risk iterator invalidation issues if we use a DenseMap to hold the backing storage for an APValue. Instead, BumpPtrAllocate them and use APValue * as our DenseMap value. Also, don't assume that MaterializedGlobalTemporaryMap won't regrow between when we initially perform a lookup and later on when we actually try to insert into it. This fixes PR24289. Differential Revision: http://reviews.llvm.org/D11629 llvm-svn: 244989
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-135-10/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* -Wdeprecated: Job objects are stored in a vector yet are not really ↵David Blaikie2015-08-121-2/+8
| | | | | | copyable, make them movable instead llvm-svn: 244829
* [dllimport] A non-imported class with an imported key can't have a keyReid Kleckner2015-08-101-0/+6
| | | | | | | | | | | | | | | | | Summary: The vtable takes its DLL storage class from the class, not the key function. When they disagree, the vtable won't be exported by the DLL that defines the key function. The easiest way to ensure that importers of the class emit their own vtable is to say that the class has no key function. Reviewers: hans, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11913 llvm-svn: 244488
* AST: Implement mangling support for function types without a prototype.Peter Collingbourne2015-08-072-5/+25
| | | | | | | | | | Function types without prototypes can arise when mangling a function type within an overloadable function in C. We mangle these as the absence of any parameter types (not even an empty parameter list). Differential Revision: http://reviews.llvm.org/D11848 llvm-svn: 244374
* This patch commits OpenMP 4 target device clausesMichael Wong2015-08-072-0/+9
| | | | | | | This is committed on behalf of Kelvin Li http://reviews.llvm.org/D11469?id=31227 llvm-svn: 244325
* Convert a few classes over to use the new TrailingObjects helper.James Y Knight2015-08-062-58/+62
| | | | | | | | | | This initial commit serves as an example -- the remainder of the classes using pointer arithmetic for trailing objects will be converted in subsequent changes. Differential Revision: http://reviews.llvm.org/D11298 llvm-svn: 244262
* Remove unused 'Owned' flag from TemplateArgumentList.James Y Knight2015-08-061-1/+1
| | | | llvm-svn: 244261
* [OPENMP 4.1] Allow references in init expression for loop-based constructs.Alexey Bataev2015-08-061-0/+12
| | | | | | OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms. llvm-svn: 244209
* [ObjC] Circular containers: add support of subclassesAlex Denisov2015-08-061-1/+21
| | | | llvm-svn: 244193
OpenPOWER on IntegriCloud