summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Replace double-negated !SourceLocation.isInvalid() with ↵Yaron Keren2015-10-031-1/+1
| | | | | | SourceLocation.isValid(). llvm-svn: 249228
* Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h intoJames Y Knight2015-10-026-1258/+1334
| | | | | | | | | | | their associated .cpp file. Previous refactorings long long ago had split out the above categories of classes from Stmt.h into their own header files, but failed to also split the Stmt.cpp implementation file similarly. Do so for readability's sake. llvm-svn: 249131
* Don't adjust field offsets when using external record layout.Zachary Turner2015-10-011-4/+11
| | | | | | | | | | | This was already being done when injecting the VBPtr, but not when injecting the VFPtr. This fixes a number of tests in LLDB's test suite. Reviewed by: David Majnemer Differential Revision: http://reviews.llvm.org/D13276 llvm-svn: 249085
* Perform Objective-C lifetime adjustments before comparing deduced lambda ↵Douglas Gregor2015-10-011-8/+17
| | | | | | | | | | result types. Objective-C ARC lifetime qualifiers are dropped when canonicalizing function types. Perform the same adjustment before comparing the deduced result types of lambdas. Fixes rdar://problem/22344904. llvm-svn: 249065
* Fix printing of parameterized Objective-C interfaces.Bob Wilson2015-10-011-1/+1
| | | | | | This change was accidentally omitted from Doug's change in r241541. llvm-svn: 248975
* [OpenCL 2.0] Enable program scope variables, Section 6.5.1.Anastasia Stulova2015-09-302-2/+1
| | | | | | | | | | | | | | | | | | - Remove virtual SC_OpenCLWorkGroupLocal storage type specifier as it conflicts with static local variables now and prevents diagnosing static local address space variables correctly. - Allow static local and global variables (OpenCL2.0 s6.8 and s6.5.1). - Improve diagnostics of allowed ASes for variables in different scopes: (i) Global or static local variables have to be in global or constant ASes (OpenCL1.2 s6.5, OpenCL2.0 s6.5.1); (ii) Non-kernel function variables can't be declared in local or constant ASes (OpenCL1.1 s6.5.2 and s6.5.3). http://reviews.llvm.org/D13105 llvm-svn: 248906
* Fix FunctionParmPackExpr::Create() to take a ParmVarDecl* array.James Y Knight2015-09-301-6/+6
| | | | | | | | | | | | FunctionParmPackExpr actually stores an array of ParmVarDecl* (and accessors return that). But, the FunctionParmPackExpr::Create() constructor accepted an array of Decl *s instead. It was easy for this mismatch to occur without any obvious sign of something wrong, since both the store and the access used independent 'reinterpet_cast<XX>(this+1)' calls. llvm-svn: 248905
* [OPENMP 4.1] Sema analysis for array sections in 'reduction' clause.Alexey Bataev2015-09-301-0/+23
| | | | | | OpenMP 4.1 allows to use array sections|subscript expressions in 'reduction' clauses. Added sema analysis, updated tests. llvm-svn: 248880
* Move functions declared in ExprObjC.h into ExprObjC.cpp.James Y Knight2015-09-293-402/+380
| | | | | | | | r51703 back in 2008 split out all the ObjC Expr subclasses from Expr.h to a new ExprObjC.h file, but failed to also split the implementation from Expr.cpp to ExprObjC.cpp. Do so, finally, for readability's sake. llvm-svn: 248836
* Pass ArrayRef by value. NFC.Craig Topper2015-09-291-1/+1
| | | | llvm-svn: 248773
* [OPENMP 4.1] Add 'simd' clause for 'ordered' directive.Alexey Bataev2015-09-282-0/+4
| | | | | | | | | | | Parsing and sema analysis for 'simd' clause in 'ordered' directive. Description If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered regions in the order of the loop iterations. Restrictions An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region llvm-svn: 248696
* Use llvm::makeArrayRef. NFC.Craig Topper2015-09-271-1/+1
| | | | llvm-svn: 248678
* Revert part of r248660 as using None didn't work with the ArrayRef being ↵Craig Topper2015-09-261-2/+2
| | | | | | returned as an Optional. llvm-svn: 248661
* Use None to avoid re-mentioning the ArrayRef type to call the default ↵Craig Topper2015-09-261-2/+2
| | | | | | constructor. llvm-svn: 248660
* [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.Alexey Bataev2015-09-253-7/+19
| | | | | | | | OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'. If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations. The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive. llvm-svn: 248569
* Module Debugging: Emit submodules as nested DW_TAG_modules.Adrian Prantl2015-09-241-2/+2
| | | | llvm-svn: 248511
* Refactor ASTSourceDescriptor to not store copies of all strings. (NFC)Adrian Prantl2015-09-241-1/+8
| | | | llvm-svn: 248509
* Forbid qualifiers on ObjC generic parameters and arguments, butJohn McCall2015-09-232-0/+62
| | | | | | | | | | | | | | silently ignore them on arguments when they're provided indirectly (.e.g behind a template argument or typedef). This is mostly just good language design --- specifying that a generic argument is __weak doesn't actually do anything --- but it also prevents assertions when trying to apply a different ownership qualifier. rdar://21612439 llvm-svn: 248436
* PR14858: Initial support for proper sizeof... handling within alias templates.Richard Smith2015-09-234-1/+40
| | | | | | | This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
* [CUDA] __global__ functions should always be visible externally.Artem Belevich2015-09-231-6/+6
| | | | | | | | | Adjust __global__ functions with DiscardableODR linkage to use StrongODR linkage instead, so they are visible externally. Differential Revision: http://reviews.llvm.org/D13067 llvm-svn: 248400
* [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
OpenPOWER on IntegriCloud