summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGRTTI.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: Refactor RTTI emissionDavid Majnemer2014-07-071-998/+0
| | | | | | | | | | | | | | | | | | | | | | | Let's not expose ABI specific minutia inside of CodeGenModule and Type. Instead, let's abstract it through CXXABI. This gets rid of: CodeGenModule::getCompleteObjectLocator, CodeGenModule::EmitFundamentalTypeDescriptor{s,}, CodeGenModule::getMSTypeDescriptor, CodeGenModule::getMSCompleteObjectLocator, CGCXXABI::shouldRTTIBeUnique, CGCXXABI::classifyRTTIUniqueness. CGRTTI was *almost* entirely centered around providing Itanium-style RTTI information. Instead of providing interfaces that only it consumes, move it to the ItaniumCXXABI implementation file. This allows it to have access to Itanium-specific implementation details without providing useless expansion points for the Microsoft ABI side. Differential Revision: http://reviews.llvm.org/D4261 llvm-svn: 212435
* [MS-ABI] Implements MS-compatible RTTIWarren Hunt2014-05-231-33/+38
| | | | | | | | | | | | | Enables the emission of MS-compatible RTTI data structures for use with typeid, dynamic_cast and exceptions. Does not implement dynamic_cast or exceptions. As an artiface, typeid works in some cases but proper support an testing will coming in a subsequent patch. majnemer has fuzzed the results. Test cases included. Differential Revision: http://reviews.llvm.org/D3833 llvm-svn: 209523
* [C++11] Use 'nullptr'. CodeGen edition.Craig Topper2014-05-211-2/+3
| | | | llvm-svn: 209272
* CodeGen: Don't set hidden visibility on symbols with local linkageDuncan P. N. Exon Smith2014-05-071-1/+4
| | | | llvm-svn: 208258
* CodeGen: Cleanup visibility in RTTIBuilderDuncan P. N. Exon Smith2014-05-051-9/+5
| | | | | | No functionality change. llvm-svn: 207978
* Adding type info for f16c floating-point type. This is consistent with theYunzhong Gao2014-04-171-1/+2
| | | | | | | | Itanium ABI in 2.9.2 Place of Emission. Differential Revision: http://reviews.llvm.org/D2750 llvm-svn: 206439
* RTTI: refactor the uniqueness question into CGCXXABI.Tim Northover2014-03-301-56/+11
| | | | | | | This also brings the code into closer conformance with usual LLVM coding style and other surrounding conventions. llvm-svn: 205158
* CodeGen: Allow different RTTI emission strategiesTim Northover2014-03-291-2/+70
| | | | | | | | Some ABIs and C++ libraries may make different trade-offs in how RTTI is emitted (currently with respect to visibility and so on). This implements one scheme, as used by ARM64. llvm-svn: 205101
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-15/+10
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* RTTI symbols for visible local types may need weak linkage.John McCall2014-03-101-1/+1
| | | | | | | | | | | Previously, we would always emit them with internal linkage, but with hidden visibility when the function was hidden, which is an illegal combination, which could lead LLVM to actually emit them as strong hidden symbols with hilarious results. rdar://16265084 llvm-svn: 203503
* type_info objects are not unnamed_addr: the ABI requires us toJohn McCall2014-02-081-8/+15
| | | | | | | | | | unique them and permits the implementation of dynamic_cast (and anything else which knows it's working with a complete class type) to compare their addresses directly. rdar://16005328 llvm-svn: 201020
* Remove the -fhidden-weak-vtables -cc1 option. It was dead,John McCall2014-02-081-24/+14
| | | | | | gross, and increasingly replaced through other mechanisms. llvm-svn: 201011
* Fix vbtable indices when a class shares the vbptr with a non-virtual baseTimur Iskhodzhanov2013-11-051-1/+1
| | | | llvm-svn: 194082
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-151-1/+1
| | | | llvm-svn: 186300
* Remove dead code.Eli Friedman2013-06-281-55/+2
| | | | llvm-svn: 185231
* Fix linkage computation for derived types in inline functions.Rafael Espindola2013-05-251-0/+1
| | | | | | | | | | | | | | | | | John noticed that the fix for pr15930 (r181981) didn't handle indirect uses of local types. For example, a pointer to local struct, or a function that returns it. One way to implement this would be to recursively look for local types. This would look a lot like the linkage computation itself for types. To avoid code duplication and utilize the existing linkage cache, this patch just makes the computation of "type with no linkage but externally visible because it is from an inline function" part of the linkage computation itself. llvm-svn: 182711
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-301-0/+6
| | | | | | | | 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
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-071-0/+1
| | | | | | restrictions. llvm-svn: 174601
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-251-3/+7
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+1
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+6
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-1017/+1011
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-1011/+1017
| | | | llvm-svn: 170428
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Simplify: replace getContext().getLangOpts() with just getLangOpts().Richard Smith2012-11-011-1/+1
| | | | llvm-svn: 167261
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-271-2/+2
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766 llvm-svn: 164769
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-271-2/+2
| | | | llvm-svn: 164766
* Fix integer unsigned behavior in clang due to signed left shift overflow.Richard Smith2012-08-241-1/+1
| | | | llvm-svn: 162626
* Fix a few -Wdocumentation warnings.Dmitri Gribenko2012-08-241-1/+0
| | | | llvm-svn: 162506
* Reduce duplicated hash map lookups.Benjamin Kramer2012-08-221-8/+4
| | | | llvm-svn: 162361
* Restructure how the driver communicates information about theJohn McCall2012-06-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-4/+4
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-17/+11
| | | | | | CodeGenModule. llvm-svn: 149943
* reapply the patches reverted in r149477, which enable ConstantDataArray.Chris Lattner2012-02-051-1/+2
| | | | llvm-svn: 149801
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-4/+4
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Revert r149363 which was part a series of commits that were reverted in llvmArgyrios Kyrtzidis2012-02-011-2/+1
| | | | | | | | | | | | | | | | | commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c. Original log: ConstantArray::get() (for strings) is going away, use ConstantDataArray::getString instead. Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods that avoid a ton of intermediate Constant*'s for each element (e.g. GetConstantArrayFromStringLiteral). I don't plan on doing this in the short-term though. llvm-svn: 149477
* ConstantArray::get() (for strings) is going away, useChris Lattner2012-01-311-1/+2
| | | | | | | | | | | | ConstantDataArray::getString instead. Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods that avoid a ton of intermediate Constant*'s for each element (e.g. GetConstantArrayFromStringLiteral). I don't plan on doing this in the short-term though. llvm-svn: 149363
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-4/+3
| | | | llvm-svn: 148577
* c++: support gcc's application of weak attribute onFariborz Jahanian2011-10-211-0/+2
| | | | | | | | | | | | | class declaration which forces any such class and any class that inherits from such a class to have their typeinfo symbols be marked as weak. // rdar://10246395 A test/CodeGenCXX/weak-extern-typeinfo.cpp M lib/Sema/SemaDeclCXX.cpp M lib/Sema/SemaDeclAttr.cpp M lib/CodeGen/CGRTTI.cpp llvm-svn: 142693
* More metaprogramming with builtin types.John McCall2011-10-181-4/+4
| | | | llvm-svn: 142433
* Add a new placeholder type to represent "unbridged"John McCall2011-10-171-0/+1
| | | | | | | | casts in ARC. No semantic analysis yet. llvm-svn: 142208
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-0/+1
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Rename TagDecl::isDefinition -> isCompleteDefinitionJohn McCall2011-10-071-1/+1
| | | | | | | for better self-documenting code, since the semantics are subtly different from getDefinition(). llvm-svn: 141355
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-0/+5
| | | | | | | | committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic. Thanks to Jeffrey Yasskin for the thorough review! llvm-svn: 141330
* Create a VTableContext class and start moving CodeGenVTables methods to itPeter Collingbourne2011-09-261-1/+1
| | | | llvm-svn: 140502
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-5/+5
| | | | llvm-svn: 140367
* CodeGen: rename CodeGenModule::Runtime to ObjCRuntimePeter Collingbourne2011-07-271-1/+1
| | | | llvm-svn: 136254
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-5/+5
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-211-1/+1
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-8/+8
| | | | llvm-svn: 135370
OpenPOWER on IntegriCloud