summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Fix for bug http://llvm.org/PR17427.Alexey Bataev2014-10-094-37/+57
| | | | | | | | Assertion failed: "Computed __func__ length differs from type!" Reworked PredefinedExpr representation with internal StringLiteral field for function declaration. Differential Revision: http://reviews.llvm.org/D5365 llvm-svn: 219393
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-093-0/+35
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219385
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-082-13/+31
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219306
* Revert commit r219297.Alexey Bataev2014-10-082-31/+13
| | | | | | Still troubles with OpenMP/parallel_firstprivate_codegen.cpp (now in ARM buildbots). llvm-svn: 219298
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-082-13/+31
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219297
* Revert back r219295.Alexey Bataev2014-10-082-31/+13
| | | | | | To fix issues with test OpenMP/parallel_firstprivate_codegen.cpp llvm-svn: 219296
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-082-13/+31
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219295
* Revert "[OPENMP] 'omp teams' directive basic support. Includes parsing and ↵Renato Golin2014-10-083-35/+0
| | | | | | | | | semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive." This reverts commit r219197 because it broke ARM self-hosting buildbots with segmentation fault errors in many tests. llvm-svn: 219289
* AST: Fix a typo (NFC)Justin Bogner2014-10-081-1/+1
| | | | llvm-svn: 219279
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-073-0/+35
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219197
* Objective-C SDK modernizer. Patch to support modernizationFariborz Jahanian2014-10-061-0/+27
| | | | | | | | to NS_ENUM/NS_OPTION macros when typedef names are other than NSInteger/NSUInteger (int8_t, etc.). rdar://18532199 llvm-svn: 219173
* Patch to wrap up '_' as separator in version numbersFariborz Jahanian2014-10-061-3/+9
| | | | | | | | | in availability attribute by preserving this info. in VersionTuple and using it in pretty printing of attributes and yet using '.' as separator when diagnosing unavailable message calls. rdar://18490958 llvm-svn: 219124
* Fix bug in DynTypedMatcher::constructVariadic() that would cause false ↵Samuel Benzaquen2014-10-061-0/+16
| | | | | | | | | | | | | | | | | | | negatives. Summary: DynTypedMatcher::constructVariadic() where the restrict kind of the different matchers are not related causes the matcher to have a "None" restrict kind. This causes false negatives for anyOf and eachOf. Change the logic to get a common ancestor if there is one. Also added regression tests that fail without the fix. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5580 llvm-svn: 219118
* MS ABI: Make comment more accurateDavid Majnemer2014-10-051-1/+1
| | | | | | The ABI for function-scope statics changed in VS "14", not MSVC 2013. llvm-svn: 219076
* MS ABI: Use '1' (instead of '0') relative scope discriminatorsDavid Majnemer2014-10-051-1/+1
| | | | | | | | This changes the scope discriminator's behavior to start at '1' instead of '0'. Symbol table diffing, for ABI compatibility testing, kept finding these as false positives. llvm-svn: 219075
* Return a reference instead of vector copy for parentmap queries.Benjamin Kramer2014-10-041-6/+5
| | | | | | | The map is immutable until the whole ASTContext dies. While there movify a couple of copies in ASTMatchFinder away. NFC. llvm-svn: 219062
* Objective-C. Assortment of improvements pretty printingFariborz Jahanian2014-10-031-3/+12
| | | | | | | objective-C declarations, including printing of availability attributes on methods. llvm-svn: 219013
* constexpr evaluation for __builtin_assume_alignedHal Finkel2014-10-031-37/+98
| | | | | | | | | | | | | | | | | Richard noted in the review of r217349 that extra handling of __builtin_assume_aligned inside of the expression evaluator was needed. He was right, and this should address the concerns raised, namely: 1. The offset argument to __builtin_assume_aligned can have side effects, and we need to make sure that all arguments are properly evaluated. 2. If the alignment assumption does not hold, that introduces undefined behavior, and undefined behavior cannot appear inside a constexpr. and hopefully the diagnostics produced are detailed enough to explain what is going on. llvm-svn: 218992
* Revert useless part of r217349Hal Finkel2014-10-031-1/+0
| | | | | | | | | | Adding handling of __builtin_assume_aligned to IntExprEvaluator does not make sense because __builtin_assume_aligned returns a pointer (not an integer). Thanks to Richard for figuring out why this was not doing anything. I'll add this back in a better place (PointerExprEvaluator perhaps). llvm-svn: 218958
* Adds 'override' to overriding methods. NFC.Fariborz Jahanian2014-10-012-2/+2
| | | | | | These were uncoveredby my yet undelivered patch. llvm-svn: 218774
* [OPENMP] Loop collapsing and codegen for 'omp simd' directive.Alexander Musman2014-10-011-35/+137
| | | | | | | | | | | | | This patch implements collapsing of the loops (in particular, in presense of clause 'collapse'). It calculates number of iterations N and expressions nesessary to calculate the nested loops counters values based on new iteration variable (that goes from 0 to N-1) in Sema. It also adds Codegen for 'omp simd', which uses (and tests) this feature. Differential Revision: http://reviews.llvm.org/D5184 llvm-svn: 218743
* MS ABI: Correct layout for empty recordsDavid Majnemer2014-09-301-3/+13
| | | | | | | | Empty records do not always have size equivalent to their alignment. They only do so when their alignment is at least as large as the minimum empty struct size: 1 byte in C++ and 4 bytes in C. llvm-svn: 218661
* AST: Fix a typo in RecordLayoutBuilderDavid Majnemer2014-09-291-1/+1
| | | | | | No functional change intended. llvm-svn: 218628
* Fix an assertion failure trying to emit a trivial destructor in ObjC++Ben Langmuir2014-09-261-20/+14
| | | | | | | | | | | | | | | | | | If a base class declares a destructor, we will add the implicit destructor for the subclass in ActOnFields -> AddImplicitlyDeclaredMembersToClass But in Objective C++, we did not compute whether we have a trivial destructor until after that in CXXRecordDecl::completeDefinition() This was leading to a mismatch between the class, which thought it had no trivial destructor, and the CXXDestructorDecl, which considered itself trivial. It turns out the reason we delayed setting this until completeDefinition() was for a warning that has since been removed as part of -Warc-abi, so we just do it eagerly now. llvm-svn: 218520
* MS ABI: Assert that vftables should have a non-RTTI entryDavid Majnemer2014-09-261-1/+2
| | | | | | No functional change intended. llvm-svn: 218506
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-265-14/+76
| | | | | | | | | We build a NestedNameSpecifier that records the CXXRecordDecl in which __super appeared. Name lookup is performed in all base classes of the recorded CXXRecordDecl. Use of __super is allowed only inside class and member function scope. llvm-svn: 218484
* MS ABI: Avoid hashing back reference keys in manglerDavid Majnemer2014-09-251-17/+8
| | | | | | | | | | | | | | | | | | | | This patch replaces the back reference StringMap from the MS mangler with a SmallVector of strings. My previous patches reduced the number of hashes involved in back reference lookups, this one removes them completely. The back reference map contains at most 10 entries, which are likely to be of varying sizes and different initial subsequences, and which can easily became huge (due to templates and namespaces). The solution presented is the simplest possible one. Nevertheless, it's enough to reduce compilation times for a particular test case from 11.1s to 9s, versus 8.58s for the Itanium ABI. Possible further improvements include using a sorted vector (carefully to not introduce an extra comparison), storing the string contents in a common arena, and/or keep the string storage in the context for reuse. Patch by Agustín Bergé. llvm-svn: 218461
* Fix handling of preincrement on bit-fields. This gives a bit-field in C++, butRichard Smith2014-09-242-7/+27
| | | | | | | | | | | we were failing to find that bit-field when performing integer promotions. This brings us closer to following the standard, and closer to GCC. In C, this change is technically a regression: we get bit-field promotions completely wrong in C, promoting cases that are categorically not bit-field designators. This change makes us do so slightly more consistently, though. llvm-svn: 218428
* Patch to allow mangling of microsoft’s __uuidof expression for the Itanium ↵Fariborz Jahanian2014-09-241-1/+14
| | | | | | | | | ABI when under -fms-extensions. Reviewed by John McCall. //rdar://17784718 llvm-svn: 218384
* MS ABI: Pure virtual functions don't contribute to vtordispsDavid Majnemer2014-09-231-14/+13
| | | | | | | | | | | Usually, overriding a virtual function defined in a virtual base required emission of a vtordisp slot in the record. However no vtordisp is needed if the overriding function is pure; it should be impossible to observe the pure virtual method. This fixes PR21046. llvm-svn: 218340
* [OPENMP] Parsing/Sema of directive omp parallel for simdAlexander Musman2014-09-233-0/+37
| | | | llvm-svn: 218299
* AST: Mangle cast expression encoding more accuratelyDavid Majnemer2014-09-231-6/+23
| | | | | | | | | | | Don't mangle all casts in expressions as "cv", use the appropriate encoding which corresponds to a specific cast. This fixes PR21034. Differential Revision: http://reviews.llvm.org/D5453 llvm-svn: 218293
* Fix a vftable mangling bugReid Kleckner2014-09-221-13/+56
| | | | | | | | | | | | | We need to walk the class hierarchy twice: once in depth-first base specifier order for mangling and again in depth-first layout order for vftable layout. Vftable layout seems to depend on the full path from the most derived class to the base containing the vfptr. Fixes PR21031. llvm-svn: 218285
* MS ABI: Remove a FIXME that has been fixedDavid Majnemer2014-09-221-4/+3
| | | | | | We've implemented MSVC-style RTTI for quite some time. llvm-svn: 218269
* Fix evatuated value of __builtin_object_size according to itsFariborz Jahanian2014-09-221-2/+14
| | | | | | | 'type' argument when it cannot be determined which objects ptr points to at compile time. rdar://18334276 llvm-svn: 218258
* ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari2014-09-221-0/+7
| | | | | | | | | | | | | | | | Summary: This fixes PR20023. In order to implement this scoping rule, we piggy back on the existing LabelDecl machinery, by creating LabelDecl's that will carry the "internal" name of the inline assembly label, which we will rewrite the asm label to. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4589 llvm-svn: 218230
* Silence MSVC warnings from r218127 about not returning a valueReid Kleckner2014-09-191-0/+3
| | | | llvm-svn: 218128
* Make DynTypedNode have the dynamic type of the object, instead of its static ↵Samuel Benzaquen2014-09-191-0/+28
| | | | | | | | | | | | | | | | type. Summary: Make DynTypedNode have the dynamic type of the object, instead of its static type. Some optimizations that are in the works require that the nodes have the right type. Reviewers: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5411 llvm-svn: 218127
* [OPENMP] Initial parsing/sema analysis of 'target' directive.Alexey Bataev2014-09-193-0/+35
| | | | llvm-svn: 218110
* Revert r217995 and follow-ups:Hans Wennborg2014-09-181-20/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r218053: Use exceptions() instead of getNumExceptions()/getExceptionType() to avoid r218011: Work around MSVC parser bug by putting redundant braces around the body of r217997: Skip parens when detecting whether we're instantiating a function declaration. r217995: Instantiate exception specifications when instantiating function types (other The Windows build was broken for 16 hours and no one had any good ideas of how to fix it. Reverting for now to make the builders green. See the cfe-commits thread [1] for more info. This was the build error (from [2]): C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang\lib\Sema\SemaTemplateInstantiate.cpp(1590) : error C2668: '`anonymous-namespace'::TemplateInstantiator::TransformFunctionProtoType' : ambiguous call to overloaded function C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang\lib\Sema\SemaTemplateInstantiate.cpp(1313): could be 'clang::QualType `anonymous-namespace'::TemplateInstantiator::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>>(clang::TypeLocBuilder &,clang::FunctionProtoTypeLoc,clang::CXXRecordDecl *,unsigned int,Fn)' with [ Fn=clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735> ] c:\bb-win7\ninja-clang-i686-msc17-r\llvm-project\clang\lib\sema\TreeTransform.h(4532): or 'clang::QualType clang::TreeTransform<Derived>::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>>(clang::TypeLocBuilder &,clang::FunctionProtoTypeLoc,clang::CXXRecordDecl *,unsigned int,Fn)' with [ Derived=`anonymous-namespace'::TemplateInstantiator, Fn=clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735> ] while trying to match the argument list '(clang::TypeLocBuilder, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl *, unsigned int, clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>)' 1. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140915/115011.html 2. http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/10515/steps/build_clang_tools_1/logs/stdio llvm-svn: 218058
* Use exceptions() instead of getNumExceptions()/getExceptionType() to avoidAlexander Kornienko2014-09-181-3/+2
| | | | | | | | | accesses to incorrect exception types when getExceptionSpecType() != EST_Dynamic This fixes a crash in test/CXX/except/except.spec/template.cpp that happens in certain build configurations. llvm-svn: 218053
* Parsing/Sema of directive omp for simdAlexander Musman2014-09-183-0/+37
| | | | llvm-svn: 218029
* Instantiate exception specifications when instantiating function types (otherRichard Smith2014-09-171-7/+21
| | | | | | | | | | than the type of a function declaration). We previously didn't instantiate these at all! This also covers the pathological case where the only mention of a parameter pack is within the exception specification; this gives us a second way (other than alias templates) to reach the horrible state where a type contains an unexpanded pack, but its canonical type does not. llvm-svn: 217995
* Add support for putting constructors and destructos in explicit comdats.Rafael Espindola2014-09-162-3/+23
| | | | | | | | | | | | | | | | | | There are situations when clang knows that the C1 and C2 constructors or the D1 and D2 destructors are identical. We already optimize some of these cases, but cannot optimize it when the GlobalValue is weak_odr. The problem with weak_odr is that an old TU seeing the same code will have a C1 and a C2 comdat with the corresponding symbols. We cannot suddenly start putting the C2 symbol in the C1 comdat as we cannot guarantee that the linker will not pick a .o with only C1 in it. The solution implemented by GCC is to expand the ABI to have a comdat whose name uses a C5/D5 suffix and always has both symbols. That is what this patch implements. llvm-svn: 217874
* Reject a slightly-sneaky way to perform a read of mutable state from within aRichard Smith2014-09-161-0/+66
| | | | | | | | | constexpr function. Part of this fix is a tentative fix for an as-yet-unfiled core issue (we're missing a prohibition against reading mutable members from unions via a trivial constructor/assignment, since that doesn't perform an lvalue-to-rvalue conversion on the members). llvm-svn: 217852
* Pretty print attributes associated with record declarations.Aaron Ballman2014-09-151-0/+6
| | | | llvm-svn: 217784
* Don't print 'NULL TYPE' when dumping a delegating constructor.Richard Trieu2014-09-121-1/+5
| | | | llvm-svn: 217707
* patch to add missing warning on sizeof wrong parameterFariborz Jahanian2014-09-121-0/+3
| | | | | | | | for __builtin___strlcpy_chk/__builtin___strlcat_chk. Patch by Jacques Fortier with monir change by me and addition of test. rdar://18259539 llvm-svn: 217700
* MS ABI: The latest VC "14" CTP implements deleted virtual functionsDavid Majnemer2014-09-121-10/+1
| | | | | | | | | | | | Deleted virtual functions get _purecall inserted into the vftable. Earlier CTPs would simply stick nullptr in there. N.B. MSVC can't handle deleted virtual functions which require return adjusting thunks, they give an error that a deleted function couldn't be called inside of a compiler generated function. We get this correct by making the thunk have a __purecall entry as well. llvm-svn: 217654
* Objective-C. Under a special flag, -Wcstring-format-directive,Fariborz Jahanian2014-09-091-0/+13
| | | | | | | | off by default, issue a warning if %s directive is used in certain CF/NS formatting APIs, to assist user in deprecating use of such %s in these APIs. rdar://18182443 llvm-svn: 217467
OpenPOWER on IntegriCloud