summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Add some std::move where the value is only read otherwise.Benjamin Kramer2016-06-121-1/+1
| | | | | | This mostly affects smart pointers. No functionality change intended. llvm-svn: 272520
* Revert "[ASTMatchers] New forEachOverriden matcher."Chandler Carruth2016-06-112-19/+9
| | | | | | | This reverts commit r272386. It doesn't compile with MSVC and those bots have been red the entire day as a consequence. llvm-svn: 272453
* [ASTMatchers] New forEachOverriden matcher.Clement Courbet2016-06-102-9/+19
| | | | | | Matches methods overridden by the given method. llvm-svn: 272386
* Check for null pointers before calling the Stmt ProfilerRichard Trieu2016-06-101-31/+63
| | | | | | | | | Some calls from OMPClauseProfiler were calling the Stmt Profiler with null pointers, but the profiler can only handle non-null pointers. Add an assert to the VisitStmt for valid pointers, and check all calls from OMPClauseProfiler to be non-null pointers. llvm-svn: 272368
* Remove CXXConstructExpr::getFoundDecl(); it turned out to not be useful.Richard Smith2016-06-102-19/+4
| | | | llvm-svn: 272357
* Fix a crash in the AST dumper.Richard Trieu2016-06-091-2/+4
| | | | | | | Boxed expressions in a template context may have a null method decl. If so, don't try to access the selector. llvm-svn: 272318
* Revert "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-092-11/+2
| | | | | | | | | MaterializeTemporaryExpr." This reverts r272296, since there are clang-tidy failures that appear to be caused by this change. llvm-svn: 272310
* [Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr.Tim Shen2016-06-092-2/+11
| | | | | | | | | | | These ExprWithCleanups are added for holding a RunCleanupsScope not for destructor calls; rather, they are for lifetime marks. This requires ExprWithCleanups to keep a bit to indicate whether it have cleanups with side effects (e.g. dtor calls). Differential Revision: http://reviews.llvm.org/D20498 llvm-svn: 272296
* [ItaniumMangle] Mangle dependent __underlying_type correctlyDavid Majnemer2016-06-081-1/+1
| | | | | | | | | | We attempted to use the UnaryTransformType's UnderlyingType instead of it's BaseType. This is not correct for dependent UnaryTransformType because the have no underlying type. This fixes PR28045. llvm-svn: 272079
* [OPENCL] Fix wrongly vla error for OpenCL array.Xiuli Pan2016-06-071-1/+4
| | | | | | | | | | | | | | | | | Summary: OpenCL should support array with const value size length, those const varibale in global and constant address space and variable in constant address space. Fixed test case error. Reviewers: Anastasia, yaxunl, bader Subscribers: bader, cfe-commits Differential Revision: http://reviews.llvm.org/D20090 llvm-svn: 271978
* Revert "[OPENCL] Fix wrongly vla error for OpenCL array."Xiuli Pan2016-06-071-4/+1
| | | | | | | | Test case break on system-z. This reverts commit 9a7212e1e87f1396952d74f8c62314a775ccbb1c. llvm-svn: 271975
* [OPENCL] Fix wrongly vla error for OpenCL array.Xiuli Pan2016-06-071-1/+4
| | | | | | | | | | | | | Summary: OpenCL should support array with const value size length, those const varibale in global and constant address space and variable in constant address space. Reviewers: Anastasia, yaxunl, bader Subscribers: bader, cfe-commits Differential Revision: http://reviews.llvm.org/D20090 llvm-svn: 271971
* Sema: do not attempt to sizeof a dependent typeSaleem Abdulrasool2016-06-041-0/+5
| | | | | | | | | We would attempt to evaluate the sizeof a dependent type to check for an integral overflow. However, because the dependent type is not yet resolved, we cannot determine if the expression would overflow. Report a failure to perform a symbolic evaluation of a constant involving the dependent type. llvm-svn: 271762
* PR27989: only enqueue binary operators into the data recursive int expressionRichard Smith2016-06-041-1/+3
| | | | | | evaluator if they are actually int expressions. llvm-svn: 271754
* [MSVC2015] Fix mangling for static variables initialization guardsDmitry Polukhin2016-05-271-0/+1
| | | | | | | | | It seems that suffix '@4HA' was omitted for unknown reason. It is non-cont non-volatile 'int' type of normal variable TSS. Differential revision: http://reviews.llvm.org/D20683 llvm-svn: 270974
* [OpenMP] Parsing and sema support for the from clauseSamuel Antao2016-05-263-0/+62
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `from` clause. Patch based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18488 llvm-svn: 270882
* [OpenMP] Parsing and sema support for the to clauseSamuel Antao2016-05-263-0/+62
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `to` clause. Patch based on the original post by Kelvin Li. Reviewers: carlo.bertolli, hfinkel, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18597 llvm-svn: 270880
* [OpenMP] Parsing and sema support for target update directiveSamuel Antao2016-05-263-0/+33
| | | | | | | | | | | | | | | Summary: This patch is to add parsing and sema support for `target update` directive. Support for the `to` and `from` clauses will be added by a different patch. This patch also adds support for other clauses that are already implemented upstream and apply to `target update`, e.g. `device` and `if`. This patch is based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D15944 llvm-svn: 270878
* [MSVC] Support for __unaligned qualifier in functionsAndrey Bokhanko2016-05-262-3/+4
| | | | | | | | | | | | | | | This implements support for MS-specific __unaligned qualifier in functions and makes the following test case both compile and mangle correctly: struct S { void f() __unaligned; }; void S::f() __unaligned { } Differential Revision: http://reviews.llvm.org/D20437 llvm-svn: 270834
* [ObjC] Remove _Atomic from return type and parameter type ofAkira Hatanaka2016-05-261-0/+6
| | | | | | | | | | | | | | objective-c properties. This fixes an assert in CodeGen that fires when the getter and setter functions for an objective-c property of type _Atomic(_Bool) are synthesized. rdar://problem/26322972 Differential Revision: http://reviews.llvm.org/D20407 llvm-svn: 270808
* [Sema] Use the failure bits introduced by r270781.George Burgess IV2016-05-251-17/+17
| | | | | | | | | | r270781 introduced the ability to track whether or not we might have had unmodeled side-effects during constant expression evaluation. This patch makes the constexpr evaluator use that tracking. Reviewed as a part of D18540. llvm-svn: 270784
* [Sema] Note when we encounter a problem in ExprConstant.George Burgess IV2016-05-251-33/+106
| | | | | | | | | | | | | | | | | | | | Currently, the constexpr evaluator is very conservative about unmodeled side-effects when we're evaluating an expression in a mode that allows such side-effects. This patch makes us note when we might have actually encountered an unmodeled side-effect, which allows us to be more accurate when we know an unmodeled side-effect couldn't have occurred. This patch has been split into two commits; this one primarily introduces the bits necessary to track whether we might have potentially hit such a side-effect. The one that actually does the tracking (which boils down to more or less a rename of keepEvaluatingAfterFailure to noteFailure) is coming soon. Differential Revision: http://reviews.llvm.org/D18540 llvm-svn: 270781
* Fix rejects-valid on constexpr function that accesses a not-yet-defined 'externRichard Smith2016-05-251-3/+8
| | | | | | | const' variable. That variable might be defined as 'constexpr', so we cannot prove that a use of it could never be a constant expression. llvm-svn: 270774
* Fix mangled name of method with ns_consumed parameters.Nico Weber2016-05-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | When a function/method use a parameter with "ns_consumed" attribute, ensure that the mangled name is the same whether -fobjc-arc is used or not. Since "ns_consumed" attribute is generally used to inform ARC that a function/method does sink the reference, it mean it is usually implemented in a compilation unit compiled without -fobjc-arc but used form a compilation unit compiled with it. Originally found while trying to use "ns_consumed" attribute in an Objective-C++ file in Chromium (http://crbug.com/599980) where it caused a linker error. Regression introduced by revision 262278 (previously the attribute was incorrectly not part of the mangled name). Patch from Sylvain Defresne <sdefresne@chromium.org>! http://reviews.llvm.org/D20113 llvm-svn: 270702
* Fix build problem in MSVCAlexey Bataev2016-05-251-4/+1
| | | | llvm-svn: 270693
* [OPENMP 4.5] Codegen for dacross loop synchronization constructs.Alexey Bataev2016-05-252-8/+39
| | | | | | | OpenMP 4.5 adds support for doacross loop synchronization. Patch implements codegen for this construct. llvm-svn: 270690
* [RecordLayout] Use an ASTVector instead of using a separate pointer and counterDavid Majnemer2016-05-242-32/+15
| | | | | | No functional change is intended. llvm-svn: 270591
* [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)David Majnemer2016-05-232-18/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The layout_version attribute is pretty straightforward: use the layout rules from version XYZ of MSVC when used like struct __declspec(layout_version(XYZ)) S {}; The empty_bases attribute is more interesting. It tries to get the C++ empty base optimization to fire more often by tweaking the MSVC ABI rules in subtle ways: 1. Disable the leading and trailing zero-sized object flags if a class is marked __declspec(empty_bases) and is empty. This means that given: struct __declspec(empty_bases) A {}; struct __declspec(empty_bases) B {}; struct C : A, B {}; 'C' will have size 1 and nvsize 0 despite not being annotated __declspec(empty_bases). 2. When laying out virtual or non-virtual bases, disable the injection of padding between classes if the most derived class is marked __declspec(empty_bases). This means that given: struct A {}; struct B {}; struct __declspec(empty_bases) C : A, B {}; 'C' will have size 1 and nvsize 0. 3. When calculating the offset of a non-virtual base, choose offset zero if the most derived class is marked __declspec(empty_bases) and the base is empty _and_ has an nvsize of 0. Because of the ABI rules, this does not mean that empty bases reliably get placed at offset 0! For example: struct A {}; struct B {}; struct __declspec(empty_bases) C : A, B { virtual ~C(); }; 'C' will be pointer sized to account for the vfptr at offset 0. 'A' and 'B' will _not_ be at offset 0 despite being empty! Instead, they will be located right after the vfptr. This occurs due to the interaction betweeen non-virtual base layout and virtual function pointer injection: injection occurs after the nv-bases and shifts them down by the size of a pointer. llvm-svn: 270457
* [AST] Cleanup comments regarding CXXRecordDecl::isEmptyDavid Majnemer2016-05-221-8/+11
| | | | | | | | | We were missing references to the standard, some of our home-grown verbiage didn't make any sense. No functional change is intended. llvm-svn: 270353
* [MS ABI] Ignore transparent contexts when determining the effective contextDavid Majnemer2016-05-191-1/+1
| | | | | | | We didn't skip over extern "C++" contexts, causing us to mangle things which don't need to be mangled. llvm-svn: 270089
* Fix PR27601 by reverting [r267453] - Refactor traversal of bases in ↵Faisal Vali2016-05-191-9/+6
| | | | | | | | | | | | deduction of template parameters from base This reversal is being done with r267453's author's (i.e. Richard Smith's) permission. This fixes https://llvm.org/bugs/show_bug.cgi?id=27601 Also, per Richard's request the examples from the bug report have been added to our test suite. llvm-svn: 270016
* Make Sema::getPrintingPolicy less ridiculously expensive. This used to performRichard Smith2016-05-193-33/+22
| | | | | | | | | | an identifier table lookup, *and* copy the LangOptions (including various std::vector<std::string>s). Twice. We call this function once each time we start parsing a declaration specifier sequence, and once for each call to Sema::Diag. This reduces the compile time for a sample .c file from the linux kernel by 20%. llvm-svn: 270009
* Support for MSVS default calling convention options (/Gd, /Gz, /Gv,Alexey Bataev2016-05-181-2/+19
| | | | | | | | | /Gr), by Alexander Makarov Patch for bug #27711 Differential Revision: http://reviews.llvm.org/D20171 llvm-svn: 269891
* PR27754: CXXRecordDecl::data() needs to perform an update even if it's calledRichard Smith2016-05-171-1/+1
| | | | | | on a declaration that already knows the location of the DefinitionData object. llvm-svn: 269858
* Avoid O(n^2) string analysis when handling GNU __asm__ statements.Richard Smith2016-05-161-8/+15
| | | | llvm-svn: 269716
* Added support to the ASTImporter for C++ constructor initializers.Sean Callanan2016-05-161-2/+133
| | | | | | | | | Also added named casts and propagation of "implicit" to fix the LLDB testsuite. This is a fixed commit of r269546, which was reverted by r269575. Thanks to Aleksei Sidorin for review and advice. llvm-svn: 269693
* Revert r269546 "Added support to the ASTImporter for C++ constructor ↵Oleksiy Vyalov2016-05-141-82/+0
| | | | | | initializers." as it breaks TestDataFormatterSynthVal.DataFormatterSynthValueTestCase.test_with_run_command_dwarf test - http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/14699 llvm-svn: 269575
* Fixed a bug where the ASTImporter didn't propagate builtin IDs at all.Sean Callanan2016-05-141-1/+6
| | | | | | | | | | | IdentifierInfos are assigned builtin IDs during parsing, but Idents.get() does not do that work. So the ASTImporter needs to additionally set the builtin ID for the newly-created IdentifierInfo. This patch does that. Currently ASTMerge tests only check syntax and the ASTMatchers don't check for builtin IDs, so this is tricky to test, but LLDB will have a test for this. llvm-svn: 269553
* Handle injected class names in the ASTImporter.Sean Callanan2016-05-141-2/+11
| | | | | | | | | | | | | | | | | | Every class as parsed by Clang has a forward declaration of itself as a member: class A { class A; ... } but when the parser generates this it ensures that the RecordTypes for the two are the same. This makes (among other things) inheritance work. This patch fixes a bug where the ASTImporter generated two separate RecordTypes when importing the class and the contained forward declaration, and adds a test case. Thanks to Doug Gregor for advice on this. llvm-svn: 269551
* Added support to the ASTImporter for C++ constructor initializers.Sean Callanan2016-05-141-0/+82
| | | | | | Thanks to Aleksei Sidorin for review and advice. llvm-svn: 269546
* [AST] Add missing const qualifiers to AstContext in Type.cppEtienne Bergeron2016-05-131-9/+9
| | | | | | | | | | | | | | | | Summary: Add some missing const qualifiers to AstContext. The ASTContext can't be modified with accessors. There is no behavior change. This patch is cleanup only. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20226 llvm-svn: 269418
* Add support for derived class special members hiding functions brought in fromRichard Smith2016-05-132-0/+12
| | | | | | | | | a base class via a using-declaration. If a class has a using-declaration declaring either a constructor or an assignment operator, eagerly declare its special members in case they need to displace a shadow declaration from a using-declaration. llvm-svn: 269398
* Refactor constant expression evaluation of CXXConstructExpr to reduce ↵Richard Smith2016-05-121-35/+18
| | | | | | duplication between array and class initialization. llvm-svn: 269367
* [AST] Move operations enum to a definition file.Etienne Bergeron2016-05-121-160/+6
| | | | | | | | | | | | | | | | | | | Summary: This patch moves the enum definitions to a definition (.def) file. These modifications provide way to list enumerators of a given type. As an example, this allow parsing of "kinds" in the dynamic matchers. see: http://reviews.llvm.org/D19871 The dynamic matcher "ofKind" also required this patch to be fixed. Reviewers: klimek, aaron.ballman, rsmith Subscribers: klimek, sbenza, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D20207 llvm-svn: 269347
* Preserve the FoundDecl when performing overload resolution for constructors.Richard Smith2016-05-112-18/+35
| | | | | | | | | This is in preparation for C++ P0136R1, which switches the model for inheriting constructors over from synthesizing a constructor to finding base class constructors (via using shadow decls) when looking for derived class constructors. llvm-svn: 269231
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-112-0/+11
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367 and PR27666. Differential Revision: http://reviews.llvm.org/D20103 llvm-svn: 269220
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-097-17/+35
| | | | | | | | | | | | | | | | | | This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled. llvm-svn: 268898
* ObjC kindof: set the type of a conditional expression when involving kindof.Manman Ren2016-05-061-4/+13
| | | | | | | | When either LHS or RHS is a kindof type, we return a kindof type. rdar://problem/20513780 llvm-svn: 268781
* Revert r268727, it caused PR27666.Nico Weber2016-05-062-11/+0
| | | | llvm-svn: 268736
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-062-0/+11
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367. Differential Revision: http://reviews.llvm.org/D19654 llvm-svn: 268727
OpenPOWER on IntegriCloud