summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Fix strange indentation and remove trailing whitespace on empty linesDmitri Gribenko2013-12-171-10/+10
| | | | llvm-svn: 197513
* Fix indentation from r197490 plus some typosAlp Toker2013-12-171-1/+1
| | | | llvm-svn: 197507
* ASTContext: Refactor implicit record creationAlp Toker2013-12-171-61/+38
| | | | | | | | Tidy up built-in record creation to reduce code duplication. Continuation of r197336. llvm-svn: 197452
* ASTContext: Declare builtin types implicitlyAlp Toker2013-12-152-195/+71
| | | | | | | | | | | | | | __builtin_va_list and friends have been showing up where they shouldn't for way to long, making unwanted appearences in -ast-print, tooling and source level visitors and even the hello world tutorial on the clang website. This commit factors down the implicit typedef and record creation facilities to ensure they're marked implicit. Also fixes a unit test that was testing incorrect behaviour, and removes old hacks in the DeclPrinter that tried to skip implicit declarations manually. llvm-svn: 197336
* PR18232: implement instantiation for class-scope explicit specializations ofRichard Smith2013-12-141-1/+1
| | | | | | class templates (a Microsoft extension). llvm-svn: 197298
* Remove an unused parameter and include after r197273Alp Toker2013-12-131-1/+0
| | | | llvm-svn: 197274
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-136-32/+3
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* [-cxx-abi microsoft] Remove trailing spaces from the manglerDavid Majnemer2013-12-131-16/+16
| | | | | | No functional change, just a tidying up. llvm-svn: 197196
* AST: Update URL for Itanium ABI specDavid Majnemer2013-12-131-1/+1
| | | | | | | | The old URL hasn't worked for quite some time. While we are here, also change the link so that it will send us straight to the mangling portion of the ABI doc. llvm-svn: 197195
* [-cxx-abi microsoft] Add commentary for mangleStaticGuardVariableDavid Majnemer2013-12-131-0/+9
| | | | | | | We will need to do some work here if we want to play nice with MSVC2013. Add a TODO indicating what changed and why this matters. llvm-svn: 197193
* Revert "[-cxx-abi microsoft] Mangle reference temporaries"David Majnemer2013-12-131-3/+4
| | | | | | | | | This reverts commit r197184. Richard Smith brings up some good points, a proper implementation will require us to mangle unnameable entities compatibly with MSVC. llvm-svn: 197192
* [-cxx-abi microsoft] Mangle reference temporariesDavid Majnemer2013-12-121-4/+3
| | | | | | | They are mangled the same as normal references, nothing special is going on here. llvm-svn: 197184
* [ms-abi] Refactoring Non-virtual base layout in record layoutWarren Hunt2013-12-121-69/+39
| | | | | | | | | This refactor addresses bugzilla bug 18167 and simplifies the code at the same time. Also I add a test case for the bug. Also I make a non-functional change to the basic layout lit tests to make them more reliable (using CHECK-NEXT instead of CHECK). llvm-svn: 197183
* Unify type trait parsingAlp Toker2013-12-121-54/+9
| | | | | | | | | | | | | | | | | Type trait parsing is all over the place at the moment with unary, binary and n-ary C++11 type traits that were developed independently at different points in clang's history. There's no good reason to handle them separately -- there are three parsers, three AST nodes and lots of duplicated handling code with slightly different implementations and diags for each kind. This commit unifies parsing of type traits and sets the stage for further consolidation. No change in behaviour other than more consistent error recovery. llvm-svn: 197179
* Switch to the new MingW ABI.Rafael Espindola2013-12-121-0/+4
| | | | | | | GCC 4.7 changed the MingW ABI. On the clang side this means that methods now have the thiscall calling convention by default. llvm-svn: 197164
* PR18217: Rewrite JumpDiagnostics' handling of temporaries, to correctly handleRichard Smith2013-12-121-31/+0
| | | | | | | | | declarations that might lifetime-extend multiple temporaries. In passing, fix a crasher (PR18217) if an initializer was dependent and exactly the wrong shape, and remove a bogus function (Expr::findMaterializedTemporary) now its last use is gone. llvm-svn: 197103
* Add new PrintingPolicy entry to trim number of newlines. Useful for the CFG ↵Ted Kremenek2013-12-111-7/+14
| | | | | | | | | printer. The change isn't completely comprehensive. This can be filled in lazily as needed. There is one consumer right now. llvm-svn: 197093
* [ms-abi][cleanup] Removing FinalizeCXXLayout : no functional changeWarren Hunt2013-12-111-10/+1
| | | | | | | After r196549 there is no need to separate FinalizeCXXLayout and FinalizeLayout so they were merged and FinalizeCXXLayout was eliminated. llvm-svn: 197083
* Add front-end infrastructure now address space casts are in LLVM IR.David Tweed2013-12-112-0/+9
| | | | | | | | | | With the introduction of explicit address space casts into LLVM, there's a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA and code to produce address space casts from those kinds when appropriate. Patch by Michele Scandale! llvm-svn: 197036
* [ms-abi] Makes Virtual Base Alignment Look at All Virtual BasesWarren Hunt2013-12-111-5/+8
| | | | | | | | Prior to this patch, the alignment imposed by virtual bases only included direct virtual bases. This patch fixes it to look at all virtual bases. llvm-svn: 196997
* Rename attribute 'objc_suppress_protocol_methods' to ↵Ted Kremenek2013-12-101-20/+1
| | | | | | | | | | | | | | | 'objc_protocol_requires_explicit_implementation'. That's a mouthful, and not necessarily the final name. This also reflects a semantic change where this attribute is now on the protocol itself instead of a class. This attribute will require that a protocol, when adopted by a class, is explicitly implemented by the class itself (instead of walking the super class chain). Note that this attribute is not "done". This should be considered a WIP. llvm-svn: 196955
* [AST] In ObjCInterfaceDecl::isDesignatedInitializer(), use getMethod() ↵Argyrios Kyrtzidis2013-12-101-3/+1
| | | | | | | | instead of lookupMethod(). lookupMethod also goes through categories, which we don't need there. llvm-svn: 196942
* Implement DR1460: fix handling of default initializers in unions; don't allowRichard Smith2013-12-102-4/+20
| | | | | | | | | more than one such initializer in a union, make mem-initializers override default initializers for other union members, handle anonymous unions with anonymous struct members better. Fix a couple of semi-related bugs exposed by the tests for same. llvm-svn: 196892
* [ms-abi] 64-bit fixes for r196549Warren Hunt2013-12-101-10/+17
| | | | | | | | In order to address latent bugs that were easier to expose in 64-bit mode, we move the application of __declspec(align) to before the layout of vbases rather than after. llvm-svn: 196861
* [-cxx-abi microsoft] Mangle large integral constants correctlyDavid Majnemer2013-12-091-43/+40
| | | | | | | | | | | | | | | | | | | Testing has revealed that large integral constants (i.e. > INT64_MAX) are always mangled as-if they are negative, even in places where it would not make sense for them to be negative (like non-type template parameters of type unsigned long long). To address this, we change the way we model number mangling: always mangle as-if our number is an int64_t. This should result in correct results when we have large unsigned numbers. N.B. Bizarrely, things that are 32-bit displacements like vbptr offsets are mangled as-if they are unsigned 32-bit numbers. This is a pretty egregious waste of space, it would be a 4x savings if we could mangle it like a signed 32-bit number. Instead, we explicitly cast these displacements to uint32_t and let the mangler proceed. llvm-svn: 196771
* [-cxx-abi microsoft] Properly mangle enumsDavid Majnemer2013-12-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing our ability to mangle large constants (PR18175), I incidentally discovered that we did not properly mangle enums correctly. Previously, we would append the width of the enum in bytes after the type-tag differentiator. This would mean "enum : short" would be mangled as 'W2' while "enum : char" would be mangled as 'W1'. Upon testing this with several versions of MSVC, I found that this did not match their behavior: they always use 'W4'. N.B. Quick testing uncovered that undname allows different numbers to follow the 'W' in the following way: 'W0' -> "enum char" 'W1' -> "enum unsigned char" 'W2' -> "enum short" 'W3' -> "enum unsigned short" 'W4' -> "enum" 'W5' -> "enum unsigned int" 'W6' -> "enum long" 'W7' -> "enum unsigned long" However this scheme appears abandoned, I cannot get MSVC to trigger it. Furthermore, it's incomplete: it doesn't handle "bool" or "long long". llvm-svn: 196752
* Fix pr18174.Rafael Espindola2013-12-081-1/+1
| | | | | | | | | | | | | | | Clang outputs LLVM one top level decl at a time. This combined with the visibility computation code looking for the newest NamespaceDecl would cause it to produce different results for nested namespaces. The two options for producing consistent results are * Delay codegen of anything inside a namespace until the end of the file. * Don't look for the newest NamespaceDecl. This patch implements the second option. This matches the gcc behavior too. llvm-svn: 196712
* Eliminate the last trivial NDEBUG uses in clang headersAlp Toker2013-12-072-3/+5
| | | | | | assert(sanity()) reads so much better than preprocessor conditional blocks. llvm-svn: 196657
* CommentLexer: eliminate an NDEBUG from the headersAlp Toker2013-12-071-0/+13
| | | | | | Code in headers shouldn't be conditional on the build configuration. llvm-svn: 196656
* Fixing assertion failure introduced in 196602.Warren Hunt2013-12-071-6/+4
| | | | | | Also includes a minor refactor with no functional change. llvm-svn: 196627
* [MS-ABI] adds padding before all vbases after a bitfieldWarren Hunt2013-12-061-8/+7
| | | | | | | | | | MS-ABI adds padding before *every* vbase if the last field in a record is a bit-field. This changes clangs behavior to match. I also fix some windows-style line endings in the test file. Differential Revision: http://llvm-reviews.chandlerc.com/D2277 llvm-svn: 196605
* [MS-ABI] Fix alias-avoidance padding between basesWarren Hunt2013-12-062-63/+74
| | | | | | | | | | | Adds padding between bases or virtual bases in an attempt to avoid aliasing of zero-sized sub-objects. The approach used by the ABI adds two more bits of state. Detailed comments are in the code. Test cases included. Differential Revision: http://llvm-reviews.chandlerc.com/D2258 llvm-svn: 196602
* Fix code typos spotted while working on type traitsAlp Toker2013-12-061-2/+2
| | | | llvm-svn: 196587
* PR18152: When computing the semantic form for an initializer list, keep trackRichard Smith2013-12-061-2/+2
| | | | | | of whether the initializer list is dependent. llvm-svn: 196558
* Support MS-ABI's concept of "Required Alignment" imposed by Warren Hunt2013-12-062-29/+61
| | | | | | | | | | | | | | | | | | __declspec(align()) This patch implements required alignment in a way that makes __declspec(align()) and #pragma pack play correctly together. In the MS-ABI, __declspec(align()) is a hard rule and cannot be overridden by #pragma pack. This cases each record to have two interesting alignments "preferred alignment" (which matches Itanium's concept of alignment) and "required alignment" which is an alignment that must never be violated, even in the case of #pragma pack. This patch introduces the concept of Required Alignment to the record builder and tracks/uses it appropriately. Test cases are included. Differential Revision: http://llvm-reviews.chandlerc.com/D2283 llvm-svn: 196549
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-052-4/+4
| | | | llvm-svn: 196510
* [objc] If an interface has no initializer marked as designated and ↵Argyrios Kyrtzidis2013-12-051-14/+48
| | | | | | | | | | | introduces at least one new initializer, don't assume that it inherits the designated initializers from the super class. If the assumption was wrong because a new initializer was a designated one that was not marked as such, we will emit misleading warnings for subclasses of the interface. llvm-svn: 196476
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-052-4/+4
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-059-25/+68
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 llvm-svn: 196451
* [objc] Emit warning when the implementation of a secondary initializer calls onArgyrios Kyrtzidis2013-12-031-0/+8
| | | | | | | | | | | super another initializer and when the implementation does not delegate to another initializer via a call on 'self'. A secondary initializer is an initializer method not marked as a designated initializer within a class that has at least one initializer marked as a designated initializer. llvm-svn: 196318
* [objc] Emit warnings when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-2/+5
| | | | | | | | calls on super an initializer that is not a designated one or any initializer on self. llvm-svn: 196317
* [objc] Emit a warning when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-2/+43
| | | | | | | | does not chain to an init method that is a designated initializer for the superclass. llvm-svn: 196316
* [objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get theArgyrios Kyrtzidis2013-12-031-0/+29
| | | | | | | | | | designated initializers of an interface. If the interface declaration does not have methods marked as designated initializers then the interface inherits the designated initializers of its super class. llvm-svn: 196315
* CommentLexer: When proceeding with a typo corrected name don't clobber the ↵Benjamin Kramer2013-12-011-5/+6
| | | | | | | | token. This would crash if the token is used in another diagnostic. PR18051. llvm-svn: 196048
* Don't call getMostRecentDecl when we know we have it.Rafael Espindola2013-11-261-11/+22
| | | | | | On a Release build this takes the testcase in pr18055 from 0m3.892s to 0m1.452s. llvm-svn: 195768
* Move these virtual methods out of line.Rafael Espindola2013-11-261-2/+10
| | | | llvm-svn: 195767
* Remove some unused localsAlp Toker2013-11-261-2/+1
| | | | llvm-svn: 195714
* [-cxx-abi microsoft] Create backrefs for <unnamed-type-`id'>David Majnemer2013-11-251-14/+16
| | | | | | | | | | | | | | | It wasn't possible for an anonymous type to show up inside of function arguments. However, decltype (which MSVC added support for in 2010) makes this possible. Further, backrefs to these anonymous types can now be formed. This fixes PR18022. N.B. We do not, and very likely _will not_, support MSVC's bug where subsequent typedefs of anonymous types leak into the linkage name; this is a gross violation of the ABI. A warning should be introduced to inform our users of this particular shortcoming. llvm-svn: 195669
* Take cv-qualifiers on fields of class type into account when determiningRichard Smith2013-11-251-0/+7
| | | | | | whether a defaulted special member function should be deleted. llvm-svn: 195620
* Use specific_attr_iterator to tighten loop over ObjCSuppressProtocolAttrs.Ted Kremenek2013-11-231-8/+4
| | | | llvm-svn: 195561
OpenPOWER on IntegriCloud