Граф коммитов

4570 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor ccd471341d A built-in overload candidate is consider a non-template function when
determining whether one overload candidate is better than
another. Fixes PR7319.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 21:03:17 +00:00
Daniel Dunbar c4dec1c58e Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 20:44:43 +00:00
Daniel Dunbar afed099bd2 Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 20:34:18 +00:00
Douglas Gregor d64fdd0c05 Warn about comparisons between arrays and improve self-comparison
warnings, from Troy Straszheim! Fixes PR6163.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 19:50:34 +00:00
Fariborz Jahanian d7c7338dd7 Fixes a typo which prevented proper code gen. for
copy-in of c++ class objects into blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 17:52:11 +00:00
Douglas Gregor d7a95971bd Implement a warning when converting the literal 'false' to a
pointer. Original patch by Troy D. Straszheim; fixes PR7283.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 17:35:15 +00:00
Nate Begeman 26a31428f1 Since the enum values for each arch's builtins overlap, it is not appropriate to check them when compiling or other archs. Fixes a problem where compiling for NEON would use x86 sema rules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 02:47:44 +00:00
Nate Begeman 37b6a5731a Extend __builtin_shufflevector to expose the full power of the llvm shufflevector instruction. This means it can now be used for vector truncation and concatenation. This will be used for the ARM NEON implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 00:16:34 +00:00
Fariborz Jahanian e2a901a188 When using property-dot assignment syntax to call a setter method,
type of rhs need be compared to setter's argument and
not the getter type. Fixes radar 8062778


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 22:02:01 +00:00
Fariborz Jahanian 310b1c4216 Use MaybeCreateCXXExprWithTemporaries for potential destruction of
created temporary. Use own initialized entity for copied in block
variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 16:14:00 +00:00
Jeffrey Yasskin 57d12fd4a2 PR7245: Make binding a reference to a temporary without a usable copy
constructor into an extension warning into the error that C++98 requires.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 15:58:05 +00:00
John McCall 2865474261 Simplify the methods for creating a pointer, reference, member-pointer,
or block-pointer type by removing the qualifiers parameter.  Introduce a
method to perform semantic checking when adding qualifiers to a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-05 06:41:15 +00:00
Abramo Bagnara 6206d53f67 Added AccessSpecDecl node.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105525 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-05 05:09:32 +00:00
Jeffrey Yasskin 21d07e499e Add an extension to avoid an error when a global template has the same name as
a member template, and you try to call the member template with an explicit
template argument.  See PR7247 

For example, this downgrades the error to a warning in:

