summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Rename the non-coding style conformant functions in namespace BuiltinsEric Christopher2015-08-061-1/+1
| | | | | | to match the rest of their brethren and reformat the bits that need it. llvm-svn: 244186
* function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove itsRichard Smith2015-08-053-31/+10
| | | | | | | | useless return value. Switch to using it directly when completing the redeclaration chain for an anonymous declaration, and reduce the set of declarations that we load in the process to just those of the right kind. llvm-svn: 244161
* [AST] ArrayRefize template param list info setters. No functionality change ↵Benjamin Kramer2015-08-051-22/+14
| | | | | | intended. llvm-svn: 244028
* [AST] ArrayRefize BlockDecl::setCaptures. No functionality change intended.Benjamin Kramer2015-08-051-17/+8
| | | | llvm-svn: 244027
* [AST] ArrayRefize template argument packs. No functionality change intended.Benjamin Kramer2015-08-057-20/+16
| | | | llvm-svn: 244026
* [AST] Really allocate a SmallVector to the right size.Benjamin Kramer2015-08-041-2/+1
| | | | | | | | | | set_size only resets the end pointer and asserts if it is used to grow the buffer. This would crash when mangling a float with more than 80 bits, add a test with a ppc double double (128 bits). Found by inspection. llvm-svn: 243979
* [AST] Simplify code by letting ArrayRef do the copying.Benjamin Kramer2015-08-041-10/+4
| | | | | | No functionality change intended. llvm-svn: 243974
* [ASTContext] Add a templated convenience wrapper for Allocate.Benjamin Kramer2015-08-041-1/+1
| | | | | | | | | This brings ASTContext closer to LLVM's Allocator concept. Ideally we would just derive ASTContext from llvm::AllocatorBase, but that does not work because ASTContext's allocator is mutable and we allocate using const ASTContext& everywhere. llvm-svn: 243972
* [AST] Use StringRef's convenient copy method. No functionality change.Benjamin Kramer2015-08-041-6/+1
| | | | llvm-svn: 243966
* [UB] When attaching empty strings to the AST, use an empty StringRefChandler Carruth2015-08-041-0/+2
| | | | | | | | rather than forcing the bump pointer allocator to produce a viable pointer. This also fixes UB when we would try to memcpy from the null incoming StringRef. llvm-svn: 243947
* [UB] Fix the two ways that we would try to memcpy from a null buffer inChandler Carruth2015-08-041-7/+9
| | | | | | | | | | | | | the nested name specifier code. First, skip the entire thing when the input is empty. Next, handle the case where we started off with a null buffer and a zero capacity to skip copying and freeing. This was found with UBSan. llvm-svn: 243946
* Additional fix for PR14269: Crash on vector elements / global register vars ↵Andrey Bokhanko2015-08-031-0/+12
| | | | | | | | | | in inline assembler. Compiler crashed when vector elements / global register vars were used in inline assembler with "m" restriction. This patch fixes this. Differential Revision: http://reviews.llvm.org/D10476 llvm-svn: 243870
* [MS ABI] Create a mangling for extended vector typesDavid Majnemer2015-08-011-7/+3
| | | | | | Extended vector types are mangled just like normal vector types. llvm-svn: 243828
* [OPENMP 4.1] Initial support for extended 'ordered' clause.Alexey Bataev2015-07-302-2/+10
| | | | | | | | OpenMP 4.1 introduces optional argument '(n)' for 'ordered' clause, where 'n' is a number of loops that immediately follow the directive. 'n' must be constant positive integer expressions and it must be less or equal than the number of the loops in the resulting loop nest. Patch adds parsing and semantic analysis for this optional argument. llvm-svn: 243635
* [CodeGen] Simplify creation of shuffle masks.Benjamin Kramer2015-07-281-1/+1
| | | | | | No functional change intended. llvm-svn: 243439
* [modules] Add an assert for redeclarations that we never added to their redeclRichard Smith2015-07-271-30/+19
| | | | | | | | | | | | | | | chain and fix the cases where it fires. * Handle the __va_list_tag as a predefined decl. Previously we failed to merge sometimes it because it's not visible to name lookup. (In passing, remove redundant __va_list_tag typedefs that we were creating for some ABIs. These didn't affect the mangling or representation of the type.) * For Decls derived from Redeclarable that are not in fact redeclarable (implicit params, function params, ObjC type parameters), remove them from the list of expected redeclarable decls. llvm-svn: 243259
* [AST] It should be impossible to get Int128 or UInt128 into VisitIntegerLiteralDavid Majnemer2015-07-261-2/+0
| | | | | | These cases should now be impossible as of r243243. llvm-svn: 243252
* [AST] Rename RecordLayoutBuilder to ItaniumRecordLayoutBuilderDavid Majnemer2015-07-251-141/+119
| | | | | | | RecordLayoutBuilder is an inaccruate name because it does not build all records. It only builds layouts for targets using the Itanium C++ ABI. llvm-svn: 243225
* [VTableBuilder] Use range-based for loops. No functional change intendedBenjamin Kramer2015-07-251-146/+96
| | | | llvm-svn: 243222
* [VTableBuilder] Turn functors into lambdasBenjamin Kramer2015-07-251-34/+24
| | | | | | No functional change intended. llvm-svn: 243221
* Capture 'this' so GCC 4.7 can find a static members.Benjamin Kramer2015-07-251-4/+6
| | | | llvm-svn: 243218
* [AST] Turn the callbacks of lookupInBases and forallBases into a function_refBenjamin Kramer2015-07-253-52/+41
| | | | | | | | | This lets us pass functors (and lambdas) without void * tricks. On the downside we can't pass CXXRecordDecl's Find* members (which are now type safe) to lookupInBases directly, but a lambda trampoline is a small price to pay. No functionality change intended. llvm-svn: 243217
* [AST] Perform additional canonicalization for DependentSizedArrayTypeDavid Majnemer2015-07-241-3/+4
| | | | | | | | | | We treated DependentSizedArrayTypes with the same element type but differing size expressions as equivalently canonical. This would lead to bizarre behavior during template instantiation. This fixes PR24212. llvm-svn: 243093
* Commit for http://reviews.llvm.org/D10765Michael Wong2015-07-213-0/+33
| | | | | | | for OpenMP 4 target data directive parsing and sema. This commit is on behalf of Kelvin Li. llvm-svn: 242785
* Remove two unused includes, part 2...Nico Weber2015-07-191-1/+0
| | | | llvm-svn: 242649
* [AST] Remove StmtRange in favor of an iterator_range.Benjamin Kramer2015-07-183-10/+7
| | | | | | | | | StmtRange was just a convenient wrapper for two StmtIterators before we had real range support. This removes some of the implicit conversions StmtRange had leading to slightly more verbose code but also should make more obvious what's going on. No functional change intended. llvm-svn: 242615
* [AST] Cleanup ExprIterator.Benjamin Kramer2015-07-182-14/+1
| | | | | | | | - Make it a proper random access iterator with a little help from iterator_adaptor_base - Clean up users of magic dereferencing. The iterator should behave like an Expr **. - Make it an implementation detail of Stmt. This allows inlining of the assertions. llvm-svn: 242608
* [MS ABI] Explicit specialization of static data members are weakDavid Majnemer2015-07-171-1/+5
| | | | | | | | | | | | | Normally, explicit specializations are treated like strong external definitions. However, MSVC treats explicit specializations of static data members as weak. MSVC 2013's <regex> implementation has such an explicit specialization which leads to clang emitting a strong definition in each translation unit which includes it. Tweak clang's linkage calculation to give such entities GVA_StrongODR linkage instead. This fixes PR24165. llvm-svn: 242592
* Fix alignment issues in Clang.James Y Knight2015-07-175-18/+45
| | | | | | | | | | | | | | | | | Some const-correctness changes snuck in here too, since they were in the area of code I was modifying. This seems to make Clang actually work without Bus Error on 32bit-sparc. Follow-up patches will factor out a trailing-object helper class, to make classes using the idiom of appending objects to other objects easier to understand, and to ensure (with static_assert) that required alignment guarantees continue to hold. Differential Revision: http://reviews.llvm.org/D10272 llvm-svn: 242554
* PR10405 - Desugar FunctionType and TemplateSpecializationType if any type ↵Nikola Smiljanic2015-07-161-4/+56
| | | | | | that appears inside needs to be desugared. llvm-svn: 242371
OpenPOWER on IntegriCloud