summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* assert(false) -> llvm_unreachable().Davide Italiano2016-01-302-2/+2
| | | | llvm-svn: 259302
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-295-5/+5
| | | | | | r259192 post commit comment. llvm-svn: 259232
* Implement TemplateArgument::dump() method for debugging, patterned after ↵Yaron Keren2016-01-291-0/+9
| | | | | | TemplateName::dump(). llvm-svn: 259192
* Class Property: change PropertyMap to include isClassProperty.Manman Ren2016-01-281-6/+8
| | | | | | | | | | | | | | PropertyMap used to map IdentifierInfo (name of the property) to ObjcPropertyDecl *. Now that a class property can have the same name as an instance property, we change PropertyMap to map a pair <IdentifierInfo *, unsigned> to ObjcPropertyDecl *. Also update a few places from iterating over instance_properties to iterating over all properties. rdar://23891898 llvm-svn: 259119
* Class Property: class property and instance property can have the same name.Manman Ren2016-01-282-19/+67
| | | | | | | | | | | | | | | | | | | Add "enum ObjCPropertyQueryKind" to a few APIs that used to only take the name of the property: ObjCPropertyDecl::findPropertyDecl, ObjCContainerDecl::FindPropertyDeclaration, ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass, ObjCImplDecl::FindPropertyImplDecl, and Sema::ActOnPropertyImplDecl. ObjCPropertyQueryKind currently has 3 values: OBJC_PR_query_unknown, OBJC_PR_query_instance, OBJC_PR_query_class This extra parameter specifies that we are looking for an instance property with the given name, or a class property with the given name, or any property with the given name (if both exist, the instance property will be returned). rdar://23891898 llvm-svn: 259070
* Class Property: handle class properties.Manman Ren2016-01-271-2/+2
| | | | | | | | At places where we handle instance properties, if necessary. rdar://23891898 llvm-svn: 258979
* Remove autoconf supportChris Bieneman2016-01-261-18/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* Class Property: parse property attribute (class).Manman Ren2016-01-262-0/+7
| | | | | | | | | This is the third patch in a series of patches to support class properties in addition to instance properties in objective-c. rdar://23891898 llvm-svn: 258834
* [OpenMP] Parsing + sema for target parallel directive.Arpith Chacko Jacob2016-01-263-0/+35
| | | | | | | | | | | | | Summary: This patch adds parsing + sema for the target parallel directive and its clauses along with testcases. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16553 Rebased to current trunk and updated test cases. llvm-svn: 258832
* Use instance_properties instead of properties. NFC.Manman Ren2016-01-261-6/+6
| | | | | | | | | | | All current properties are instance properties. This is the second patch in a series of patches to support class properties in addition to instance properties in objective-c. rdar://23891898 llvm-svn: 258824
* [OpenMP] Parsing + sema for defaultmap clause.Arpith Chacko Jacob2016-01-262-0/+12
| | | | | | | | | | | Summary: This patch adds parsing + sema for the defaultmap clause associated with the target directive (among others). Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16527 llvm-svn: 258817
* [MS Compat] Don't crash if __GetExceptionInfo is in global scopeDavid Majnemer2016-01-261-2/+1
| | | | | | | | | | | __GetExceptionInfo triggered Sema::LazilyCreateBuiltin which tries to create a non-templated function decl. This is unnecessary and ill-advised, there is no need for us to create a declaration for such a builtin. This fixes PR26298. llvm-svn: 258762
* Fix printing of types in initializers with suppressed tags.Benjamin Kramer2016-01-251-1/+4
| | | | | | | | | | | | | | | | | | Tag and specifier printing can be suppressed in Decl::printGroup, but these suppressions leak into the initializers. Thus int *x = ((void *)0), *y = ((void *)0); gets printed as int *x = ((void *)0), *y = ((*)0); And struct { struct Z z; } z = {(struct Z){}}; gets printed as struct { struct Z z; } z = {(){}}; The stops the suppressions from leaking into the initializers. Patch by Nick Sumner! Differential Revision: http://reviews.llvm.org/D16438 llvm-svn: 258679
* [OpenMP] Detect implicit map type to report unspecified map type for target ↵Samuel Antao2016-01-191-2/+4
| | | | | | | | | | | | | | | | | | | | enter/exit data directives. Support for the following OpenMP 4.5 restriction on 'target enter data' and 'target exit data': - A map-type must be specified in all map clauses. I have to save 'IsMapTypeImplicit' when parsing a map clause to support this constraint and for more informative error messages. This helps me support the following case: #pragma omp target enter data map(r) // expected-error {{map type must be specified for '#pragma omp target enter data'}} and distinguish it from: #pragma omp target enter data map(tofrom: r) // expected-error {{map type 'tofrom' is not allowed for '#pragma omp target enter data'}} Patch by Arpith Jacob. Thanks! llvm-svn: 258179
* [OpenMP] Parsing + sema for "target exit data" directive.Samuel Antao2016-01-193-0/+33
| | | | | | Patch by Arpith Jacob. Thanks! llvm-svn: 258177
* [OpenMP] Parsing + sema for "target enter data" directive.Samuel Antao2016-01-193-0/+32
| | | | | | Patch by Arpith Jacob. Thanks! llvm-svn: 258165
* [MS ABI] Don't crash while mangling recursive lambdasDavid Majnemer2016-01-171-4/+12
| | | | | | | | | | | | | | | We might get into bad situations where we try to embed the signature of an inner lambda into an outer lambda which cannot work: the inner lambda wants to embed the name of the outer lambda! Instead, omit the return type for lambdas. This fixes PR26105. N.B. While we are here, make lambdas nested within functions use an artificial scope so that they can get demangled. llvm-svn: 258003
* [libclang] Introduce APIs for evaluating a cursor and checking if a macro is ↵Argyrios Kyrtzidis2016-01-161-1/+1
| | | | | | | | builtin/function. rdar://24091595 llvm-svn: 257968
* Add OpenMP dist_schedule clause to distribute directive and related ↵Carlo Bertolli2016-01-152-0/+20
| | | | | | regression tests. llvm-svn: 257917
* Fix a -Wparentheses warning in ASTDiagnostic.cpp.James Y Knight2016-01-151-1/+1
| | | | llvm-svn: 257871
* Fixing more issues with template type diffingRichard Trieu2016-01-151-16/+20
| | | | | | | | | | | | 1) Print qualifiers for templates with zero arguments 2) Add a few more tests for the template type diffing refactoring. Specifically, PR24587 has been fixed and has a test case from http://reviews.llvm.org/D15384 3) Adds asserts to check the DiffTree is in correct state when moving nodes 4) Rename the field FromType and ToType since it is heavily used within member functions. llvm-svn: 257870
* Add new diff modes to template type diffing.Richard Trieu2016-01-151-8/+168
| | | | | | | | Remove an old assertion that does not hold. It is possible for a template argument to be a declaration in one instantiation and an integer in another. Create two new diff kinds for these (decl vs int and int vs decl). llvm-svn: 257869
* Save the integer type for integral template arguments.Richard Trieu2016-01-151-25/+64
| | | | | | | | | Save the integer type when diffing integers in template type diffing. When integers are different sizes, print out the type along with the integer value. Also with the type information, print true and false instead of 1 and 0 for boolean values. llvm-svn: 257861
* Make template type diffing use the new desguared iterator.Richard Trieu2016-01-151-322/+158
| | | | | | | | | | | | | If available, use the canonical template argument to fill in information for template type diffing instead of attempting to special case and evaluate Expr's for the value. Since those are the values used in template instantiation, we don't have to worry about difference between our evaluator and theirs. Also move the nullptr template arguments from DiffKind::Expression to DiffKind::Declaration and allow DiffKind::Declaration to set an Expr. The only effect that should result is that a named nullptr will show up as 'ptr aka nullptr' in diagnostics. llvm-svn: 257853
* [CUDA] Warn undeclared identifiers in CUDA kernel callsJustin Lebar2016-01-141-21/+32
| | | | | | | | | | | | | | | | | | Value, type, and instantiation dependence were not being handled correctly for CUDAKernelCallExpr AST nodes. As a result, if an undeclared identifier was used in the triple-angle-bracket kernel call configuration, there would be no error during parsing, and there would be a crash during code gen. This patch makes sure that an error will be issued during parsing in this case, just as there would be for any other use of an undeclared identifier in C++. Patch by Jason Henline. Reviewers: jlebar, rsmith Differential Revision: http://reviews.llvm.org/D15858 llvm-svn: 257839
* Change the TSTiterator in Template Type Diffing.Richard Trieu2016-01-141-80/+117
| | | | | | | | Modify the TSTiterator to have two internal iterators, which will walk the provided sugared type and the desugared type. This will provide better access to the template argument information. No functional changes. llvm-svn: 257838
* Refactor template type diffingRichard Trieu2016-01-141-226/+249
| | | | | | | | | | | | | | | 1) Instead of using pairs of From/To* fields, combine fields into a struct TemplateArgInfo and have two in each DiffNode. 2) Use default initialization in DiffNode so that the constructor shows the only field that is initialized differently on construction. 3) Use Set and Get functions per each DiffKind to make sure all fields for the diff is set. In one case, the Expr fields were not set. 4) Don't print boolean literals for boolean template arguments. This prevents printing 'false aka 0' Only #3 has a functional change, which is reflected in the test change. llvm-svn: 257831
* Update for LLVM function name change.Rui Ueyama2016-01-148-167/+160
| | | | llvm-svn: 257802
* [Bugfix] Fix ICE on constexpr vector splat.George Burgess IV2016-01-132-1/+9
| | | | | | | | | | | | | In {CG,}ExprConstant.cpp, we weren't treating vector splats properly. This patch makes us treat splats more properly. Additionally, this patch adds a new cast kind which allows a bool->int cast to result in -1 or 0, instead of 1 or 0 (for true and false, respectively), so we can sanely model OpenCL bool->int casts in the AST. Differential Revision: http://reviews.llvm.org/D14877 llvm-svn: 257559
* Improve AST dumping:Richard Smith2016-01-121-0/+4
| | | | | | | | 1) When dumping a declaration that declares a name for a type, also dump the named type. 2) Add a #pragma clang __debug dump X, that dumps the lookup results for X in the current context. llvm-svn: 257529
* PR18513: make gcc compatible layout for bit-fields with explicit aligned ↵Alexey Bataev2016-01-121-1/+9
| | | | | | | | | attribute, by Dmitry Polukhin Fix binary compatibility issue with GCC. Differential Revision: http://reviews.llvm.org/D14980 llvm-svn: 257462
* Fix infinite recursion for invalid declaration, by Dmitry PolukhinAlexey Bataev2016-01-121-1/+1
| | | | | | | Fix for a case found by fuzzing PR23057 (comment #25 https://llvm.org/bugs/show_bug.cgi?id=23057#c25). Differential Revision: http://reviews.llvm.org/D16065 llvm-svn: 257461
* [OpenCL] Pipe type supportXiuli Pan2016-01-096-0/+93
| | | | | | | | | | | | | | | Summary: Support for OpenCL 2.0 pipe type. This is a bug-fix version for bader's patch reviews.llvm.org/D14441 Reviewers: pekka.jaaskelainen, Anastasia Subscribers: bader, Anastasia, cfe-commits Differential Revision: http://reviews.llvm.org/D15603 llvm-svn: 257254
* Test CommitXiuli Pan2016-01-091-1/+1
| | | | | | Fix a typo llvm-svn: 257252
* Properly track that a character literal is UTF-8, and pretty print the ↵Aaron Ballman2016-01-071-0/+1
| | | | | | prefix properly. llvm-svn: 257097
* PR26048, PR26050: put non-type template parameters and indirect field declsRichard Smith2016-01-062-3/+18
| | | | | | | | into IDNS_Tag in C++, because they conflict with redeclarations of tags. (This doesn't affect elaborated-type-specifier lookup, which looks for IDNS_Type in C++). llvm-svn: 256985
* Only instantiate a default argument once.John McCall2016-01-061-8/+0
| | | | | | | | | | | | | | | | | | | By storing the instantiated expression back in the ParmVarDecl, we remove the last need for separately storing the sub-expression of a CXXDefaultArgExpr. This makes PCH/Modules merging quite simple: CXXDefaultArgExpr records are serialized as references to the ParmVarDecl, and we ignore redundant attempts to overwrite the instantiated expression. This has some extremely marginal impact on user-facing semantics. However, the major effect is that it avoids IRGen errors about conflicting definitions due to lambdas in the argument being instantiated multiple times while sharing the same mangling. It should also slightly improve memory usage and module file size. rdar://23810407 llvm-svn: 256983
* ArrayRef-ize a function. NFCCraig Topper2016-01-031-6/+4
| | | | llvm-svn: 256718
* [TrailingObjects] Convert classes in OpenMPClause.hJames Y Knight2016-01-011-72/+24
| | | | llvm-svn: 256683
* [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h"James Y Knight2015-12-311-1/+2
| | | | | | (Detected by asan) llvm-svn: 256665
* [MS ABI] Remove mangleCXXCatchHandlerTypeDavid Majnemer2015-12-311-11/+0
| | | | | | It's dead code, no functional change is intended. llvm-svn: 256664
* [MS ABI] Change the ArgBackRefMap to hold const qualified pointersDavid Majnemer2015-12-311-2/+2
| | | | | | Just a cleanup, no functional change is intended. llvm-svn: 256663
* [MS ABI] Replace dead code with an assertionDavid Majnemer2015-12-311-2/+4
| | | | | | | As per C++ [dcl.ref]p1, cv-qualified references are not valid. As such, change the mangler to assert that this event does not happen. llvm-svn: 256662
* [TrailingObjects] Convert classes in ExprObjC.hJames Y Knight2015-12-311-31/+11
| | | | llvm-svn: 256659
* [TrailingObjects] Convert remaining classes in Expr.h and ExprCXX.hJames Y Knight2015-12-312-88/+59
| | | | llvm-svn: 256658
* Silencing a -Wcast-qual warning; NFC.Aaron Ballman2015-12-301-1/+1
| | | | llvm-svn: 256644
* [ptr-traits] Some compilers (older Clang? unsure) on build bots needChandler Carruth2015-12-301-0/+4
| | | | | | | | | this constructor to be out of line in order to not require the complete type of TemplateDecl. Hopefully this will fix the build bots. llvm-svn: 256629
* [MS ABI] Add variable templates to the NameBackReferencesDavid Majnemer2015-12-301-1/+1
| | | | | | | | Only function template specializations are exempt from being added to the NameBackReferences. Redundant variable template specializations should be appropriately substituted. llvm-svn: 256623
* [MS ABI] Improve our mangling of pass_object_sizeDavid Majnemer2015-12-301-4/+30
| | | | | | | | | | | | | | We didn't add the artificial pass_object_size arguments to the backreference map which bloated the size of manglings which involved pass_object_size with duplicate types. This lets us go from: ?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@0W4__pass_object_size1@3@@Z to: ?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@01@Z llvm-svn: 256622
* [ptr-traits] Add #includes of headers rather than forward declarationsChandler Carruth2015-12-301-0/+1
| | | | | | | | | | | | | | for types which are used as pointees in PointerUnions, PointerIntPairs, and DenseMap pointer keys. This is part of a series of patches to allow LLVM to check for complete pointee types when computing its pointer traits. This is absolutely necessary to get correct (or reproducible) results for things like how many low bits are guaranteed to be zero. I think this is the last patch for getting Clang clean here!!! llvm-svn: 256615
OpenPOWER on IntegriCloud