summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVTT.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-15/+15
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* Recommit r324107 again.Rafael Espindola2018-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The difference from the previous try is that we no longer directly access function declarations from position independent executables. It should work, but currently doesn't with some linkers. It now includes a fix to not mark available_externally definitions as dso_local. Original message: Start setting dso_local in clang. This starts adding dso_local to clang. The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go away. My objective for now is to move enough of it to clang to remove the need for the TargetMachine one to handle PIE copy relocations and -fno-plt. With that it should then be easy to implement a -fno-copy-reloc in clang. This patch just adds the cases where we assume a symbol to be local based on the file being compiled for an executable or a shared library. llvm-svn: 324535
* Revert "Recommit r324107."Rafael Espindola2018-02-071-1/+1
| | | | | | | | | | | | | | This reverts commit r324500. The bots found two failures: ThreadSanitizer-x86_64 :: Linux/pie_no_aslr.cc ThreadSanitizer-x86_64 :: pie_test.cc when using gold. The issue is a limitation in gold when building pie binaries. I will investigate how to work around it. llvm-svn: 324505
* Recommit r324107.Rafael Espindola2018-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | It now includes a fix to not mark available_externally definitions as dso_local. Original message: Start setting dso_local in clang. This starts adding dso_local to clang. The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go away. My objective for now is to move enough of it to clang to remove the need for the TargetMachine one to handle PIE copy relocations and -fno-plt. With that it should then be easy to implement a -fno-copy-reloc in clang. This patch just adds the cases where we assume a symbol to be local based on the file being compiled for an executable or a shared library. llvm-svn: 324500
* Don't pass ForDefinition_t in places it is redundant.Rafael Espindola2018-02-071-1/+1
| | | | | | | | | | | | | | I found this while looking at the ppc failures caused by the dso_local change. The issue was that the patch would produce the wrong answer for available_externally. Having ForDefinition_t available in places where the code can just check the linkage is a bit of a foot gun. This patch removes the ForDefiniton_t argument in places where the linkage is already know. llvm-svn: 324499
* Revert "Start setting dso_local in clang."Rafael Espindola2018-02-021-1/+1
| | | | | | | | This reverts commit r324107. I will have to test it on OS X. llvm-svn: 324108
* Start setting dso_local in clang.Rafael Espindola2018-02-021-1/+1
| | | | | | | | | | | | | | | | This starts adding dso_local to clang. The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go away. My objective for now is to move enough of it to clang to remove the need for the TargetMachine one to handle PIE copy relocations and -fno-plt. With that it should then be easy to implement a -fno-copy-reloc in clang. This patch just adds the cases where we assume a symbol to be local based on the file being compiled for an executable or a shared library. llvm-svn: 324107
* Reland "Fix vtable not receiving hidden visibility when using push(visibility)"Jake Ehrlich2017-11-291-1/+1
| | | | | | | | | | I had to reland this change in order to make the test work on windows This change should resolve https://bugs.llvm.org/show_bug.cgi?id=35022 https://reviews.llvm.org/D39627 llvm-svn: 319269
* Revert "[CodeGen] Fix vtable not receiving hidden visibility when using ↵Petr Hosek2017-11-221-1/+1
| | | | | | | | push(visibility)" This reverts commit r318853: tests are failing on Windows bots llvm-svn: 318866
* [CodeGen] Fix vtable not receiving hidden visibility when using push(visibility)Petr Hosek2017-11-221-1/+1
| | | | | | | | | | This change should resolve https://bugs.llvm.org/show_bug.cgi?id=35022 Patch by Jake Ehrlich Differential Revision: https://reviews.llvm.org/D39627 llvm-svn: 318853
* CodeGen: Start using inrange annotations on vtable getelementptr.Peter Collingbourne2016-12-131-2/+3
| | | | | | | | | | | | This annotation allows the optimizer to split vtable groups, as permitted by a change to the Itanium ABI [1] that prevents compilers from adjusting virtual table pointers between virtual tables. [1] https://github.com/MentorEmbedded/cxx-abi/pull/7 Differential Revision: https://reviews.llvm.org/D24431 llvm-svn: 289585
* CodeGen: New vtable group representation: struct of vtable arrays.Peter Collingbourne2016-12-131-5/+6
| | | | | | | | | In a future change, this representation will allow us to use the new inrange annotation on getelementptr to allow the optimizer to split vtable groups. Differential Revision: https://reviews.llvm.org/D22296 llvm-svn: 289584
* Update clang for D20348Peter Collingbourne2016-06-141-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20339 llvm-svn: 272710
* CodeGen: Use 32-bit gep offsets to address vtable address points.Peter Collingbourne2016-03-141-3/+3
| | | | | | | | | | | | | | | | | The relative vtable ABI will use a struct rather than an array as the type of a vtable. LLVM only allows 32-bit integers as struct indices, so we need to use 32-bit integers to get addresses of address points. In order to keep the code simple, we might as well do that unconditionally. It's probably a reasonable implementation limit to support no more than 2 billion virtual functions per class. This change causes quite a bit of churn in the test suite, so I'm making it separately. Differential Revision: http://reviews.llvm.org/D18113 llvm-svn: 263469
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-131-1/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* Prune trailing LF.NAKAMURA Takumi2015-05-091-1/+0
| | | | llvm-svn: 236938
* Revert r236879, "Do not emit thunks with available_externally linkage in ↵NAKAMURA Takumi2015-05-091-1/+3
| | | | | | | | comdats" It broke pecoff, at least i686-cygwin. llvm-svn: 236937
* Do not emit thunks with available_externally linkage in comdatsDerek Schuff2015-05-081-3/+1
| | | | | | | | | | | | | | Functions with available_externally linkage will not be emitted to object files (they will just be undefined symbols), so it does not make sense to put them in comdats. Creates a second overload of maybeSetTrivialComdat that uses the GlobalObject instead of the Decl, and uses that in several places that had the faulty logic. Differential Revision: http://reviews.llvm.org/D9580 llvm-svn: 236879
* [opaque pointer type] Update for GEP API changes in LLVMDavid Blaikie2015-04-021-6/+6
| | | | | | | | | | Now the GEP constant utility functions require the type to be explicitly passed (since eventually the pointer type will be opaque and not convey the required type information). For now callers can still pass nullptr (though none were needed here in Clang, which is nice) if convenienc/necessary, but eventually that will be disallowed as well. llvm-svn: 233937
* Use a trivial comdat for C++ tables.Rafael Espindola2015-01-151-0/+3
| | | | | | | | | This produces comdats for vtables, typeinfo, typeinfo names, and vtts. When combined with llvm not producing implicit comdats, not doing this would cause code bloat on ELF and link errors on COFF. llvm-svn: 226227
* Remove the -fhidden-weak-vtables -cc1 option. It was dead,John McCall2014-02-081-1/+1
| | | | | | gross, and increasingly replaced through other mechanisms. llvm-svn: 201011
* Eliminate the ItaniumVTableContext object from CodeGenVTablesReid Kleckner2013-12-201-1/+2
| | | | | | | | | | | | | Now CodeGenVTables has only one VTableContext object, which is either Itanium or Microsoft. Fixes a FIXME with no functionality change intended. Ideally we could avoid the downcasts by pushing the things that reference the Itanium vtable context into ItaniumCXXABI.cpp, but we're not there yet. llvm-svn: 197845
* Fix vbtable indices when a class shares the vbptr with a non-virtual baseTimur Iskhodzhanov2013-11-051-2/+2
| | | | llvm-svn: 194082
* Extract ABI-specific parts of MangleContext into separate classesTimur Iskhodzhanov2013-10-031-1/+2
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D1807 llvm-svn: 191878
* Abstract out the emission of vtables, add basic support for vtable emission ↵Timur Iskhodzhanov2013-09-271-4/+5
| | | | | | | | when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1532 llvm-svn: 191523
* [ms-cxxabi] Move CodeGenVTables::needsVTTParameter to ItaniumCXXABI.Peter Collingbourne2013-06-281-18/+0
| | | | | | | | | This function only makes sense there. Eventually it should no longer be part of the CGCXXABI interface, as it is an Itanium-specific detail. Differential Revision: http://llvm-reviews.chandlerc.com/D821 llvm-svn: 185213
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-5/+2
| | | | | | CodeGenModule. llvm-svn: 149943
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Remove obsolete debugging macro, make helper static.Benjamin Kramer2011-10-221-7/+5
| | | | llvm-svn: 142730
* Move all vtable layout data into new VTableLayout classPeter Collingbourne2011-09-261-1/+2
| | | | llvm-svn: 140506
* Move vtable component accessors to VTableContextPeter Collingbourne2011-09-261-1/+1
| | | | llvm-svn: 140504
* Remove CodeGenVTables::ComputeVTableRelatedInformation dependency on CodeGenPeter Collingbourne2011-09-261-1/+2
| | | | llvm-svn: 140503
* Move VTT builder to ASTPeter Collingbourne2011-09-261-337/+1
| | | | llvm-svn: 140501
* Remove CodeGenModule field from VTTBuilderPeter Collingbourne2011-09-261-11/+11
| | | | llvm-svn: 140499
* Make the VTTBuilder class independent of LLVM corePeter Collingbourne2011-09-261-95/+128
| | | | llvm-svn: 140498
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | 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-5/+5
| | | | llvm-svn: 135370
* Replace the existing forms of ConstantArray::get() with a single formJay Foad2011-06-221-2/+1
| | | | | | that takes an ArrayRef. llvm-svn: 133615
* Fix another regression from the "skip vtable pointer initialization"Anders Carlsson2011-05-161-0/+2
| | | | | | | optimization. Make sure to require a vtable when trying to get the address of a VTT, otherwise we would never end up emitting the VTT. llvm-svn: 131400
* We were emitting construction v-tables with internal linkage all the time.John McCall2011-03-271-4/+16
| | | | | | | | | | | | | | | Emit them instead with the linkage of the VTT. I'm actually really ambivalent about this; it's what GCC does, but outside of improving code size (if the linkage is coalescing), I'm not sure it's at all relevant. Construction vtables are naturally referenced only by the VTT, which is itself only referenced by complete-object constructors and destructors; giving the construction vtables possibly-external linkage is important if you have an optimization that drills through the VTT to a reference to a particular construction vtable which it cannot just emit itself. llvm-svn: 128374
* Convert the BaseOffset member of BaseSubobject to CharUnits from bits. NoKen Dyck2011-03-241-12/+13
| | | | | | change in functionality intended. llvm-svn: 128190
* For consistency, use llvm::raw_ostream in the rest of the mangle api.Rafael Espindola2011-02-111-1/+3
| | | | llvm-svn: 125360
* Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum ↵Anders Carlsson2011-01-291-1/+1
| | | | | | instead of an "IsForRTTI" flag. llvm-svn: 124546
* Give VTTs the right visibility.Anders Carlsson2011-01-291-0/+3
| | | | llvm-svn: 124540
* Make emitting a VTT a two-step process, much like emitting a VTable. You ↵Anders Carlsson2011-01-291-42/+31
| | | | | | first get the address of the VTT, and then pass it to EmitVTTDefinition. llvm-svn: 124539
* Also set unnamed_addr on declarations.Rafael Espindola2011-01-151-2/+1
| | | | llvm-svn: 123531
* Only add unnamed_addr to definitions.Rafael Espindola2011-01-131-1/+2
| | | | llvm-svn: 123354
* Set unnamed_addr in VTTs.Rafael Espindola2011-01-111-0/+1
| | | | llvm-svn: 123280
* Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.Anders Carlsson2010-11-241-1/+1
| | | | llvm-svn: 120133
OpenPOWER on IntegriCloud