summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an assert() suggested by Richard.Nico Weber2013-06-211-0/+1
| | | | llvm-svn: 184516
* Fix a crash with __flaot128 noticed by Eli.Nico Weber2013-06-201-6/+6
| | | | llvm-svn: 184498
* Lazily provide a __float128 dummy type in -std=gnu++11 mode.Nico Weber2013-06-201-1/+14
| | | | | | This is needed to parse libstdc++ 4.7's type_traits, see PR13530. llvm-svn: 184476
* [AST] Don't include RecursiveASTVisitor.h in ASTContext.hReid Kleckner2013-06-171-0/+95
| | | | | | | | | | | | | | | | | | | | The untemplated implementation of getParents() doesn't need to be in a header file. RecursiveASTVisitor.h is full of repeated macro expansion. Moving this include to ASTContext.cpp speeds up compilation of LambdaMangleContext.cpp, a small C++ file with few includes, from 3.7s to 2.8s for me locally. I haven't measured a full build, but it can't hurt. I had to fix a few static analyzer files that were depending on transitive includes of C++ AST headers. Reviewers: rsmith, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D982 llvm-svn: 184075
* Use FPT::getArgTypes() instead of manually building ArrayRefsReid Kleckner2013-06-101-13/+4
| | | | | | | | Made significantly easier with git-clang-format. Differential Revision: http://llvm-reviews.chandlerc.com/D947 llvm-svn: 183694
* Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"Reid Kleckner2013-06-081-15/+0
| | | | | | | | | This reverts commit r183614. It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms, and the fix is not trivial. llvm-svn: 183616
* [Sema] Make FunctionType's TSI use unadjusted argument typesReid Kleckner2013-06-081-0/+15
| | | | | | | | | | | | | | | | This helps preserve the type-as-written in the AST, which we need for MSVC mangling. In particular, we need to preserve the types of array parameters in function pointer types. The essence of this change is: - QualType ArgTy = Param->getType(); + QualType ArgTy = Param->getTypeSourceInfo()->getType(); ... followed by the adjustment in ActOnFunctionDeclarator(). Differential Revision: http://llvm-reviews.chandlerc.com/D883 llvm-svn: 183614
* Model temporary lifetime-extension explicitly in the AST. Use this model toRichard Smith2013-06-051-0/+13
| | | | | | | | | handle temporaries which have been lifetime-extended to static storage duration within constant expressions. This correctly handles nested lifetime extension (through reference members of aggregates in aggregate initializers) but non-constant-expression emission hasn't yet been updated to do the same. llvm-svn: 183283
* Objective-C encoding. Fixes up encodeing forFariborz Jahanian2013-06-041-6/+3
| | | | | | | arrays of empty structs. // rdar://14053082 (also pr13062). llvm-svn: 183234
* Fix memory leak for APValues that do memory allocation.Manuel Klimek2013-06-031-5/+7
| | | | | | | | | This patch ensures that APValues are deallocated with the ASTContext by registering a deallocation function for APValues to the ASTContext. Original version of the patch by James Dennett. llvm-svn: 183101
* Remove unused field.Rafael Espindola2013-05-291-2/+1
| | | | llvm-svn: 182874
* Patch to issue error when target of MacOS and iOS Fariborz Jahanian2013-05-281-0/+14
| | | | | | | does not support large load/store of atomic objects. // rdar://13973577 llvm-svn: 182781
* Fix a crash when we were trying to compute the linkage too early.Rafael Espindola2013-05-281-2/+1
| | | | llvm-svn: 182773
* In -ast-dump, only dump comments when dumping the actual Decl to which theyRichard Smith2013-05-211-0/+5
| | | | | | | | attach, rather than merging all comments on the declaration chain. This gives a more faithful dump, and has the side benefit of unbreaking uses of dump() from within AST deserialization (where the redeclaration chain may not be sane). llvm-svn: 182350
* Add static_cast to assertion to silence sign/unsigned comparison warning.Richard Trieu2013-05-141-1/+2
| | | | llvm-svn: 181849
* When computing the size of large arrays, use char units instead of bits.Richard Trieu2013-05-141-2/+21
| | | | | | | This prevents an overflow and assertion when the number of bits cannot be stored in 64-bits. llvm-svn: 181839
* Objective-C error recovery. This patch makes a quickFariborz Jahanian2013-05-131-0/+2
| | | | | | | | | recovery form duplicate method definition error thus preventing doc parsing to loop trying to find comment for the invalid redefinition in a previous declaration. // rdar://13836387 llvm-svn: 181710
* Fix a gcc warning.Rafael Espindola2013-05-131-0/+2
| | | | | | | | | In r181677 I removed this llvm_unreachable and it introduced a gcc warning. Add it back. Thanks to Patrik Hägglund for noticing it. llvm-svn: 181704
* Cleanup handling of UniqueExternalLinkage.Rafael Espindola2013-05-131-45/+30
| | | | | | | | | | | | | This patch renames getLinkage to getLinkageInternal. Only code that needs to handle UniqueExternalLinkage specially should call this. Linkage, as defined in the c++ standard, is provided by getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage. Most places in the compiler actually want isExternallyVisible, which handles UniqueExternalLinkage as internal. llvm-svn: 181677
* C++1y deduced return types: when we deduce a return type for a function whichRichard Smith2013-05-111-2/+10
| | | | | | | we loaded from PCH, if we're building another PCH, create an update record to patch the return type of the earlier declaration. llvm-svn: 181659
* Add support for __wchar_t in -fms-extensions mode.Hans Wennborg2013-05-101-7/+11
| | | | | | | | | | | | | | | | | MSVC provides __wchar_t. This is the same as the built-in wchar_t type from C++, but it is also available with -fno-wchar and in C. The commit changes ASTContext to have two different types for this: - WCharTy is the built-in type used for wchar_t in C++ and __wchar_t. - WideCharTy is the type of a wide character literal. In C++ this is the same as WCharTy, and in C it is an integer type compatible with the type in <stddef.h>. This fixes PR15815. llvm-svn: 181587
* Objective-C: Correctly encode 'retain' and 'copy' for readonly properties.Nico Weber2013-05-081-0/+4
| | | | | | | | | | clang would omit 'C' for 'copy' properties and '&' for 'retain' properties if the property was also 'readonly'. Fix this, which makes clang match gcc4.2's behavior. Fixes PR15928. llvm-svn: 181491
* Grab-bag of bit-field fixes:John McCall2013-05-061-1/+1
| | | | | | | | | | | | | | - References to ObjC bit-field ivars are bit-field lvalues; fixes rdar://13794269, which got me started down this. - Introduce Expr::refersToBitField, switch a couple users to it where semantically important, and comment the difference between this and the existing API. - Discourage Expr::getBitField by making it a bit longer and less general-sounding. - Lock down on const_casts of bit-field gl-values until we hear back from the committee as to whether they're allowed. llvm-svn: 181252
* Add SystemZ supportUlrich Weigand2013-05-061-0/+76
| | | | | | | | | | | | | | This patch then adds all the usual platform-specific pieces for SystemZ: driver support, basic target info, register names and constraints, ABI info and vararg support. It also adds new tests to verify pre-defined macros and inline asm, and updates a test for the minimum alignment change. This version of the patch incorporates feedback from reviews by Eric Christopher and John McCall. Thanks to all reviewers! Patch by Richard Sandiford. llvm-svn: 181211
* Allow targets to define minimum alignment for global variablesUlrich Weigand2013-05-061-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new common code feature that allows platform code to request minimum alignment of global symbols. The background for this is that on SystemZ, the most efficient way to load addresses of global symbol is the LOAD ADDRESS RELATIVE LONG (LARL) instruction. This instruction provides PC-relative addressing, but only to *even* addresses. For this reason, existing compilers will guarantee that global symbols are always aligned to at least 2. [ Since symbols would otherwise already use a default alignment based on their type, this will usually only affect global objects of character type or character arrays. ] GCC also allows creating symbols without that extra alignment by using explicit "aligned" attributes (which then need to be used on both definition and each use of the symbol). To enable support for this with Clang, this patch adds a TargetInfo::MinGlobalAlign variable that provides a global minimum for the alignment of every global object (unless overridden via explicit alignment attribute), and adds code to respect this setting. Within this patch, no platform actually sets the value to anything but the default 1, resulting in no change in behaviour on any existing target. This version of the patch incorporates feedback from reviews by Eric Christopher and John McCall. Thanks to all reviewers! Patch by Richard Sandiford. llvm-svn: 181210
* Reverting r181004 since it has broken test/Sema/wchar.c.Aaron Ballman2013-05-041-3/+2
| | | | llvm-svn: 181122
* Implement most of N3638 (return type deduction for normal functions).Richard Smith2013-05-041-12/+26
| | | | | | | Missing (somewhat ironically) is support for the new deduction rules in lambda functions, plus PCH support for return type patching. llvm-svn: 181108
* Support __wchar_t in -fms-extensions and -fms-compatibility modes.Hans Wennborg2013-05-031-2/+3
| | | | | | | | | | | | | | MSVC provides __wchar_t, either as an alias for the built-in wchar_t type, or as a separate type depending on language (C vs C++) and flags (-fno-wchar). In -fms-extensions, Clang will simply accept __wchar_t as an alias for whatever type is used for wide character literals. In -fms-compatibility, we try to mimic MSVC's behavior by always making __wchar_t a builtin type. This fixes PR15815. llvm-svn: 181004
* [document parsing]: support c++11 type aliasesFariborz Jahanian2013-05-021-1/+1
| | | | | | | with no comment of their own to inherit the comment of their aliased type. // rdar://13752382 llvm-svn: 180924
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-301-4/+13
| | | | | | | | are now two distinct canonical 'AutoType's: one is the undeduced 'auto' placeholder type, and the other is a deduced-but-dependent type. All deduced-to-a-non-dependent-type cases are still non-canonical. llvm-svn: 180789
* documenttion parsing. Provide a c-index testFariborz Jahanian2013-04-261-1/+3
| | | | | | | and limit comment extraction to public c++ bases. // rdar://13647476 llvm-svn: 180646
* document parsing. When a sub-class (c++ Objective-C) missing Fariborz Jahanian2013-04-261-0/+45
| | | | | | | | a comment, grab the first comment found in its class heirarchy. Also, when a category is mossing a comment, grab comment of its primary class. // rdar://13647476 llvm-svn: 180629
* Implement C++1y decltype(auto).Richard Smith2013-04-261-4/+6
| | | | llvm-svn: 180610
* [document parsing]: When tag declaration (but not definition!) Fariborz Jahanian2013-04-171-1/+6
| | | | | | | is part of the decl-specifier-seq of some other declaration, it doesn't get comment. // rdar://12390371 llvm-svn: 179722
* In ASTContext::getOverriddenMethods, call ↵Argyrios Kyrtzidis2013-04-171-2/+2
| | | | | | | | overridden_methods_begin/overridden_methods_end directly. This avoids unnecessary Decl::getASTContext() invocations. llvm-svn: 179653
* Revert "Speed-up ObjCMethodDecl::getOverriddenMethods()."Argyrios Kyrtzidis2013-04-151-35/+2
| | | | | | | | | | | This reverts commit r179436. Due to caching, it was possible that we could miss overridden methods that were introduced by categories later on. Along with reverting the commit I also included a test case that would have caught this. llvm-svn: 179547
* Speed-up ObjCMethodDecl::getOverriddenMethods().Argyrios Kyrtzidis2013-04-131-2/+35
| | | | | | | Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its results instead of re-calculating the categories multiple times. llvm-svn: 179436
* Add an option to parse all comments as documentation commentsDmitri Gribenko2013-04-101-1/+3
| | | | | | Patch by Amin Shali. llvm-svn: 179180
* Don't eagerly deserialize every templated function (and every static dataRichard Smith2013-04-011-1/+9
| | | | | | member inside a class template) when loading a PCH file or module. llvm-svn: 178496
* [ms-cxxabi] Correctly compute the size of member pointersReid Kleckner2013-03-281-4/+1
| | | | | | | | | | | | | | | | | Summary: This also relaxes the requirement on Windows that the member pointer class type be a complete type (http://llvm.org/PR12070). We still ask for a complete type to instantiate any templates (MSVC does this), but if that fails we continue as normal, relying on any inheritance attributes on the declaration. Reviewers: rjmccall CC: triton, timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D568 llvm-svn: 178283
* Further weaken block conversion rules to permit blocks withJohn McCall2013-03-211-10/+25
| | | | | | | | | enum return type to be converted to blocks with any integer type of the same size. rdar://13463504 llvm-svn: 177613
* Revert "Remove a pointless assertion."Bob Wilson2013-03-151-1/+5
| | | | | | | | | This reverts commit r177158. I'm blindly reverting this because it appears to be breaking numerous buildbots. I'll reapply if it doesn't turn out to be the culprit. llvm-svn: 177165
* Remove a pointless assertion.Nico Weber2013-03-151-5/+1
| | | | | | | | | FindNodeOrInsertPos() is called 10 lines earlier already, and the function early-returns there if the result is != 0. InsertPos isn't recomputed after that check, so this assert is always trivially true. (And it has nothing to do with if T is canonical or not.) llvm-svn: 177158
* Remove a bogus assert so we don't crash inRafael Espindola2013-03-121-2/+0
| | | | | | | | | | | namespace { struct X {}; } extern "C" { X b = X(); } llvm-svn: 176866
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-15/+21
| | | | | | No (intended) functionality change. llvm-svn: 176726
* Promote atomic type sizes up to a power of two, capped byJohn McCall2013-03-071-8/+11
| | | | | | | | MaxAtomicPromoteWidth. Fix a ton of terrible bugs with _Atomic types and (non-intrinsic-mediated) loads and stores thereto. llvm-svn: 176658
* Streamify getNameForDiagnostic and remove the string versions of ↵Benjamin Kramer2013-02-221-4/+2
| | | | | | PrintTemplateArgumentList. llvm-svn: 175894
* Comment parsing: add CommentOptions to allow specifying custom comment block ↵Dmitri Gribenko2013-02-221-1/+1
| | | | | | | | | | | | | | | | commands Add an ability to specify custom documentation block comment commands via a new class CommentOptions. The intention is that this class will hold future customizations for comment parsing, including defining documentation comments with specific numbers of parameters, etc. CommentOptions instance is a member of LangOptions. CommentOptions is controlled by a new command-line parameter -fcomment-block-commands=Foo,Bar,Baz. llvm-svn: 175892
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-1/+1
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-2/+2
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
OpenPOWER on IntegriCloud