template<typename T> struct set{};
struct Value {
    template<typename T>
    void set(T value) {
    }
};
void foo() {
    Value v;
    v.set<double>(3.2);  // Warning here.
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-05 01:39:57 +00:00
John McCall bf1a028246 Alter the interface of GetTypeForDeclarator to return a TypeSourceInfo*.
This is never null, but the associated type might be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 23:28:52 +00:00
Anders Carlsson 52647c63c3 When deciding whether reinterpret_cast casts away constness we need to look at array qualifiers. Fixes rdar://problem/8018292.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 22:47:55 +00:00
Fariborz Jahanian 59da45a1fc Build AST for copy-construction of copied-in
class object in blocks and carry it to IRGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 21:35:44 +00:00
John McCall 83a230c83a Remember type source information for Objective C property declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 20:50:08 +00:00
John McCall c71a4915ca Preserve more information from a block's original function declarator, if one
was given.  Remove some unnecessary accounting from BlockScopeInfo.  Handle
typedef'ed function types until such time as we decide not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 19:02:56 +00:00
John McCall 82dc00948f Restructure how we interpret block-literal declarators. Correctly handle
the case where we pick up block arguments from a typedef.  Save the block
signature as it was written, and preserve same through PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 11:21:44 +00:00
Abramo Bagnara ea7b4880bc Don't insert in lexical context implicit definitions of static member instances.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 09:35:39 +00:00
Douglas Gregor a417b87e5d When checking for equality of template parameter lists, a template
type parameter pack is distinct from a template type parameter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 08:34:32 +00:00
John McCall 4bde1e13d3 Delay checking for mutable const fields until we're checking the field.
Allows this check to work properly for instantiated fields and removes
an unnecessary GetTypeForDeclarator call.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 08:34:12 +00:00
John McCall 369371ce0c More refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 02:29:22 +00:00
John McCall 75f7c0f5a8 Remove a couple of unnecessary uses of IsStandardConversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 00:29:51 +00:00
Eli Friedman 5ed9b93c59 Make sure to check the accessibility of and mark the destructor for the
operand of a throw expression.  Fixes PR7281.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 20:39:03 +00:00
Anders Carlsson ffdb2d2a88 Add all final overriders to the map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 01:00:02 +00:00
Daniel Dunbar dc32cdf2a9 Fix unintentional method call due to false -> pointer conversion; patch by Dimitry Andric!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105327 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 15:46:52 +00:00
Douglas Gregor d1c1d7bd14 typeid() produces type information for the cv-unqualified version of
the type. Thanks to Anders for the bug report!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 06:16:02 +00:00
John McCall 76bd1f387e Alter the ExternalASTSource interface to permit by-name lookups. PCH continues to
bring in the entire lookup table at once.

Also, give ExternalSemaSource's vtable a home.  This is important because otherwise
any reference to it will cause RTTI to be emitted, and since clang is compiled
with -fno-rtti, that RTTI will contain unresolved references (to ExternalASTSource's
RTTI).  So this change makes it possible to subclass ExternalSemaSource from projects
compiled with RTTI, as long as the subclass's home is compiled with -fno-rtti.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-01 09:23:16 +00:00
Ted Kremenek 681e256048 Fix crash in code completion when an ObjCMethodDecl doesn't have an associated @interface.
Fixes <rdar://problem/8026215>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-31 21:43:10 +00:00
Sean Hunt 9a55591af3 Convert DeclNodes to use TableGen.
The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-30 07:21:58 +00:00
Douglas Gregor d28dcd76c7 Teach code-completion for calls to be more careful with a
potentially-NULL "function" argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-30 06:10:08 +00:00
Douglas Gregor 5ac3bdb2cb Teach code completion to adjust its completion priorities based on the
type that we expect to see at a given point in the grammar, e.g., when
initializing a variable, returning a result, or calling a function. We
don't prune the candidate set at all, just adjust priorities to favor
things that should type-check, using an ultra-simplified type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-30 01:49:25 +00:00
John McCall 4e449836c0 Copy source information for the inner type of an elaborated type; fixes some
valgrind problems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 23:32:21 +00:00
Daniel Dunbar d6b305dcba Sema: Fix comment, apparently #pragma options align=power is just the same as
align=native, at least for the platforms we support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 20:08:00 +00:00
Daniel Dunbar 450f793408 Sema: Just ignore '#pragma options align=power' for now, this is no worse than
what we used to be doing, and makes sure that paired '#pragma options
align=reset' won't fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 19:43:33 +00:00
John McCall c7e04dad58 A more minimal fix for PR6762.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 18:45:08 +00:00
John McCall 2b7baf0816 Roll back r104941.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104990 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 18:25:28 +00:00
John McCall 811d0bec4d Disable exception-spec compatibility checking under -fno-exceptions.
Fixes PR7243.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 08:37:35 +00:00
John McCall 1d0a5856d0 Add a new attribute on records, __attribute__((adl_invisible)), and define
the x86-64 __va_list_tag with this attribute.  The attribute causes the
affected type to behave like a fundamental type when considered by ADL.

(x86-64 is the only target we currently provide with a struct-based
__builtin_va_list)

Fixes PR6762.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 08:20:36 +00:00
John McCall fa4edcf263 Optimize and complete associated-class-and-namespace collection from
a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 06:08:54 +00:00
Douglas Gregor 76ef658c70 When we complain about a member being inaccessible due to a constraint
along an access path, add another note pointing at the member we
actually found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104937 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 04:34:55 +00:00
John McCall 9da9cdfd5a When filtering out previous declarations of friend functions, consider the
lookup context, not the direct semantic context.  Fixes PR7230.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 01:41:47 +00:00
Douglas Gregor 447107dfff Don't put method bodies into code completions unless code patterns are
turned on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 00:57:46 +00:00
Douglas Gregor 4710e5b12b Do not produce types as valid code completions when we're in an
expression context in C/Objective-C, or when we're in an
@interface/@implementation/@protocol in Objective-C(++).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 00:49:12 +00:00
Douglas Gregor c8bddde821 Make -code-completion-patterns only cover multi-line code
completions. Plus, tweak a few completion patterns to better reflect
the language grammar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 00:22:41 +00:00
Douglas Gregor 8e254cfe5a Implement a code-completion hook for the receiver of an Objective-C
message. This completion gives better results than just using the
"expression" completion, which is effectively what happened before.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 23:06:34 +00:00
Douglas Gregor aeb4a28256 Tweak the fix-it for a copy constructor declared to take its argument
by-value. We now only prepend a space if it is needed. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 21:28:21 +00:00
Daniel Dunbar 6f739145b9 Parse/Sema: Add support for '#pragma options align=packed', which, it should be
noted, is not the same as __attribute__((packed)). That would be ridiculous!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 18:42:17 +00:00