summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Thread the info about vbptr sharing through ASTRecordLayoutTimur Iskhodzhanov2013-11-083-28/+14
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D2120 llvm-svn: 194256
* PR17615: A delegating constructor initializer is a full-expression. Don'tRichard Smith2013-11-071-2/+5
| | | | | | forget to clean up temporaries at the end of it. llvm-svn: 194213
* Minor refinement of VTableBuilder.h: fix wrong indentation, rename a struct ↵Timur Iskhodzhanov2013-11-071-2/+2
| | | | | | field with a more appropriate name llvm-svn: 194202
* [-fms-extensions] Add support for __FUNCDNAME__David Majnemer2013-11-063-0/+29
| | | | | | | | | | | | | | | | Summary: Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled function name via __FUNCDNAME__. This implementation is very naive and unoptimized, it is expected that __FUNCDNAME__ would be used rarely in practice. Reviewers: rnk, rsmith, thakis CC: cfe-commits, silvas Differential Revision: http://llvm-reviews.chandlerc.com/D2109 llvm-svn: 194181
* Silencing some MSVC warnings about not all control paths returning a value ↵Aaron Ballman2013-11-061-0/+2
| | | | | | when they actually do. llvm-svn: 194156
* Fix PR17738 - add support for vtordisp thunks when using -cxx-abi microsoftTimur Iskhodzhanov2013-11-063-41/+146
| | | | llvm-svn: 194132
* More constant evaluation cleanup, and fix an issue where we'd override anRichard Smith2013-11-061-22/+25
| | | | | | | earlier 'non-constant' diagnostic with a later one if the earlier one was from a side-effect we thought we could evaluate past. llvm-svn: 194117
* Microsoft adds weird padding before virtual bases if the last field was a ↵Warren Hunt2013-11-061-0/+9
| | | | | | | | | | bitfield This patch adds the same behavior to clang. Differential Revision: http://llvm-reviews.chandlerc.com/D2103 llvm-svn: 194115
* Introduce DynTypedNode::print, dump and getSourceRange.Peter Collingbourne2013-11-061-0/+47
| | | | | | | | | These functions can generally be applied to multiple kinds of AST node, so it makes sense to add them to DynTypedNode. Differential Revision: http://llvm-reviews.chandlerc.com/D2096 llvm-svn: 194113
* Simplify: we don't care why constant evaluation might have failed when we'reRichard Smith2013-11-051-6/+3
| | | | | | checking an expression for constant overflow. llvm-svn: 194099
* Refactor constant expression handling and make a couple of tweaks to make it aRichard Smith2013-11-051-64/+156
| | | | | | | | | bit more robust against future changes. This includes a slight diagnostic improvement: if we know we're only trying to form a constant expression, take the first diagnostic which shows the expression is not a constant expression, rather than preferring the first one which makes the expression unfoldable. llvm-svn: 194098
* Fix vbtable indices when a class shares the vbptr with a non-virtual baseTimur Iskhodzhanov2013-11-051-38/+80
| | | | llvm-svn: 194082
* C++1y sized deallocation: if we have a use, but not a definition, of a sizedRichard Smith2013-11-051-1/+33
| | | | | | | | | | | | | deallocation function (and the corresponding unsized deallocation function has been declared), emit a weak discardable definition of the function that forwards to the corresponding unsized deallocation. This allows a C++ standard library implementation to provide both a sized and an unsized deallocation function, where the unsized one does not just call the sized one, for instance by putting both in the same object file within an archive. llvm-svn: 194055
* Implement final resolution of DR1402: implicitly-declared move operators thatRichard Smith2013-11-042-4/+0
| | | | | | | | | | | would be deleted are still declared, but are ignored by overload resolution. Also, don't delete such members if a subobject has no corresponding move operation and a non-trivial copy. This causes us to implicitly declare move operations in more cases, but risks move-assigning virtual bases multiple times in some circumstances (a warning for that is to follow). llvm-svn: 193969
* Sema: Do not allow overloading between methods based on restrictDavid Majnemer2013-11-031-1/+6
| | | | | | | | | | | | | | | | If the sole distinction between two declarations is that one has a __restrict qualifier then we should not consider it to be an overload. Instead, we will consider it as an incompatible redeclaration which is similar to how MSVC, ICC and GCC would handle it. This fixes PR17786. N.B. We must not mangle in __restrict into method qualifiers becase we don't allow overloading between such declarations anymore. To do otherwise would be a violation of the Itanium ABI. llvm-svn: 193964
* OS X 10.9+ and iOS 7+ support load/store of big atomic objects.Bob Wilson2013-11-021-0/+4
| | | | | | | | rdar://13973577 Patch by Fariborz Jahanian. llvm-svn: 193935
* Improves compatibility with cl.exe when laying out array fieldsWarren Hunt2013-11-012-21/+9
| | | | | | | | | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2090 Clang was "improperly" over-aligning arrays with sizes are not a multiple of their alignment. This behavior was removed in microsoft 32 bit mode. In addition, after examination of ASTContext::getTypeInfoImpl, a redundant code block in MicrosoftRecordLayoutBuilder::getAdjustedFieldInfo was deleted. llvm-svn: 193898
* Wraps lazily generated builtins in an extern "C" contextWarren Hunt2013-11-011-22/+17
| | | | | | | | | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2082 Adds a lang_c LinkageSpecDecl to lazily generated builtins. This enforces correct behavior for builtins in a variety of cases without special treatment elsewhere within the compiler (special treatment is removed by the patch). It also allows for C++ overloads of builtin functions, which Microsoft uses in their headers e.g. _InterlockedExchangeAdd is an extern C builtin for the long type but an inline wrapper for int type. llvm-svn: 193896
* Make thunk this/return adjustment ABI-specific. Also, fix the return ↵Timur Iskhodzhanov2013-10-302-56/+46
| | | | | | | | adjustment when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D2026 llvm-svn: 193679
* Fix an assertion when handling a custom case of virtual inheritance; also ↵Timur Iskhodzhanov2013-10-291-24/+2
| | | | | | reduce code duplication llvm-svn: 193610
* ObjectiveC: under -Wunused-property-ivar warn if property'sFariborz Jahanian2013-10-253-4/+8
| | | | | | | backing warning is not used in one of its accessor methods. // rdar://14989999 llvm-svn: 193439
* Remove dead variables.Benjamin Kramer2013-10-251-11/+2
| | | | llvm-svn: 193395
* Remove dead recursive function.Benjamin Kramer2013-10-241-22/+0
| | | | llvm-svn: 193313
* Implements 64 bit microsoft record layout and adds lit tests to cover Warren Hunt2013-10-231-388/+70
| | | | | | | | | it. Also removes all of the microsoft C++ ABI related code from the itanium layout builder. Differential Revision: http://llvm-reviews.chandlerc.com/D2003 llvm-svn: 193290
* AST: Mangle fields in anonymous structs/unionsDavid Majnemer2013-10-232-4/+6
| | | | | | | | | | | | | The Itanium mangler couldn't cope with mangling an IndirectFieldDecl. Instead, mangle the field the IndirectFieldDecl refers to. Further, give IndirectFieldDecl no linkage just like FieldDecl. N.B. Decl.cpp:getLVForNamespaceScopeDecl tried to calculate linkage for data members of anonymous structs/unions. However, this seems impossible so turn it into an assertion. llvm-svn: 193269
* Refactor out the circular reference to LambdaExpr in CXXRecordDecl.Faisal Vali2013-10-231-5/+9
| | | | | | | | | | | | | | | | | A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test. The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html. Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box). Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl. In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. No change in functionality. This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): http://llvm-reviews.chandlerc.com/D1856 Thanks! llvm-svn: 193246
* Revert r193223 and r193216.Rafael Espindola2013-10-231-9/+5
| | | | | | | | | | They were causing CodeGenCXX/mangle-exprs.cpp to fail. Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl." Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves." llvm-svn: 193226
* Remove the circular reference to LambdaExpr in CXXRecordDecl.Faisal Vali2013-10-231-5/+9
| | | | | | | | | | | | | | | Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl. No change in functionality. In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): http://llvm-reviews.chandlerc.com/D1856 Thanks! llvm-svn: 193223
* Teach AST dumper to dump the containing module and hidden flag for declarations.Richard Smith2013-10-221-0/+7
| | | | llvm-svn: 193210
* Treat aliases as definitions.Rafael Espindola2013-10-221-1/+5
| | | | | | | | | | | | | | This fixes pr17639. Before this patch clang would consider void foo(void) __attribute((alias("__foo"))); a declaration. It now correctly handles it as a definition. Initial patch by Alp Toker. I added support for variables. llvm-svn: 193200
* Drop the unneeded VBase field from MethodInfo in the VFTableBuilder classTimur Iskhodzhanov2013-10-221-12/+5
| | | | llvm-svn: 193164
* Simplify some implementations of get*Decl.Rafael Espindola2013-10-191-1/+1
| | | | | | | | | | * NamedDecl and CXXMethodDecl were missing getMostRecentDecl. * The const version can just forward to the non const. * getMostRecentDecl can use cast instead of cast_or_null. This then removes some casts from the callers. llvm-svn: 193039
* Reduce indentation with an early exit.Rafael Espindola2013-10-191-23/+24
| | | | llvm-svn: 193028
* Add isFirstDecl to DecBase too and use it instead of getPreviousDecl() == 0.Rafael Espindola2013-10-191-4/+2
| | | | | | Redeclarable already had a isFirstDecl, but it was missing from DeclBase. llvm-svn: 193027
* Simplify FunctionDecl::getBody.Rafael Espindola2013-10-191-9/+5
| | | | llvm-svn: 193025
* Fix 80-column violation.Richard Smith2013-10-181-1/+2
| | | | llvm-svn: 192937
* [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for ↵David Majnemer2013-10-181-0/+1
| | | | | | | | | | | | | | 'final' Summary: Some MS headers use these features. Reviewers: rnk, rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1948 llvm-svn: 192936
* Rename some functions for consistency.Rafael Espindola2013-10-177-25/+19
| | | | | | Every other function in Redeclarable.h was using Decl instead of Declaration. llvm-svn: 192900
* [-cxx-abi microsoft] Fix this argument/parameter offsets for virtual ↵Timur Iskhodzhanov2013-10-161-5/+13
| | | | | | | | destructors in the presence of virtual bases Reviewed at http://llvm-reviews.chandlerc.com/D1939 llvm-svn: 192822
* On 32 bit windows, mangle stdcall and fastcall decls in clang.Rafael Espindola2013-10-163-56/+136
| | | | | | | | | | | This removes the dependency on the llvm mangler doing it for us. In isolation, the benefit is that the testing of what mangling is applied is all in one place: (C, C++) X (Itanium, Microsoft) are all handled by clang. This also gives me hope that in the future the llvm mangler (and llvm-ar) will not depend on TargetMachine. llvm-svn: 192762
* Teach the AST dumper to dump the canonical declaration for a mergeable ↵Richard Smith2013-10-151-9/+16
| | | | | | declaration. llvm-svn: 192739
* Add constant evaluation support for __builtin_isinf, __builtin_isfinite,Richard Smith2013-10-151-0/+24
| | | | | | __builtin_isnan, and __builtin_isnormal. Patch by Karthik Bhat! Tests by me. llvm-svn: 192729
* ms-compat: Fix taking the address of a member of a dependent baseReid Kleckner2013-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | If unqualified id lookup fails while parsing a class template with a dependent base, clang with -fms-compatibility will pretend the user prefixed the name with 'this->' in order to delay the lookup. However, if there was a unary ampersand, Sema::ActOnDependentIdExpression() will create a DependentDeclRefExpr, which is not what we wanted at all. Fix this by building the CXXDependentScopeMemberExpr directly instead. In order to be fully MSVC compatible, we would have to defer all attempts at name lookup to instantiation time. However, until we have real problems with system headers that can't be parsed, we'll put off implementing that. Fixes PR16014. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1892 llvm-svn: 192727
* Correctly skip type sugar when determining the width of an enum type. DerivedRichard Smith2013-10-151-1/+1
| | | | | | from a patch by Justin Bogner. llvm-svn: 192671
* PR17576: Fix assertion on polymorphic classes with small alignmentReid Kleckner2013-10-141-1/+1
| | | | | | | | We have to reserve at least the width of a pointer for the vfptr. For classes with small alignment, we weren't reserving enough space, and were overlapping the first field with the vfptr. llvm-svn: 192626
* Correctly check for distructors when realizing vtordispsWarren Hunt2013-10-141-1/+1
| | | | | | | | | | This patch fixes the distructor test when checking for vtordisp requirements in microsoft record layout. A test case is also included. Addresses: http://llvm.org/bugs/show_bug.cgi?id=16406#c7 llvm-svn: 192616
* Reduce double set lookups by using the result of insert.Benjamin Kramer2013-10-141-2/+1
| | | | | | No functionality change. llvm-svn: 192598
* Only use the MS record layout when using the MS C++ ABIReid Kleckner2013-10-111-5/+5
| | | | | | We're not ready to use it everywhere we use a win32 triple yet. llvm-svn: 192502
* Fix unused variable warning in MS record layout.Reid Kleckner2013-10-111-3/+1
| | | | llvm-svn: 192495
* Adds Microsoft compatiable C++ record layout code to clang.Warren Hunt2013-10-112-32/+736
| | | | llvm-svn: 192494
OpenPOWER on IntegriCloud