Aaron Ballman [Wed, 27 Nov 2013 15:24:06 +0000 (15:24 +0000)]
Refactored semantic handlers that would unilaterally apply the attribute to a Decl so they all go through a common interface. No functional change intended.
Aaron Ballman [Wed, 27 Nov 2013 13:56:12 +0000 (13:56 +0000)]
Removing the description part of a subset subject. It is unused, and wouldn't be future-proof regarding translation issues. It is also covered by SubjectList's CustomDiag member.
Aaron Ballman [Wed, 27 Nov 2013 13:27:02 +0000 (13:27 +0000)]
Laying the basic groundwork for table generating the diagnostics for attribute subjects. This makes some modifications to the way subjects are listed in Attr.td, and updates the attr emitter to handle the new constructs.
I have disabled some attribute subject lines on purpose in Attr.td;
this part is a WIP with the goal being to restore those subjects
incrementally. By commenting them out, it leaves the original behavior
the same as before for those attributes and so those are not
functionality changes.
[Sema] Don't look for the instantiation of a local extern decl in a different
dependent context that the one we are instantiating, otherwise there will be an assertion.
David Majnemer [Wed, 27 Nov 2013 08:20:38 +0000 (08:20 +0000)]
Sema: Instantiate local class and their members appropriately
We would fail to instantiate them when the surrounding function was
instantiated. Instantiate the class and add it's members to the list of
pending instantiations, they should be resolved when we are finished
with the function's body.
Richard Smith [Wed, 27 Nov 2013 03:39:20 +0000 (03:39 +0000)]
Unify lookup from within not-yet-defined defaulted special members: use common
code for handling triviality, deletedness and constexpr. Fix a few bugs in
these, particularly related to mutable members, and remove some dead code.
Richard Smith [Wed, 27 Nov 2013 01:46:48 +0000 (01:46 +0000)]
Remove 'DistinctSpellings' support from Attr.td and change its only user to
look at the attribute spelling instead. The 'ownership_*' attributes should
probably be split into separate *Attr classes, but that's more than I wanted to
do here.
James Dennett [Wed, 27 Nov 2013 01:27:40 +0000 (01:27 +0000)]
Documentation cleanup: Doxygen-ification, typo fixes, and changing some of
the duplicated documentation from .cpp files so that it's not processed by
Doxygen and hence doesn't generate duplicate output.
Simon Atanasyan [Tue, 26 Nov 2013 11:57:14 +0000 (11:57 +0000)]
[Mips] Do not detect a used MIPS toolchain. Build a path suffix for FSF
toolchain first and check the path existence. If the path does not
exist build and check a path suffix for Code Sourcery toolchain.
Summary:
getStringSplit used to crash, when trying to split a long string
literal containing both printable and unprintable multi-byte UTF-8 characters.
Alp Toker [Tue, 26 Nov 2013 01:30:10 +0000 (01:30 +0000)]
Unbreak -fms-extensions with GNU libc headers
GNU libc uses '__uptr' as a member name in C mode, conflicting with the
eponymous MSVC pointer modifier keyword.
Detect and mark the token as an identifier when these specific conditions are
met. __uptr will continue to work as a keyword for the remainder of the
translation unit.
David Majnemer [Mon, 25 Nov 2013 17:50:19 +0000 (17:50 +0000)]
[-cxx-abi microsoft] Create backrefs for <unnamed-type-`id'>
It wasn't possible for an anonymous type to show up inside of function arguments.
However, decltype (which MSVC added support for in 2010) makes this
possible. Further, backrefs to these anonymous types can now be formed.
This fixes PR18022.
N.B. We do not, and very likely _will not_, support MSVC's bug where
subsequent typedefs of anonymous types leak into the linkage name; this
is a gross violation of the ABI. A warning should be introduced to
inform our users of this particular shortcoming.
Daniel Jasper [Mon, 25 Nov 2013 11:08:59 +0000 (11:08 +0000)]
clang-format: Refactor calculation of lines intersecting with -lines.
No functional changes intended. However, it seems to have found a buggy
behavior in one of the tests. I think this structure is generally
desirable and it will make a planned bugfix significantly easier.
Alp Toker [Mon, 25 Nov 2013 00:40:53 +0000 (00:40 +0000)]
Add heading and remove leftover personal email addresses
clang's attribute support is mature by now so replace Sean's warning and email
address with a standard LLVM copyright heading.
Also remove a personal email address and credit docstring from CGObjCGNU that
shouldn't have been there.
This is in line with the LLVM developer policy introduced in r45410.
Contributors can add themselves to CREDITS.txt while active module owners are
listed in CODE_OWNERS.TXT.
Rafael Espindola [Sun, 24 Nov 2013 23:40:06 +0000 (23:40 +0000)]
remove gcc::Precompile
Clang still has support for running gcc for performing various stages
of a build. Right now it looks like this is used for
* Supporting Fortran in the clang driver
* Running an assembler or linker in systems we don't yet know how to
run them directly.
It looks like the gcc::Precompile is a vestige from the days when we
supported using clang for C and running gcc for c++. This patch removes it
(yes, we have no tests for it).
Aaron Ballman [Sun, 24 Nov 2013 21:35:16 +0000 (21:35 +0000)]
__declspec(uuid) is only supported for C++ code according to MSDN (as well as behaviorally in MSVC). This adds a generic diagnostic that we use for uuid, and can use for some other attributes as well, and adds a testcase.
Aaron Ballman [Sun, 24 Nov 2013 20:58:02 +0000 (20:58 +0000)]
__declspec(uuid) is only allowed on a class according to MSDN; this makes the semantic checking consistent with what the attribute specifies in Attr.td. Also adds a test case.
Rafael Espindola [Sat, 23 Nov 2013 16:40:57 +0000 (16:40 +0000)]
Don't use the gcc driver for assembling.
Clang knows how to use the gnu assembler directly from doing so on linux and
hurd. The existing support worked out of the box on cygwin and mingw and I was
able to bootstrap clang with it in both systems (with pending patches for the
new mingw abi, but that is independent of the assembler).
Benjamin Kramer [Sat, 23 Nov 2013 10:57:32 +0000 (10:57 +0000)]
Enable non-fragile ABI for the ObjFW runtime
The following patch enables the non-fragile ABI for the ObjFW runtime.
However, I noticed that it is not possible anymore to disable it with
-fno-objc-nonfragile-abi like it was before. I think this functionality should
be restored, but I guess this is not in scope for 3.4 anymore.
Daniel Jasper [Sat, 23 Nov 2013 10:22:59 +0000 (10:22 +0000)]
clang-format: Prefer column layout if possible.
Add a severe penalty for not using column layout for braced lists. If
there are solutions with column layout, these are generally preferable
over bin-packed solutions.
Richard Smith [Sat, 23 Nov 2013 04:06:09 +0000 (04:06 +0000)]
Generate a marker token when entering or leaving a submodule when building a
module. Use the marker to diagnose cases where we try to transition between
submodules when not at the top level (most likely because a closing brace was
missing at the end of a header file, but is also possible if submodule headers
attempt to do something fundamentally non-modular, like our .def files).
Ted Kremenek [Sat, 23 Nov 2013 01:01:34 +0000 (01:01 +0000)]
Add back experimental attribute objc_suppress_protocol_methods (slightly renamed).
This is still an experimental attribute, but I wanted it in tree
for review. It may still get yanked.
This attribute can only be applied to a class @interface, not
a class extension or category. It does not change the type
system rules for Objective-C, but rather the implementation checking
for Objective-C classes that explicitly conform to a protocol.
During protocol conformance checking, clang recursively searches
up the class hierarchy for the set of methods that compose
a protocol. This attribute will cause the compiler to not consider
the methods contributed by a super class, its categories, and those
from its ancestor classes. Thus this attribute is used to force
subclasses to redeclare (and hopefully re-implement) methods if
they decide to explicitly conform to a protocol where some of those
methods may be provided by a super class.
This attribute intentionally leaves out properties, which are associated
with state. This attribute only considers methods (at least right now)
that are non-property accessors. These represent methods that "do something"
as dictated by the protocol. This may be further refined, and this
should be considered a WIP until documentation gets written or this
gets removed.
Ted Kremenek [Sat, 23 Nov 2013 01:01:29 +0000 (01:01 +0000)]
Change ObjCIntefaceDecl::lookupMethod() to have optional 'followsSuper' argument.
This enables a micro-optimization in protocol conformance checking
to not examine the class hierarchy twice per method.
As part of this change, remove the default arguments from lookupInstanceMethod()
and lookupClassMethod(). It was becoming very redundant. For clients
needing the default arguments, have them use the full API instead of
these convenience methods.
Remove uninstantiable constructor from DeclTemplate.h
Patch by Kim Gräsman!
Laszlo Nagy and me both ran into the same issue with SpecIterator from DeclTemplate.h causing an error:
tools/clang/include/clang/AST/DeclTemplate.h:560:22: error:
no matching constructor for initialization of 'SetIteratorType' (aka
'FoldingSetVectorIterator<clang::FunctionTemplateSpecializationInfo,
typename SmallVector<FunctionTemplateSpecializationInfo *, 8>::iterator>')
SpecIterator() : SetIter() {}
(see e.g. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-November/033642.html)
The problem is the SpecIterator default constructor which needs a non-existent SetIter default constructor. SpecIterator's default constructor is evidently dead code as any call to it would fail with the above error.
ObjectiveC. Remove warning diagnostic which checks
attribute on method declaration and implementation
match. This makes no sense. Most annotations are
meant for declarations only and one is for implementation.
This has been constant source of regresions and hackery to
get around special cases. I am removing this check.
Such checks must be done on a case by case basis and
when it makes sense. For example, it makes sense
for availability/deprecated and I will file a radar
for that. // rdar://15531984
Aaron Ballman [Fri, 22 Nov 2013 22:49:31 +0000 (22:49 +0000)]
Updating Subjects definitions for attributes based on semantic handling. Removes Subjects for things we cannot currently check, adds Subjects for things we can, and rectifies most discrepancies. Since Subjects are not currently handled in tablegen, there are no functional changes with this patch.
Adjust r194296 to not apply the alias replacement for externally
available always-inline functions. This breaks libc++'s locale
implementation. Code generation for this case should be fixed, but this
is a stop gap fix for clang 3.4.
Justin Bogner [Fri, 22 Nov 2013 10:20:43 +0000 (10:20 +0000)]
Revert r193994 and part of r193995
Not long ago I made the CodeGen of for loops simplify the condition at
-O0 in the same way we do for if and conditionals. Unfortunately this
ties how loops and simple conditions work together too tightly, which
makes features such as instrumentation based PGO awkward.
Ultimately, we should find a more general way to simplify the logic in
a given condition, but for now we'll just avoid using EmitBranchOnBool
for loops, like we already do for while and do loops.
Richard Smith [Fri, 22 Nov 2013 09:01:48 +0000 (09:01 +0000)]
Add class-specific operator new to Decl hierarchy. This guarantees that Decls
can't accidentally be allocated the wrong way (missing prefix data for decls
from AST files, for instance) and simplifies the CreateDeserialized functions a
little. An extra DeclContext* parameter to the not-from-AST-file operator new
allows us to ensure that we don't accidentally call the wrong one when
deserializing (when we don't have a DeclContext), allows some extra checks, and
prepares for some planned modules-related changes to Decl allocation.
Alp Toker [Fri, 22 Nov 2013 08:27:46 +0000 (08:27 +0000)]
Tidy up the no-external-assembler diag
Diags aren't usually in the first person, and 'windows' isn't the correct
product spelling to use in prose. Sidestep issues completely by making this
error message platform-neutral.
Alp Toker [Fri, 22 Nov 2013 08:00:20 +0000 (08:00 +0000)]
Add txt file extension to VS solution's README
This matches other README.txt files in LLVM and makes things more obvious on
Windows where it's likely to be read. CRLFs are retained for the same reason.