summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AttributeImpl.h
Commit message (Collapse)AuthorAgeFilesLines
* llvm/lib/IR/AttributeImpl.h: Move comment block not to cover typedef, ↵NAKAMURA Takumi2015-08-061-2/+2
| | | | | | introduced in r244164. [-Wdocumentation] llvm-svn: 244204
* Add a TrailingObjects template class.James Y Knight2015-08-051-18/+19
| | | | | | | | | | This is intended to help support the idiom of a class that has some other objects (or multiple arrays of different types of objects) appended on the end, which is used quite heavily in clang. Differential Revision: http://reviews.llvm.org/D11272 llvm-svn: 244164
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Tweak wording of alignment static_assert messages.James Y Knight2015-06-171-6/+7
| | | | llvm-svn: 239907
* Fix alignment issues in LLVM.James Y Knight2015-06-171-2/+11
| | | | | | | | | | | | | | | | | | Adds static_asserts to ensure alignment of concatenated objects is correct, and fixes them where they are not. Also changes the definition of AlignOf to use constexpr, except on MSVC, to avoid enum comparison warnings from GCC. (There's not too much of this in llvm itself, most of the fun is in clang). This seems to make LLVM actually work without Bus Error on 32bit sparc. Differential Revision: http://reviews.llvm.org/D10271 llvm-svn: 239872
* Add missing dereferenceable_or_null gettersSanjoy Das2015-05-061-0/+1
| | | | | | | | | | | | | | | | | Summary: Add missing dereferenceable_or_null getters required for http://reviews.llvm.org/D9253 change. Separated from the D9253 review. Patch by Artur Pilipenko! Reviewers: sanjoy Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9499 llvm-svn: 236615
* [IR] Introduce a dereferenceable_or_null(N) attribute.Sanjoy Das2015-04-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If a pointer is marked as dereferenceable_or_null(N), LLVM assumes it is either `null` or `dereferenceable(N)` or both. This change only introduces the attribute and adds a token test case for the `llvm-as` / `llvm-dis`. It does not hook up other parts of the optimizer to actually exploit the attribute -- those changes will come later. For pointers in address space 0, `dereferenceable(N)` is now exactly equivalent to `dereferenceable_or_null(N)` && `nonnull`. For other address spaces, `dereferenceable(N)` is potentially weaker than `dereferenceable_or_null(N)` && `nonnull` (since we could have a null `dereferenceable(N)` pointer). The motivating case for this change is Java (and other managed languages), where pointers are either `null` or dereferenceable up to some usually known-at-compile-time constant offset. Reviewers: rafael, hfinkel Reviewed By: hfinkel Subscribers: nicholas, llvm-commits Differential Revision: http://reviews.llvm.org/D8650 llvm-svn: 235132
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-6/+6
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* Add a dereferenceable attributeHal Finkel2014-07-181-1/+3
| | | | | | | | | This attribute indicates that the parameter or return pointer is dereferenceable. Practically speaking, loads from such a pointer within the associated byte range are safe to speculatively execute. Such pointer parameters are common in source languages (C++ references, for example). llvm-svn: 213385
* Rename AlignAttribute to IntAttributeHal Finkel2014-07-181-9/+9
| | | | | | | | | | | | Currently the only kind of integer IR attributes that we have are alignment attributes, and so the attribute kind that takes an integer parameter is called AlignAttr, but that will change (we'll soon be adding a dereferenceable attribute that also takes an integer value). Accordingly, rename AlignAttribute to IntAttribute (class names, enums, etc.). No functionality change intended. llvm-svn: 213352
* [C++11] Add 'override' keyword to IR library.Craig Topper2014-03-051-1/+1
| | | | llvm-svn: 202939
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-191-0/+3
| | | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 195064
* Revert r194865 and r194874.Alexey Samsonov2013-11-181-0/+2
| | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. llvm-svn: 194997
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-151-2/+0
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 194865
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-111-6/+6
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. llvm-svn: 190536
* Give internal classes hidden visibility.Benjamin Kramer2013-09-111-6/+6
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. llvm-svn: 190534
* Add a AttributeSetImpl::dump function.Peter Collingbourne2013-08-021-0/+2
| | | | | | | This is for the benefit of those of us with inferior debuggers which do not permit member function calls on value types. llvm-svn: 187685
* Make one of the AttributeSet ctors maintain the invariant that thePeter Collingbourne2013-08-021-0/+9
| | | | | | | | attribute list is ordered by index. Differential Revision: http://llvm-reviews.chandlerc.com/D1265 llvm-svn: 187682
* Reduce the number of indirections in the attributes implementation.Benjamin Kramer2013-07-111-114/+92
| | | | | | | | | | | - Coallocate entires for AttributeSetImpls and Nodes after the class itself. - Remove mutable iterators from immutable classes. - Remove unused context field from AttributeImpl. - Derive Enum/Align/String attribute implementations from AttributeImpl instead of having a whole new inheritance tree for them. - Derive AlignAttributeImpl from EnumAttributeImpl. llvm-svn: 186075
* Now that the underlying issue is fixed, revert r180750 and r180722.Rafael Espindola2013-05-011-1/+1
| | | | | | | | | | | The cause of the windows failures was fixed by r180791. Revert to the state after Sabre's original revert. Original message: revert r179735, it has no testcases, and doesn't really make sense. llvm-svn: 180844
* Change getSlotIndex to return unsigned.Rafael Espindola2013-04-301-2/+2
| | | | | | | | | | | The actual storage was already using unsigned, but the interface was using uint64_t. This is wasteful on 32 bits and looks to be the root causes of a miscompilation on Windows where a value was being sign extended to 64bits to compare with the result of getSlotIndex. Patch by Pasi Parviainen! llvm-svn: 180791
* Revert "revert r179735, it has no testcases, and doesn't really make sense."Reid Kleckner2013-04-291-1/+1
| | | | | | | | | | This un-reverts r179735 and reverts commit r180574. This fixes assertion failures for me locally and should fix the failures on Windows reported widely on llvm-dev. We should check if the bots caught this and if so why not. llvm-svn: 180722
* revert r179735, it has no testcases, and doesn't really make sense.Chris Lattner2013-04-251-1/+1
| | | | llvm-svn: 180574
* Cleanup patch:Bill Wendling2013-04-181-9/+9
| | | | | | | | | | | | | | | Semantics of parameters named Index and Idx were inconsistent between "include/llvm/IR/Attributes.h", "lib/IR/AttributeImpl.h" and "lib/IR/Attributes.cpp": sometimes these were fixed 1-based indexes of IR parameters (or AttributeSet::ReturnIndex for IR return values or AttributeSet::FunctionIndex for IR functions), other times they were the internal slot for storage in the underlying AttributeSetImpl. I renamed usage of the former to "Index" and usage of the latter to "Slot" ("Slot" was already being used consistently for the latter in a subset of cases) Patch by Stephen Lin! llvm-svn: 179791
* Add an option `-enable-old-style-attr-syntax' to print out function ↵Bill Wendling2013-04-171-1/+1
| | | | | | | | | | attributes in the "old" style. It's sometimes beneficial to emit a testcase with the old style attribute syntax. Allow someone to do this. <rdar://problem/13563209> llvm-svn: 179735
* Don't add the 'Value' string if there isn't one.Bill Wendling2013-02-281-1/+1
| | | | | | | | This was causing the folding set to fail to fold attributes, because it was being calculated in one spot without an empty values string but here with an empty values string. llvm-svn: 176301
* Add some accessor and query methods for retrieving Attribute objects and such.Bill Wendling2013-02-131-0/+4
| | | | llvm-svn: 175046
* Add support for printing out the attribute groups.Bill Wendling2013-02-111-1/+1
| | | | | | | | | | | | This emits the attribute groups that are used by the functions. (It currently doesn't print out return type or parameter attributes within attribute groups.) Note: The functions still retrieve their attributes from the "old" bitcode format (using the deprecated 'Raw()' method). This means that string attributes within an attribute group will not show up during a disassembly. This will be addressed in a future commit. llvm-svn: 174867
* Remove unused private field to suppress a build warning.Craig Topper2013-02-061-1/+0
| | | | llvm-svn: 174491
* Convert to storing the attribute's internals as enums, integers, and strings.Bill Wendling2013-02-051-21/+101
| | | | | | | | The stuff we're handing are all enums (Attribute::AttrKind), integers and strings. Don't convert them to Constants, which is an unnecessary step here. The rest of the changes are mostly mechanical. llvm-svn: 174456
* Use the AttributeSet's iterators.Bill Wendling2013-02-021-1/+0
| | | | | | | Use the AttributeSet's iterators in AttrBuilder::hasAttributes() when determining of the intersection of the AttrBuilder and AttributeSet is non-null. llvm-svn: 174250
* Change the AttributeImpl to hold a single Constant* for the values.Bill Wendling2013-02-011-12/+10
| | | | | | This Constant could be an aggregate to represent multiple values. llvm-svn: 174228
* Remove some dead code, improve some asserts, and other assorted changes. No ↵Bill Wendling2013-02-011-7/+2
| | | | | | functionality change. llvm-svn: 174132
* Remove one of the odious 'Raw' methods.Bill Wendling2013-02-011-2/+1
| | | | llvm-svn: 174130
* Remove the AttrBuilder form of the Attribute::get creators.Bill Wendling2013-01-311-0/+2
| | | | | | | | | | | | | The AttrBuilder is for building a collection of attributes. The Attribute object holds only one attribute. So it's not really useful for the Attribute object to have a creator which takes an AttrBuilder. This has two fallouts: 1. The AttrBuilder no longer holds its internal attributes in a bit-mask form. 2. The attributes are now ordered alphabetically (hence why the tests have changed). llvm-svn: 174110
* Add support for emitting a string attribute.Bill Wendling2013-01-311-3/+4
| | | | | | | | | | Attributes that are strings are typically target-dependent attributes. They are of this form in the IR: "attr" "attr" = "val" llvm-svn: 174090
* Remove the Attribute::hasAttributes() function.Bill Wendling2013-01-311-1/+0
| | | | | | | That function doesn't make sense anymore because there's only one attribute per Attribute object now. llvm-svn: 174044
* Revert r174026, "Remove Attribute::hasAttributes() and make ↵NAKAMURA Takumi2013-01-311-0/+1
| | | | | | | | Attribute::hasAttribute() private." It broke many hosts to crash. llvm-svn: 174035
* Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private.Bill Wendling2013-01-311-1/+0
| | | | | | | | The Attribute::hasAttributes() is kind of meaningless since an Attribute can have only one attribute. And we would rather people use the 'operator==' instead of Attribute::hasAttribute(). llvm-svn: 174026
* s/Data/Kind/g. No functionality change.Bill Wendling2013-01-291-6/+9
| | | | llvm-svn: 173827
* Convert getAttributes() to return an AttributeSetNode.Bill Wendling2013-01-291-0/+14
| | | | | | | The AttributeSetNode contains all of the attributes. This removes one (hopefully last) use of the Attribute class as a container of multiple attributes. llvm-svn: 173761
* Reorder some functions and add comments. No functionality change.Bill Wendling2013-01-291-11/+14
| | | | llvm-svn: 173733
* Try to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.Bill Wendling2013-01-281-3/+3
| | | | llvm-svn: 173725
* Remove the AttributeWithIndex class.Bill Wendling2013-01-281-14/+5
| | | | | | | The AttributeWithIndex class exposed the interior structure of the AttributeSet class. That was gross. Remove it and all of the code that relied upon it. llvm-svn: 173722
* Remove a use of AttributeWithIndex.Bill Wendling2013-01-281-2/+18
| | | | | | | | | | We want to remove AttributeWithIndex because it provides a non-encapsulated view of the AttributeSetImpl object. Instead, use accessor methods and iterators. Eventually, this code can be simplified because the Attribute object will hold only one attribute instead of multiple attributes. llvm-svn: 173641
* Use proper return type for attribute index.Bill Wendling2013-01-271-1/+1
| | | | llvm-svn: 173638
* Push the calculation of the 'Raw' attribute mask down into the ↵Bill Wendling2013-01-271-0/+3
| | | | | | implementation. It in turn uses the correct list for calculating the 'Raw' value. llvm-svn: 173637
* Privitize some the copy c'tor and assignment operator of uniquified objects.Bill Wendling2013-01-271-0/+8
| | | | llvm-svn: 173632
OpenPOWER on IntegriCloud