that provides the behavior of the C++11 library trait
std::is_trivially_constructible<T, Args...>, which can't be
implemented purely as a library.
Since __is_trivially_constructible can have zero or more arguments, I
needed to add Yet Another Type Trait Expression Class, this one
handling arbitrary arguments. The next step will be to migrate
UnaryTypeTrait and BinaryTypeTrait over to this new, more general
TypeTrait class.
Fixes the Clang side of <rdar://problem/10895483> / PR12038.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151352 91177308-0d34-0410-b5e6-96231b3b80d8
This option was added in r129614 and doesn't have any use case that I'm aware
of. It's possible that external tools are using these names - and if that's
the case we can certainly reassess the functionality, but for now it lets us
shave out a few unneeded bits from clang.
Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool.
This removes the actual diagnostic name strings from clang entirely.
Reviewed by Chris Lattner & Ted Kremenek.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150612 91177308-0d34-0410-b5e6-96231b3b80d8
address safety analysis (such as e.g. AddressSanitizer or SAFECode) for a specific function.
When building with AddressSanitizer, add AddressSafety function attribute to every generated function
except for those that have __attribute__((no_address_safety_analysis)).
With this patch we will be able to
1. disable AddressSanitizer for a particular function
2. disable AddressSanitizer-hostile optimizations (such as some cases of load widening) when AddressSanitizer is on.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148842 91177308-0d34-0410-b5e6-96231b3b80d8
Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147221 91177308-0d34-0410-b5e6-96231b3b80d8
the release notes despite their awesomeness. If we had a thorough
discussion of the performance of Clang in 2.9 vs. 3.0, the first would
be more relevant, but we don't. The serialization stuff hopefully isn't
terribly visible to end users.
Objections to these omissions are of course welcome. =]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145336 91177308-0d34-0410-b5e6-96231b3b80d8
extensions and one infrastructure feature addition that has a direct
impact on other projects which use Clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145335 91177308-0d34-0410-b5e6-96231b3b80d8
accurate than my original notes were based on IRC conversations. Windows
folks, please edit as needed to make this closer to the truth if I've
still got it wrong.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145309 91177308-0d34-0410-b5e6-96231b3b80d8
add a bit to that section about the many bug-finding warnings that Clang
has grown since 2.9 as this is one of the more visible new additions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145307 91177308-0d34-0410-b5e6-96231b3b80d8
stub for OpenCL work. I can't really dig enough out of the commit log
messages other than to tell that a lot of work went into this in the 2.9
-> 3.0 timeframe. I'll let the folks touching it decide if it merits
a spot in the release notes and provide the appropriate details if so.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145291 91177308-0d34-0410-b5e6-96231b3b80d8
easier. Move the CUDA bits and the C1X/C++11 atomics stuff there. We
haven't exposed a __has_feature for the atomic builtins, so none of this
is available yet...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145288 91177308-0d34-0410-b5e6-96231b3b80d8
The performance improvement was committed after the 3.0 branch.
Constructors/destructors are handled by the CFG, but we do not do anything
special for them in the analyzer yet.
Since we do not have an open source release qualification for the analyzer,
we are not investing into creating the proper release notes for it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145281 91177308-0d34-0410-b5e6-96231b3b80d8
worth noting in the release notes. These remain raw notes. I'll be
re-writing them into nice prose first thing tomorrow, with help from
others. A couple of notes for any reading the commits:
If you don't see something that should be mentioned, feel free to add
a note (or even a nicely written section) about it! I haven't really
done the static analyzer justice here as I don't really know what the
significant changes are other than mile-high stuff like watching it grow
C++ support and a more robust CFG. I also worry I've missed important
stuff in the Objective-C world.
If you see something that isn't worth mentioning, just delete it. I know
there are several things like this. I plan to prune the list down as
I flesh things out.
If you're name or email is on a bullet, I'll likely be sending you an
email asking for any input on that subject. For many of these I can fill
in something generic, and I'll just want you to give it a once-over.
However, if you have time, feel free to just write the blurb yourself
and drop it in, or drop it in an email to me.
Finally, *WOW* has a lot happened in Clang... I shouldn't have dreaded
(and put off) this so much, it was kind of awesome to go back and watch
the evolution. Anyways, these should be in a reasonable draft state
early tomorrow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145247 91177308-0d34-0410-b5e6-96231b3b80d8
these more detailed notes from the primary LLVM release notes for Clang.
This gives us a nice place to flesh out in plenty of detail the major
changes that have happened in Clang land since 2.9.
I've outlined a very rough structure based on the LLVM release notes
structure and what seems like useful divisions in the Clang landscape
(e.g., language-specific stuff is relevant to a narrower audience).
I'll be first converting my brain-dump-ish notes from the commit logs,
and then cleaning here. Suggestions on structure welcome. Typo
corrections, spelling fixes (oh how I'll need them), all welcome; just
commit away.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145233 91177308-0d34-0410-b5e6-96231b3b80d8
delimiter pairs and detect when we exceed the implementation limit for
nesting depth, from Aaron Ballman!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141782 91177308-0d34-0410-b5e6-96231b3b80d8
- This disables the system include directories, but not the compiler builtin
directories. Useful for projects that want to use things like the intrinsic
headers, but are otherwise freestanding.
- I'm willing to reconsider the option naming, I also considered providing an
explicit -builtinc (which would match -nobuiltininc), but this is more
consistent with existing options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141692 91177308-0d34-0410-b5e6-96231b3b80d8
to operate "as if" in a certain working directory.
- For now, we just implement this by changing the actual working directory, but
eventually we would want to handle this transparently. This is useful to
avoid an extra exec() pair in some situations, and will be something we would
want to support for more flexibility in using the Clang libraries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140409 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C. The @encode'ing of such an enumeration type is the same
as its underlying type. <rdar://problem/5276348>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139297 91177308-0d34-0410-b5e6-96231b3b80d8
'id' that can be used (only!) via a contextual keyword as the result
type of an Objective-C message send. 'instancetype' then gives the
method a related result type, which we have already been inferring for
a variety of methods (new, alloc, init, self, retain). Addresses
<rdar://problem/9267640>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139275 91177308-0d34-0410-b5e6-96231b3b80d8
features, so clients can check for the availability of these features
even before we get around to implementing them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138741 91177308-0d34-0410-b5e6-96231b3b80d8
This patch special cases the parser for thread safety attributes so that all
attribute arguments are put in the argument list (instead of a special
parameter) since arguments may not otherwise resolve correctly without two-token
lookahead.
This patch also adds checks to make sure that attribute arguments are
lockable objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137130 91177308-0d34-0410-b5e6-96231b3b80d8
analysis. This includes checking that the attributes are applied in the
correct contexts and with the correct number of arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136383 91177308-0d34-0410-b5e6-96231b3b80d8
Introduce and document a new objc_returns_inner_pointer
attribute, and consume it by performing a retain+autorelease
on message receivers when they're not immediately loaded from
an object with precise lifetime.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135764 91177308-0d34-0410-b5e6-96231b3b80d8
One weird thing is the addition of several <a name=""> tags where
previously there were id attributes on the <h3> tags. This is because
the id attribute must begin with a letter, not an underscore. The name
attribute is not so constrained, so links will continue to work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133677 91177308-0d34-0410-b5e6-96231b3b80d8
specifying that retain/release/autorelease/retainCount are forbidden,
plus a section talking about the behavior of dealloc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133340 91177308-0d34-0410-b5e6-96231b3b80d8
silently dropped ownership qualifiers that were being applied to
ownership-qualified, substituted type that was *not* a substituted
template type parameter. We now provide a diagnostic in such cases,
and recover by dropping the added qualifiers.
Document this behavior in the ARC specification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133309 91177308-0d34-0410-b5e6-96231b3b80d8
ownership-unqualified retainable object type as __strong. This allows
us to write, e.g.,
std::vector<id>
and we'll infer that the vector's element types have __strong
ownership semantics, which is far nicer than requiring:
std::vector<__strong id>
Note that we allow one to override the ownership qualifier of a
substituted template type parameter, e.g., given
template<typename T>
struct X {
typedef __weak T type;
};
X<id> is treated the same as X<__strong id>. At instantiation type,
the __weak in "__weak T" overrides the (inferred or specified)
__strong on the template argument type, so that we can still provide
metaprogramming transformations.
This is part of <rdar://problem/9595486>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133303 91177308-0d34-0410-b5e6-96231b3b80d8
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.
Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:
t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^
It also means that we get decent type inference when writing code in
Objective-C++0x:
auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.
Depends on llvm commit r132046.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132047 91177308-0d34-0410-b5e6-96231b3b80d8
minor issues along the way:
- Non-type template parameters of type 'std::nullptr_t' were not
permitted.
- We didn't properly introduce built-in operators for nullptr ==,
!=, <, <=, >=, or > as candidate functions .
To my knowledge, there's only one (minor but annoying) part of nullptr
that hasn't been implemented: catching a thrown 'nullptr' as a pointer
or pointer-to-member, per C++0x [except.handle]p4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131813 91177308-0d34-0410-b5e6-96231b3b80d8
prints the file, line, and column of a diagnostic. We currently
support Clang's normal format, MSVC, and Vi formats.
Note that we no longer change the diagnostic format based on
-fms-extensions.
Patch by Andrew Fish!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131794 91177308-0d34-0410-b5e6-96231b3b80d8
__has_extension is a function-like macro which takes the same set
of feature identifiers as __has_feature. It evaluates to 1 if the
feature is supported by Clang in the current language (either as a
language extension or a standard language feature) or 0 if not.
At the same time, add support for the C1X feature identifiers
c_generic_selections (renamed from generic_selections) and
c_static_assert, and document them.
Patch by myself and Jean-Daniel Dupas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131308 91177308-0d34-0410-b5e6-96231b3b80d8
argument deduction failures. Only implemented in C++0x, since this is
a significant change in behavior from C++98/03.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131209 91177308-0d34-0410-b5e6-96231b3b80d8
As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554 91177308-0d34-0410-b5e6-96231b3b80d8
Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented.
This completes noexcept specification work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127701 91177308-0d34-0410-b5e6-96231b3b80d8
The previous name was inaccurate as this token in fact appears at
the end of every preprocessing directive, not just macro definitions.
No functionality change, except for a diagnostic tweak.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126631 91177308-0d34-0410-b5e6-96231b3b80d8
authors to write
class __attribute__((forbid_temporaries)) Name { ... };
when they want to force users to name all variables of the type. This protects
people from doing things like creating a scoped_lock that only lives for a
single statement instead of an entire scope.
The warning produced by this attribute can be disabled by
-Wno-forbid-temporaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124217 91177308-0d34-0410-b5e6-96231b3b80d8