summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGRecordLayout.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-9/+9
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* Make CodeGen headers self-contained.Benjamin Kramer2016-02-021-1/+1
| | | | llvm-svn: 259518
* Respect alignment of nested bitfieldsUlrich Weigand2015-07-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tools/clang/test/CodeGen/packed-nest-unpacked.c contains this test: struct XBitfield { unsigned b1 : 10; unsigned b2 : 12; unsigned b3 : 10; }; struct YBitfield { char x; struct XBitfield y; } __attribute((packed)); struct YBitfield gbitfield; unsigned test7() { // CHECK: @test7 // CHECK: load i32, i32* getelementptr inbounds (%struct.YBitfield, %struct.YBitfield* @gbitfield, i32 0, i32 1, i32 0), align 4 return gbitfield.y.b2; } The "align 4" is actually wrong. Accessing all of "gbitfield.y" as a single i32 is of course possible, but that still doesn't make it 4-byte aligned as it remains packed at offset 1 in the surrounding gbitfield object. This alignment was changed by commit r169489, which also introduced changes to bitfield access code in CGExpr.cpp. Code before that change used to take into account *both* the alignment of the field to be accessed within the current struct, *and* the alignment of that outer struct itself; this logic was removed by the above commit. Neglecting to consider both values can cause incorrect code to be generated (I've seen an unaligned access crash on SystemZ due to this bug). In order to always use the best known alignment value, this patch removes the CGBitFieldInfo::StorageAlignment member and replaces it with a StorageOffset member specifying the offset from the start of the surrounding struct to the bitfield's underlying storage. This offset can then be combined with the best-known alignment for a bitfield access lvalue to determine the alignment to use when accessing the bitfield's storage. Differential Revision: http://reviews.llvm.org/D11034 llvm-svn: 241916
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-2/+2
| | | | | | requiring the macro. NFC; Clang edition. llvm-svn: 229339
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-131-2/+2
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-191-0/+2
| | | | | | imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations. llvm-svn: 206680
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-2/+2
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-1/+1
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* Rework the bitfield access IR generation to address PR13619 andChandler Carruth2012-12-061-119/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | generally support the C++11 memory model requirements for bitfield accesses by relying more heavily on LLVM's memory model. The primary change this introduces is to move from a manually aligned and strided access pattern across the bits of the bitfield to a much simpler lump access of all bits in the bitfield followed by math to extract the bits relevant for the particular field. This simplifies the code significantly, but relies on LLVM to intelligently lowering these integers. I have tested LLVM's lowering both synthetically and in benchmarks. The lowering appears to be functional, and there are no really significant performance regressions. Different code patterns accessing bitfields will vary in how this impacts them. The only real regressions I'm seeing are a few patterns where the LLVM code generation for loads that feed directly into a mask operation don't take advantage of the x86 ability to do a smaller load and a cheap zero-extension. This doesn't regress any benchmark in the nightly test suite on my box past the noise threshold, but my box is quite noisy. I'll be watching the LNT numbers, and will look into further improvements to the LLVM lowering as needed. llvm-svn: 169489
* Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Dmitri Gribenko2012-09-151-2/+2
| | | | llvm-svn: 163983
* Propagate lvalue alignment into bitfields. Per report on cfe-dev.Eli Friedman2012-06-271-6/+1
| | | | llvm-svn: 159295
* clean up forward declarations of raw_ostream to use the new LLVM.hChris Lattner2011-07-231-3/+4
| | | | | | patch by Jon Mulder! llvm-svn: 135851
* add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.Chris Lattner2011-07-201-2/+2
| | | | llvm-svn: 135577
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-8/+8
| | | | llvm-svn: 134831
* Convert AccessInfo::AccessAlignment to CharUnits. No change in functionalityKen Dyck2011-04-241-1/+1
| | | | | | intended. llvm-svn: 130087
* Convert CGBitFieldInfo::FieldByteOffset to CharUnits. No change inKen Dyck2011-04-241-1/+2
| | | | | | functionality intended. llvm-svn: 130085
* Perform zero-initialization of virtual base classes when emitting John McCall2011-02-151-21/+50
| | | | | | | | | | | | a zero constant for a complete class. rdar://problem/8424975 To make this happen, track the field indexes for virtual bases in the complete object. I'm curious whether we might be better off making CGRecordLayoutBuilder *much* more reliant on ASTRecordLayout; we're currently duplicating an awful lot of the ABI layout logic. llvm-svn: 125555
* A CGRecordLayout object persists. Since its contained types mayJohn McCall2010-11-301-4/+5
| | | | | | | refer to opaque types, they must be held via PATypeHolders. I'm not sure why this hasn't blown up before. llvm-svn: 120491
* CGRecordLayout types are always struct types.Anders Carlsson2010-11-241-7/+7
| | | | llvm-svn: 120106
* Rename BaseLLVMType to NonVirtualBaseLLVMType.Anders Carlsson2010-11-211-5/+6
| | | | llvm-svn: 119956
* Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as ↵Anders Carlsson2010-11-091-3/+13
| | | | | | a first step towards fixing PR6995. llvm-svn: 118491
* IRgen: Move CGBitFieldInfo strategy computation helpers to static memberDaniel Dunbar2010-09-021-0/+15
| | | | | | functions. llvm-svn: 112913
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-6/+7
| | | | | | | | | Make CGT defer to the ABI on all member pointer types. This requires giving CGT a handle to the ABI. It's way easier to make that work if we avoid lazily creating the ABI. Make it so. llvm-svn: 111786
* Keep track of the LLVM field numbers for non-virtual bases.Anders Carlsson2010-05-181-0/+9
| | | | llvm-svn: 104013
* Fix comments.Daniel Dunbar2010-04-271-3/+3
| | | | llvm-svn: 102429
* IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor ↵Daniel Dunbar2010-04-151-10/+27
| | | | | | | | arguments, it is now an immutable object. Also, add some checking of various invariants that should hold on the CGBitFieldInfo access. llvm-svn: 101345
* IRgen: Eliminate now unused fields from CGBitFieldInfo.Daniel Dunbar2010-04-151-12/+9
| | | | llvm-svn: 101344
* IRgen: Tweak CGBitFieldInfo doxyments & add an accessor.Daniel Dunbar2010-04-141-0/+10
| | | | llvm-svn: 101221
* IRgen: Enhance CGBitFieldInfo with enough information to fully describe the ↵Daniel Dunbar2010-04-131-1/+83
| | | | | | | | | | "policy" with which a bit-field should be accessed. - For now, these policies are computed to match the current IRgen strategy, although the new information isn't being used yet (except in -fdump-record-layouts). - Design comments appreciated. llvm-svn: 101178
* IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of ↵Daniel Dunbar2010-04-121-0/+9
| | | | | | -fdump-record-layouts. llvm-svn: 101051
* IRgen: Move the bit-field access type into CGBitFieldInfo, and change ↵Daniel Dunbar2010-04-081-3/+6
| | | | | | bit-field LValues to just store the base address of object containing the bit-field. llvm-svn: 100745
* IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.Daniel Dunbar2010-04-061-2/+4
| | | | llvm-svn: 100513
* IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.Daniel Dunbar2010-04-051-15/+13
| | | | llvm-svn: 100433
* IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out ↵Daniel Dunbar2010-03-311-4/+47
| | | | | | | | of CodeGenTypes, to per-record CGRecordLayout structures. - I did a cursory check that this was perf neutral, FWIW. llvm-svn: 99978
* IRGen: Hide CGRecordLayoutBuilder class, because I can.Daniel Dunbar2010-03-311-0/+4
| | | | llvm-svn: 99967
* IRgen: Move CGRecordLayout to its own happy little file.Daniel Dunbar2010-03-301-0/+48
llvm-svn: 99945
OpenPOWER on IntegriCloud