summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [C++11] Replacing ObjCObjectType iterators qual_begin() and qual_end() with ↵Aaron Ballman2014-03-171-17/+6
| | | | | | iterator_range quals(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204047
* [C++11] Replacing FunctionProtoType iterators param_type_begin() and ↵Aaron Ballman2014-03-171-13/+5
| | | | | | param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204045
* [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and ↵Aaron Ballman2014-03-141-12/+4
| | | | | | propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203930
* [C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-141-3/+1
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203922
* [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-16/+10
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203863
* [C++11] Replacing ObjCInterfaceDecl iterators known_extensions_begin() and ↵Aaron Ballman2014-03-131-9/+2
| | | | | | known_extensions_end() with iterator_range known_extensions(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203857
* [C++11] Replacing ObjCInterfaceDecl iterators visible_categories_begin() and ↵Aaron Ballman2014-03-131-6/+2
| | | | | | visible_categories_end() with iterator_range visible_categories(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203851
* [C++11] Replacing ObjCInterfaceDecl iterators ivar_begin() and ivar_end() ↵Aaron Ballman2014-03-131-3/+2
| | | | | | with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203849
* [C++11] Replacing ObjCInterfaceDecl iterators ↵Aaron Ballman2014-03-131-3/+1
| | | | | | all_referenced_protocol_begin() and all_referenced_protocol_end() with iterator_range all_referenced_protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203848
* [C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() ↵Aaron Ballman2014-03-131-8/+5
| | | | | | with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203808
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-9/+6
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-7/+4
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* [C++11] Replacing BlockDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-6/+3
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203250
* [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-6/+3
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203248
* [C++11] Replacing iterators redecls_begin() and redecls_end() with ↵Aaron Ballman2014-03-061-12/+8
| | | | | | iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely. llvm-svn: 203179
* [-cxx-abi microsoft] Implement local manglings accuratelyDavid Majnemer2014-03-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The MSVC ABI appears to mangle the lexical scope into the names of statics. Specifically, a counter is incremented whenever a scope is entered where things can be declared in such a way that an ambiguity can arise. For example, a class scope inside of a class scope doesn't do anything interesting because the nested class cannot collide with another nested class. There are problems with this scheme: - It is unreliable. The counter is only incremented when a previously never encountered scope is entered. There are cases where this will cause ambiguity amongst declarations that have the same name where one was introduced in a deep scope while the other was introduced right after in the previous lexical scope. - It is wasteful. Statements like: {{{{{{{ static int foo = a; }}}}}}} will make the mangling of "foo" larger than it need be because the scope counter has been incremented many times. Because of these problems, and practical implementation concerns. We choose not to implement this scheme if the local static or local type isn't visible. The mangling of these declarations will look very similar but the numbering will make far more sense, this scheme is lifted from the Itanium ABI implementation. Reviewers: rsmith, doug.gregor, rnk, eli.friedman, cdavis5x Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2953 llvm-svn: 202951
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-1/+1
| | | | llvm-svn: 202639
* [ASTUnit] Fix use-after-free bug in ↵Argyrios Kyrtzidis2014-02-271-3/+3
| | | | | | | | | | | | | | | ASTUnit::getMainBufferWithPrecompiledPreamble(). With r197755 we started reading the contents of buffer file entries, but the buffers may point to ASTReader blobs that have been disposed. Fix this by having the CompilerInstance object keep a reference to the ASTReader as well as having the ASTContext keep reference to the ExternalASTSource. This was very difficult to construct a test case for. rdar://16149782 llvm-svn: 202346
* AST: Small code cleanupDavid Majnemer2014-02-241-1/+1
| | | | | | | | Move the pointer to be adjacent to the variable instead of the type. No functional change. llvm-svn: 202089
* Sema: Make getPreferredTypeAlign respect alignments specified with an ↵David Majnemer2014-02-241-1/+6
| | | | | | | | | | | | aligned attribute on a typedef When calculating the preferred alignment of a type, consider if a alignment attribute came from a typedef declaration. If one did, do not naturally align the type. Patch by Stephan Tolksdorf, with a little tweaking and an additional testcase by me. llvm-svn: 202088
* [AArch64] Change int64_t from 'long long int' to 'long int' for AArch64 target.Kevin Qin2014-02-241-0/+13
| | | | | | | | | | Most 64-bit targets define int64_t as long int, and AArch64 should make same definition to follow LP64 model. In GNU tool chain, int64_t is defined as long int for 64-bit target. So to get consistent with GNU, it's better Changing int64_t from 'long long int' to 'long int', otherwise clang will get different name mangling suffix compared with g++. llvm-svn: 202004
* Use llvm::DeleteContainerSeconds when possibleReid Kleckner2014-02-191-5/+1
| | | | llvm-svn: 201739
* MS ABI: Mangle member pointer template argumentsReid Kleckner2014-02-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Member pointers are mangled as they would be represented at runtime. They can be a single integer literal, single decl, or a tuple with some more numbers tossed in. With Clang today, most of those numbers will be zero because we reject pointers to members of virtual bases. This change required moving VTableContextBase ownership from CodeGenVTables to ASTContext, because mangling now depends on vtable layout. I also hoisted the inheritance model helpers up to be inline static methods of MSInheritanceAttr. This makes the AST code that deals with member pointers much more readable. MSVC doesn't appear to have stable manglings of null member pointers: - Null data memptrs in function templates have a mangling collision with the first field of a non-polymorphic single inheritance class. - The mangling of null data memptrs changes if you add casts. - Large null function memptrs in class templates crash MSVC. Clang uses the class template mangling for null data memptrs and the function template mangling for null function memptrs to deal with this. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2695 llvm-svn: 200857
* Objective-C. provide legacy encoding of *id and *Class typesFariborz Jahanian2014-01-281-1/+13
| | | | | | instead of crashing. // rdar://15824769. llvm-svn: 200338
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-28/+22
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* ObjectiveC. When issuing property implementation isFariborz Jahanian2014-01-221-31/+34
| | | | | | | | not using backing ivar warning, ignore when property is not being synthesized (user declared its implementation @dynamic). // rdar://1583425 llvm-svn: 199820
* Correct various uses of 'argument' that in fact refer to function parametersAlp Toker2014-01-211-35/+30
| | | | | | Cleanup only. llvm-svn: 199773
* Update FunctionTypeLoc and related names to match r199686Alp Toker2014-01-211-4/+4
| | | | llvm-svn: 199699
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-201-25/+25
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. llvm-svn: 199209
* Delete inaccurate doc comment - isVariadic is long goneAlp Toker2014-01-121-2/+0
| | | | | | The canonical documentation in the header is up-to-date. llvm-svn: 199054
* ObjectiveC. Computation of offsets when doing @encode type encodingFariborz Jahanian2014-01-071-1/+12
| | | | | | is only used in an assert. Do not do it if assert is not on. llvm-svn: 198652
* 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-151-184/+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
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-051-14/+36
| | | | | | | | | | | | | | | | 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
* ObjectiveC ARC. Better checking of toll free briding Fariborz Jahanian2013-11-201-11/+9
| | | | | | | from qualified-id objects to CF types with objc_bridge annotation. // rdar://15454846 llvm-svn: 195264
* ObjectiveC ARC. validate toll free bridge castingFariborz Jahanian2013-11-201-0/+58
| | | | | | | to or from 'id' and qualified-id types. // rdar://15454846 llvm-svn: 195178
* XCore target requires preferred alignment.Robert Lytton2013-11-121-0/+4
| | | | | | | | The xcore llvm backend does not handle 8 byte alignment viz: "%BadAlignment = alloca i64, align 8" So getPreferredTypeAlign() must never overalign. llvm-svn: 194462
* 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-011-2/+6
| | | | | | | | | | | | | 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
* 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
* 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
* Fix getIntegerTypeOrder() to properly handle enums by first unwrapping their ↵Ted Kremenek2013-10-101-0/+15
| | | | | | | | | | | | underlying integer type. This is a precondition for calling getIntegerRank(). Fixes an assertion failure in a test case involving vectors. Fixes <rdar://problem/15091442> Please somebody check this. llvm-svn: 192334
* Extract ABI-specific parts of MangleContext into separate classesTimur Iskhodzhanov2013-10-031-2/+2
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D1807 llvm-svn: 191878
* Variable templates: handle instantiation of static data member templatesRichard Smith2013-09-271-8/+1
| | | | | | appropriately, especially when they appear within class templates. llvm-svn: 191548
* Fix ObjC @encode for C++ classes w/virtual bases.Eli Friedman2013-09-181-1/+2
| | | | | | PR17142. llvm-svn: 190912
* Prune "return" after llvm_unreachable(). It was redundant.NAKAMURA Takumi2013-09-161-1/+0
| | | | llvm-svn: 190774
* ASTContext.cpp: Fix a warning in r190684. [-Wcovered-switch-default]NAKAMURA Takumi2013-09-131-1/+2
| | | | llvm-svn: 190705
* Certain multi-platform languages, such as OpenCL, have the concept ofDavid Tweed2013-09-131-0/+14
| | | | | | | | | | | | | | address spaces which is both (1) a "semantic" concept and (2) possibly a hardware level restriction. It is desirable to be able to discard/merge the LLVM-level address spaces on arguments for which there is no difference to the current backend while keeping track of the semantic address spaces in a funciton prototype. To do this enable addition of the address space into the name-mangling process. Add some tests to document this behaviour against inadvertent changes. Patch by Michele Scandale! llvm-svn: 190684
* [ms-cxxabi] Implement guard variables for static initializationReid Kleckner2013-09-101-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Static locals requiring initialization are not thread safe on Windows. Unfortunately, it's possible to create static locals that are actually externally visible with inline functions and templates. As a result, we have to implement an initialization guard scheme that is compatible with TUs built by MSVC, which makes thread safety prohibitively difficult. MSVC's scheme is that every function that requires a guard gets an i32 bitfield. Each static local is assigned a bit that indicates if it has been initialized, up to 32 bits, at which point a new bitfield is created. MSVC rejects inline functions with more than 32 static locals, and the externally visible mangling (?_B) only allows for one guard variable per function. On Eli's recommendation, I used MangleNumberingContext to track which bit each static corresponds to. Implements PR16888. Reviewers: rjmccall, eli.friedman Differential Revision: http://llvm-reviews.chandlerc.com/D1416 llvm-svn: 190427
OpenPOWER on IntegriCloud