| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Found by inspection.
llvm-svn: 190701
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a couple of latent crashes for invalid attributes and also adds a
fixit hint to turn identifiers into string literals if one was expected. It then
proceeds recovery as if the identifier was a literal. Diagnostic locations are
also changed to point at the literal instead of the attribute if the error
concerns the argument. PR17175.
For example:
hidden.c:1:40: error: 'visibility' attribute requires a string
extern int x __attribute__((visibility(hidden)));
^
" "
hidden.c:2:29: error: visibility does not match previous declaration
extern int x __attribute__((visibility("default")));
^
hidden.c:1:29: note: previous attribute is here
extern int x __attribute__((visibility(hidden)));
^
llvm-svn: 190699
|
|
|
|
|
|
| |
arguments to map strings to the proper enumeration value. This makes error checking more consistent and reduces the amount of hand-written code required.
llvm-svn: 190545
|
|
|
|
|
|
| |
argument. Instead, it takes an expression that is fully resolved.
llvm-svn: 190476
|
|
|
|
|
|
| |
clang-x86_64-darwin11-nobootstrap-RAincremental.
llvm-svn: 190393
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR16752: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width.
2. Fix handleModeAttr according to new methods in TargetInfo.
Fixes:
1st Commit (Done): Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth
2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function.
llvm-svn: 190391
|
|
|
|
| |
llvm-svn: 190369
|
|
|
|
|
|
| |
This allows for automated checking of the number of arguments expected vs number of arguments given for attributes. Greatly reduces the amount of manual checking required.
llvm-svn: 190368
|
|
|
|
|
|
| |
PR17105.
llvm-svn: 190312
|
|
|
|
|
|
| |
functionality was never completely implemented, and this is an improvement over silently eating the attribute.
llvm-svn: 190303
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specifying the default assumed state for objects of this class
This information is used for return states and pass-by-value parameter
states.
Patch by Chris Wailes.
Review by DeLesley Hutchins and Aaron Ballman.
llvm-svn: 190116
|
|
|
|
|
|
| |
StringArgument since that is a more accurate modeling.
llvm-svn: 189851
|
|
|
|
|
|
|
|
|
|
| |
Patch by chris.wailes@gmail.com
Functions can now declare what state the consumable type the are returning will
be in. This is then used on the caller side and checked on the callee side.
Constructors now use this attribute instead of the 'consumes' attribute.
llvm-svn: 189843
|
|
|
|
|
|
| |
argument list.
llvm-svn: 189711
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by chris.wailes@gmail.com
Adds the 'consumable' attribute that can be attached to classes. This replaces
the previous method of scanning a class's methods to see if any of them have
consumed analysis attributes attached to them. If consumed analysis attributes
are attached to methods of a class that isn't marked 'consumable' a warning
is generated.
llvm-svn: 189702
|
|
|
|
|
|
| |
Based on a patch by Benno Rice!
llvm-svn: 189644
|
|
|
|
|
|
| |
do anything useful.
llvm-svn: 189548
|
|
|
|
|
|
| |
CUDAHost are now handled as inheritable attributes. In all three cases, this makes the processing behavior more consistent with the declared behavior in Attr.td.
llvm-svn: 189532
|
|
|
|
|
|
| |
attribute where it is not processed as part of the typical Sema attribute functionality. Specifying this attribute as being "ignored" because there is no sema handler for it as a Decl attribute, and no AST node generated for it.
llvm-svn: 189284
|
|
|
|
|
|
| |
Patch thanks to Christian Wailes!
llvm-svn: 188940
|
|
|
|
|
|
| |
Patch thanks to Christian Wailes!
llvm-svn: 188934
|
|
|
|
|
|
|
| |
Before this patch we would warn and drop the attribute in
extern const char test3[] __attribute__((used)) = "";
llvm-svn: 188588
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewed by delesley, dblaikie.
Add the annotations and code needed to support a basic 'consumed' analysis.
Summary:
This new analysis is based on academic literature on linear types. It tracks
the state of a value, either as unconsumed, consumed, or unknown. Methods are
then annotated as CallableWhenUnconsumed, and when an annotated method is
called while the value is in the 'consumed' state a warning is issued. A value
may be tested in the conditional statement of an if-statement; when this occurs
we know the state of the value in the different branches, and this information
is added to our analysis. The code is still highly experimental, and the names
of annotations or the algorithm may be subject to change.
llvm-svn: 188206
|
|
|
|
|
|
|
|
|
| |
Make sure we can properly generate code when the UUID has curly braces
on it, strip the curly braces at the sema layer.
This fixes PR16813.
llvm-svn: 188061
|
|
|
|
|
|
| |
err_attribute_argument_type.
llvm-svn: 187420
|
|
|
|
| |
llvm-svn: 187419
|
|
|
|
| |
llvm-svn: 187400
|
|
|
|
|
|
| |
of using custom logic. No functional changes intended.
llvm-svn: 187398
|
|
|
|
|
|
| |
Patch by Ethan Jackson.
llvm-svn: 187365
|
|
|
|
|
|
|
|
| |
diagnostic for clarity; updated almost all of the affected test cases.
Thanks to Fariborz Jahanian for the suggestion!
llvm-svn: 186980
|
|
|
|
| |
llvm-svn: 186966
|
|
|
|
|
|
| |
Adding missing test cases for the diagnostics.
llvm-svn: 186944
|
|
|
|
|
|
| |
diagnostic. This makes the diagnostic more consistent.
llvm-svn: 186940
|
|
|
|
|
|
| |
count reported matches reality.
llvm-svn: 186936
|
|
|
|
|
|
|
|
|
| |
The functionality is equivalent to the GCC attribute. Variables of tagged
types will be warned about as unused if they are not used in any way
except for possible (even non-trivial) ctors/dtors called. Useful for tagging
classes like std::string (which is not part of this commit).
llvm-svn: 186765
|
|
|
|
|
|
| |
changes intended.
llvm-svn: 186591
|
|
|
|
|
|
| |
diagnostic's select list. Updates the tests for the more consistent diagnostic.
llvm-svn: 186584
|
|
|
|
|
|
| |
with other attribute handlers, as well as other attribute error messages. Added missing test cases for the unavailable attribute, and updated the deprecated test case.
llvm-svn: 186578
|
|
|
|
| |
llvm-svn: 185715
|
|
|
|
| |
llvm-svn: 185584
|
|
|
|
| |
llvm-svn: 185578
|
|
|
|
| |
llvm-svn: 184493
|
|
|
|
| |
llvm-svn: 184417
|
|
|
|
|
|
|
|
|
|
| |
pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes.
For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx
Patch reviewed by Richard Smith.
llvm-svn: 182535
|
|
|
|
|
|
|
| |
AsmPrinter::EmitLinkage() does not handle dllimport linkage. The LLVM
verifier should also be fixed to reject this.
llvm-svn: 182320
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
selectany only applies to externally visible global variables. It has
the effect of making the data weak_odr.
The MSDN docs suggest that unused definitions can only be dropped at
linktime, so Clang uses weak instead of linkonce. MSVC optimizes away
references to constant selectany data, so it must assume that there is
only one definition, hence weak_odr.
Reviewers: espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D814
llvm-svn: 182266
|
|
|
|
|
|
|
| |
assert_exclusive_lock and assert_shared_lock. These attributes are used to
mark functions that dynamically check (i.e. assert) that a lock is held.
llvm-svn: 182170
|
|
|
|
|
|
|
| |
This shares the warn_attribute_unused diagnostic and reduces the
indentation level. No functionality change.
llvm-svn: 182096
|
|
|
|
|
|
|
|
| |
InitializationSequence::Diagnose()
Patch by Robert Wilhelm.
llvm-svn: 181022
|
|
|
|
|
|
|
|
| |
references thereto.
Patch by Tong Shen!
llvm-svn: 179585
|