]> granicus.if.org Git - clang/log
clang
12 years ago[tsan] fix typo
Kostya Serebryany [Wed, 16 May 2012 08:19:13 +0000 (08:19 +0000)]
[tsan] fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156912 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoClarify how libstdc++ and other bits of the system toolchain are found
Chandler Carruth [Wed, 16 May 2012 08:18:58 +0000 (08:18 +0000)]
Clarify how libstdc++ and other bits of the system toolchain are found
on Linux in the getting started documentation.

Patch by Nathan Ridge.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156911 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[tsan] first version of ThreadSanitizer docs
Kostya Serebryany [Wed, 16 May 2012 08:14:36 +0000 (08:14 +0000)]
[tsan] first version of ThreadSanitizer docs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156910 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[tsan] add ThreadSanitizer linker flags on Linux and also copy the tsan-rt into...
Kostya Serebryany [Wed, 16 May 2012 06:36:00 +0000 (06:36 +0000)]
[tsan] add  ThreadSanitizer linker flags on Linux and also copy the tsan-rt into the appropriate place at build time

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156906 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProduce more useful 'duplicate case' diagnostics. Fixes PR9243, from Terry Long!
Douglas Gregor [Wed, 16 May 2012 05:32:58 +0000 (05:32 +0000)]
Produce more useful 'duplicate case' diagnostics. Fixes PR9243, from Terry Long!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156904 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInclude the correct conversion context locations for condition expressions.
David Blaikie [Wed, 16 May 2012 04:20:04 +0000 (04:20 +0000)]
Include the correct conversion context locations for condition expressions.

This improves the conversion diagnostics (by correctly pointing to the loop
construct for conversions that may've been caused by the contextual conversion
to bool caused by a condition expression) and also causes the NULL conversion
warnings to be correctly suppressed when crossing a macro boundary in such a
context. (previously, since the conversion context location was incorrect, the
suppression could not be performed)

Reported by Nico Weber as feedback to r156826.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156901 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix the visibility of instantiations of static data members.
Rafael Espindola [Wed, 16 May 2012 02:10:38 +0000 (02:10 +0000)]
Fix the visibility of instantiations of static data members.
Fixes pr12835.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156897 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang/AST] Index references of protocols in "@protocol(...)" syntax.
Argyrios Kyrtzidis [Wed, 16 May 2012 00:50:02 +0000 (00:50 +0000)]
[libclang/AST] Index references of protocols in "@protocol(...)" syntax.

To do that, keep track of the location of the protocol id in the ObjCProtocolExpr
AST node.

rdar://11190837

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156890 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[objcmt] Accept char arrays for rewriting to @() syntax.
Argyrios Kyrtzidis [Wed, 16 May 2012 00:21:21 +0000 (00:21 +0000)]
[objcmt] Accept char arrays for rewriting to @() syntax.

Part of rdar://11438360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156880 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add a test for dead stores, which uses OpaqueValExpr.
Anna Zaks [Tue, 15 May 2012 23:12:53 +0000 (23:12 +0000)]
[analyzer] Add a test for dead stores, which uses OpaqueValExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156875 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[objcmt] When using NSNumber numberWithInteger:/numberWithUnsignedInteger: be
Argyrios Kyrtzidis [Tue, 15 May 2012 22:59:54 +0000 (22:59 +0000)]
[objcmt] When using NSNumber numberWithInteger:/numberWithUnsignedInteger: be
more liberal in rewriting when the parameter is an enum constant.

Part of rdar://11438360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156873 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjective-c: perform strict type checking on property
Fariborz Jahanian [Tue, 15 May 2012 22:37:04 +0000 (22:37 +0000)]
objective-c: perform strict type checking on property
type and its accessor type and issue error if types
are incompatible, instead of crashing in IRgen.
// rdar://1105153

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156871 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Fix a regression in ObjCUnusedIVars checker.
Anna Zaks [Tue, 15 May 2012 22:31:56 +0000 (22:31 +0000)]
[analyzer] Fix a regression in ObjCUnusedIVars checker.

We can no longer rely on children iterator to visit all the AST
tree children of an expression (OpaqueValueExpr has no children).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156870 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[objcmt] Rewrite messages to NSString's stringWithUTF8String:/stringWithCString:
Argyrios Kyrtzidis [Tue, 15 May 2012 22:22:10 +0000 (22:22 +0000)]
[objcmt] Rewrite messages to NSString's stringWithUTF8String:/stringWithCString:
to use the @() boxing syntax.

It will also rewrite uses of stringWithCString:encoding: where the encoding that is
used is NSASCIIStringEncoding or NSUTF8StringEncoding.

rdar://11438360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156868 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't warn when NULL is used within a macro but its conversion is outside a macro.
David Blaikie [Tue, 15 May 2012 21:57:38 +0000 (21:57 +0000)]
Don't warn when NULL is used within a macro but its conversion is outside a macro.

This fixes the included test case & was reported by Nico Weber.

It's a little bit nasty using the difference in the conversion context, but
seems to me like a not unreasonable solution. I did have to fix up the
conversion context for conditional operators (it seems correct to me to include
the context for which we're actually doing the comparison - across all the
nested conditionals, rather than the innermost conditional which might not
actually have the problematic implicit conversion at all) and template default
arguments (this is a bit of a hack, since we don't have the source location of
the '=' anymore, so I just used the start of the parameter - open to
suggestions there)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156861 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTypo.
Richard Smith [Tue, 15 May 2012 21:42:17 +0000 (21:42 +0000)]
Typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156860 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIf we see a declaration which is either missing a type or has a malformed type,
Richard Smith [Tue, 15 May 2012 21:29:55 +0000 (21:29 +0000)]
If we see a declaration which is either missing a type or has a malformed type,
and the thing we have has a scope specifier, and we're in a context that doesn't
allow declaring a qualified name, then the error is a malformed type, not a
missing type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156856 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't use the implicit int rule for error recovery in C++. Instead, try to
Richard Smith [Tue, 15 May 2012 21:01:51 +0000 (21:01 +0000)]
Don't use the implicit int rule for error recovery in C++. Instead, try to
disambiguate whether the type name was forgotten or mistyped.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156854 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd the Objective-C runtime linking arguments after user-specified
Douglas Gregor [Tue, 15 May 2012 21:00:27 +0000 (21:00 +0000)]
Add the Objective-C runtime linking arguments after user-specified
linker arguments. Fixes <rdar://problem/11417441>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156853 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd documentation about boxing enum types and a codegen test to make
Argyrios Kyrtzidis [Tue, 15 May 2012 20:45:35 +0000 (20:45 +0000)]
Add documentation about boxing enum types and a codegen test to make
sure we pick up the underlying type, per suggestion by Fariborz.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156851 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Store reference to TranslationUnit in Cursor and Type
Gregory Szorc [Tue, 15 May 2012 19:51:02 +0000 (19:51 +0000)]
[clang.py] Store reference to TranslationUnit in Cursor and Type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156846 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[objcmt] Rewrite [NSNumber numberWith*] messages to the new @() boxing syntax.
Argyrios Kyrtzidis [Tue, 15 May 2012 19:17:49 +0000 (19:17 +0000)]
[objcmt] Rewrite [NSNumber numberWith*] messages to the new @() boxing syntax.

There are some caveats:
-If an implicit cast (e.g. int -> float for numberWithFloat:) was required, the message
 will not get rewritten
-If the message was with numberWithInteger:/numberWithUnsignedInteger:, which are very
 commonly used, be more liberal and allow the boxing syntax if the underlying type has
 same signedness and will not lose precision.

Part of rdar://11438360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156844 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAllow objc @() syntax for enum types.
Argyrios Kyrtzidis [Tue, 15 May 2012 19:17:44 +0000 (19:17 +0000)]
Allow objc @() syntax for enum types.

Previously we would reject it as illegal using a value of
enum type and on ObjC++ it was illegal to use an enumerator
as well.

rdar://11454917

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156843 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDo not link with Objective-C libraries with -nostdlib or -nodefaultlibs.
Bob Wilson [Tue, 15 May 2012 18:57:39 +0000 (18:57 +0000)]
Do not link with Objective-C libraries with -nostdlib or -nodefaultlibs.
<rdar://problem/11433499>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156841 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd the output of "clang --version" to scan-build results, from Gerald Combs!
Douglas Gregor [Tue, 15 May 2012 18:41:55 +0000 (18:41 +0000)]
Add the output of "clang --version" to scan-build results, from Gerald Combs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156834 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: avoid duplicate diagnostics on certain type mismatches
Fariborz Jahanian [Tue, 15 May 2012 18:12:51 +0000 (18:12 +0000)]
objc: avoid duplicate diagnostics on certain type mismatches
between property and its backing ivar.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156832 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove word 'block' from option and diagnostic I added
Fariborz Jahanian [Tue, 15 May 2012 17:43:16 +0000 (17:43 +0000)]
Remove word 'block' from option and diagnostic I added
in r156825.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156831 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAllow MCCodeEmitter access to the target MCRegisterInfo.
Jim Grosbach [Tue, 15 May 2012 17:36:07 +0000 (17:36 +0000)]
Allow MCCodeEmitter access to the target MCRegisterInfo.

Add MRI to the createMCCodeEmitter() call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156830 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChanging std::string to SmallString for r156826.
David Blaikie [Tue, 15 May 2012 17:18:27 +0000 (17:18 +0000)]
Changing std::string to SmallString for r156826.

Based on code review feedback by Jordan Rose.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156827 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImprove some of the conversion warnings to fire on conversion to bool.
David Blaikie [Tue, 15 May 2012 16:56:36 +0000 (16:56 +0000)]
Improve some of the conversion warnings to fire on conversion to bool.

Moves the bool bail-out down a little in SemaChecking - so now
-Wnull-conversion and -Wliteral-conversion can fire when the target type is
bool.

Also improve the wording/details in the -Wliteral-conversion warning to match
the -Wconstant-conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156826 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjective-c nonfragile abi: discourage ivar declarations
Fariborz Jahanian [Tue, 15 May 2012 16:33:04 +0000 (16:33 +0000)]
objective-c nonfragile abi: discourage ivar declarations
in @interface by issuing warning (off by default) under
opt'ed in flag -Winterface-block-ivar. // rdar://10763173

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156825 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix our handling of visibility in explicit template instantiations.
Rafael Espindola [Tue, 15 May 2012 14:09:55 +0000 (14:09 +0000)]
Fix our handling of visibility in explicit template instantiations.

* Don't copy the visibility attribute during instantiations. We have to be able
  to distinguish

 struct HIDDEN foo {};
 template<class T>
 DEFAULT void bar() {}
 template DEFAULT void bar<foo>();

from

 struct HIDDEN foo {};
 template<class T>
 DEFAULT void bar() {}
 template void bar<foo>();

* If an instantiation has an attribute, it takes precedence over an attribute
  in the template.

* With instantiation attributes handled with the above logic, we can now
  select the minimum visibility when looking at template arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156821 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a note about atomic builtins to c11 section of release notes.
David Chisnall [Tue, 15 May 2012 13:18:03 +0000 (13:18 +0000)]
Add a note about atomic builtins to c11 section of release notes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156820 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixes crasher bug in JSONCompilationDatabase for invalid input.
Manuel Klimek [Tue, 15 May 2012 11:46:07 +0000 (11:46 +0000)]
Fixes crasher bug in JSONCompilationDatabase for invalid input.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156814 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd embedded linux variants that occur in the field
Gabor Greif [Tue, 15 May 2012 11:21:03 +0000 (11:21 +0000)]
add embedded linux variants that occur in the field

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156813 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis patch fixes the cmake build to create libclang.so/libclang.a on linux
Manuel Klimek [Tue, 15 May 2012 08:58:48 +0000 (08:58 +0000)]
This patch fixes the cmake build to create libclang.so/libclang.a on linux
instead of liblibclang.so/liblibclang.a.

Patch by Arnaud de Grandmaison.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156809 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFurther improvement to wording of overload resolution diagnostics, and including
Richard Smith [Tue, 15 May 2012 06:21:54 +0000 (06:21 +0000)]
Further improvement to wording of overload resolution diagnostics, and including
the sole parameter name in the diagnostic in more cases. Patch by Terry Long!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156807 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR12798: Don't drop part of the nested name specifier when instantiating a
Richard Smith [Tue, 15 May 2012 06:15:11 +0000 (06:15 +0000)]
PR12798: Don't drop part of the nested name specifier when instantiating a
pseudo-destructor expression. This can affect whether virtual dispatch for
the destructor call is bypassed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156806 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTest file I forgot to 'svn add' in r156802.
Richard Smith [Tue, 15 May 2012 05:39:53 +0000 (05:39 +0000)]
Test file I forgot to 'svn add' in r156802.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156805 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR12826: Converting an lvalue to an xvalue is a no-op conversion, not an lvalue-to...
Richard Smith [Tue, 15 May 2012 05:04:02 +0000 (05:04 +0000)]
PR12826: Converting an lvalue to an xvalue is a no-op conversion, not an lvalue-to-rvalue conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156803 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFold the six functions checking explicitly-defaulted special member functions
Richard Smith [Tue, 15 May 2012 04:39:51 +0000 (04:39 +0000)]
Fold the six functions checking explicitly-defaulted special member functions
into one. These were all performing almost identical checks, with different bugs
in each of them.

This fixes PR12806 (we weren't setting the exception specification for an
explicitly-defaulted, non-user-provided default constructor) and enforces
8.4.2/2's rule that an in-class defaulted member must exactly match the implicit
parameter type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156802 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange the mangling of a ref-qualifier on a function type so that
John McCall [Tue, 15 May 2012 02:01:59 +0000 (02:01 +0000)]
Change the mangling of a ref-qualifier on a function type so that
it is placed in a position which is never ambiguous with a
reference-to-function type.  This follows some recent discussion
and ensuing proposal on cxx-abi-dev.  It is not necessary to
change the mangling of CV-qualifiers because you cannot
apply CV-qualification in the normal sense to a function type.
It is not necessary to change the mangling of ref-qualifiers on
method declarations because they appear in an unambiguous
location.

In addition, mangle CV-qualifiers and ref-qualifiers on function
types when they occur in positions other than member pointers
(that is, when they appear as template arguments).

This is a minor ABI break with previous releases of clang.  It
is not considered critical because (1) ref-qualifiers are
relatively rare, since AFAIK we're the only implementing compiler,
and (2) they're particularly likely to come up in contexts that
do not rely on the ODR for correctness.  We apologize for any
inconvenience;  this is the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156794 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[objcmt] When rewriting to subscripting syntax, make sure we put
Argyrios Kyrtzidis [Mon, 14 May 2012 23:33:49 +0000 (23:33 +0000)]
[objcmt] When rewriting to subscripting syntax, make sure we put
the receiver in parentheses when necessary.

Part of rdar://11438360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156789 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: allow typedef'ing an id to a pointer to a c-struct only.
Fariborz Jahanian [Mon, 14 May 2012 22:48:56 +0000 (22:48 +0000)]
objc: allow typedef'ing an id to a pointer to a c-struct only.
// rdar://11356439

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156788 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRecover properly from a redundant 'typename' before a non-nested name. This is
Richard Smith [Mon, 14 May 2012 22:43:34 +0000 (22:43 +0000)]
Recover properly from a redundant 'typename' before a non-nested name. This is
permitted as a Microsoft extension. Patch by William Wilson! (Plus some minor
tweaking by me.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156786 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Fix a crash in templated code which uses blocks.
Anna Zaks [Mon, 14 May 2012 22:38:24 +0000 (22:38 +0000)]
[analyzer] Fix a crash in templated code which uses blocks.

We should investigate why signature info is not set in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156784 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSlightly generalize FileCheck patterns to unbreak -Asserts builds.
Richard Smith [Mon, 14 May 2012 22:06:02 +0000 (22:06 +0000)]
Slightly generalize FileCheck patterns to unbreak -Asserts builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156783 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[objcmt] When rewriting to array/dictionary literals, add an explicit
Argyrios Kyrtzidis [Mon, 14 May 2012 22:01:53 +0000 (22:01 +0000)]
[objcmt] When rewriting to array/dictionary literals, add an explicit
cast to 'id' for any argument that requires it.

Part of rdar://11438360.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156782 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement IRGen for C++11's "T{1, 2, 3}", where T is an aggregate and the
Richard Smith [Mon, 14 May 2012 21:57:21 +0000 (21:57 +0000)]
Implement IRGen for C++11's "T{1, 2, 3}", where T is an aggregate and the
expression is treated as an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156781 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach the driver on Linux to respect -nodefaultlibs.
Chandler Carruth [Mon, 14 May 2012 18:31:18 +0000 (18:31 +0000)]
Teach the driver on Linux to respect -nodefaultlibs.

Patch from Andrew C. Morrow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156771 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] strncpy: Special-case a length of 0 to avoid an incorrect warning.
Jordy Rose [Mon, 14 May 2012 17:58:35 +0000 (17:58 +0000)]
[analyzer] strncpy: Special-case a length of 0 to avoid an incorrect warning.

We check the address of the last element accessed, but with 0 calculating that
address results in element -1. This patch bails out early (and avoids a bunch
of other work at that).

Fixes PR12807.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156769 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Implement Cursor.canonical
Gregory Szorc [Mon, 14 May 2012 03:56:33 +0000 (03:56 +0000)]
[clang.py] Implement Cursor.canonical

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156753 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Implement Cursor.result_type
Gregory Szorc [Mon, 14 May 2012 03:53:29 +0000 (03:53 +0000)]
[clang.py] Implement Cursor.result_type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156752 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTest for -fdebugger-objc-literal: missing methods should be generated like missing...
Jordy Rose [Sun, 13 May 2012 20:36:47 +0000 (20:36 +0000)]
Test for -fdebugger-objc-literal: missing methods should be generated like missing classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156746 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix Xcode case (Upper X, lower c)
Jean-Daniel Dupas [Sun, 13 May 2012 14:32:11 +0000 (14:32 +0000)]
Fix Xcode case (Upper X, lower c)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156742 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefactor all the
Rafael Espindola [Sun, 13 May 2012 03:25:18 +0000 (03:25 +0000)]
Refactor all the

  if (Inherited)
    Attr->setInherited(true);

To a central location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156728 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProduce a warning for mismatched section attributes. Completest pr9356.
Rafael Espindola [Sun, 13 May 2012 02:42:42 +0000 (02:42 +0000)]
Produce a warning for mismatched section attributes. Completest pr9356.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156727 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWe were already passing the case in pr9356. Add it to attributes.c to make
Rafael Espindola [Sun, 13 May 2012 01:56:10 +0000 (01:56 +0000)]
We were already passing the case in pr9356. Add it to attributes.c to make
sure we don't regress. I will add a warning in a sec.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156726 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for __attribute__((hot)) and __attribute__((cold)).
Benjamin Kramer [Sat, 12 May 2012 21:10:52 +0000 (21:10 +0000)]
Add support for __attribute__((hot)) and __attribute__((cold)).

Currently cold functions are marked with the "optsize" attribute in CodeGen
so they are always optimized for size.  The hot attribute is just ignored,
LLVM doesn't have a way to express hotness at the moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156723 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Followup to TranslationUnit refactor
Gregory Szorc [Sat, 12 May 2012 20:49:13 +0000 (20:49 +0000)]
[clang.py] Followup to TranslationUnit refactor

* Document index argument in TranslationUnit.from_source
* Add numeric error code to TranslationUnitSaveError string representation
* Use None instead of [] for default argument value in
  TranslationUnit.codeComplete

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156722 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd Python binding info to release notes
Gregory Szorc [Sat, 12 May 2012 20:45:56 +0000 (20:45 +0000)]
Add Python binding info to release notes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156721 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Test case: p->x is the same as p[0].x. (PR7297)
Jordy Rose [Sat, 12 May 2012 17:32:59 +0000 (17:32 +0000)]
[analyzer] Test case: p->x is the same as p[0].x. (PR7297)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156720 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoOnly check NSArray/NSDictionary boxing method params once.
Jordy Rose [Sat, 12 May 2012 17:32:56 +0000 (17:32 +0000)]
Only check NSArray/NSDictionary boxing method params once.

Once we've found a "good" method, we don't need to check its argument types
again. (Even if we might have later found a "bad" method, we were already
caching the method we first looked up.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156719 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago80-col violations and minor reformatting. No functionality change.
Jordy Rose [Sat, 12 May 2012 17:32:52 +0000 (17:32 +0000)]
80-col violations and minor reformatting. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156718 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoClean up ObjC boxing method checks by reducing duplicated code.
Jordy Rose [Sat, 12 May 2012 17:32:44 +0000 (17:32 +0000)]
Clean up ObjC boxing method checks by reducing duplicated code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156717 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unused variable. Thanks to Dmitri Gribenko for noticing it.
Rafael Espindola [Sat, 12 May 2012 16:35:00 +0000 (16:35 +0000)]
Remove unused variable. Thanks to Dmitri Gribenko for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156715 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't crash on boxed strings when +stringWithUTF8String: is missing.
Jordy Rose [Sat, 12 May 2012 15:53:41 +0000 (15:53 +0000)]
Don't crash on boxed strings when +stringWithUTF8String: is missing.

Also, unify some diagnostics for boxed expressions that have the same form.

Fixes PR12804.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156713 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] RetainCountChecker: track ObjC boxed expression objects.
Jordy Rose [Sat, 12 May 2012 05:10:43 +0000 (05:10 +0000)]
[analyzer] RetainCountChecker: track ObjC boxed expression objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156699 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach the parser to deal with multiple spellings for the same
Douglas Gregor [Fri, 11 May 2012 23:37:49 +0000 (23:37 +0000)]
Teach the parser to deal with multiple spellings for the same
attribute, rather than requiring multiple cases in consumers of this
information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156666 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Test variable modified types.
Anna Zaks [Fri, 11 May 2012 23:34:14 +0000 (23:34 +0000)]
[analyzer] Test variable modified types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156664 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Do not walk the types for call graph construction.
Anna Zaks [Fri, 11 May 2012 23:15:18 +0000 (23:15 +0000)]
[analyzer] Do not walk the types for call graph construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156661 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Test objC boxing.
Anna Zaks [Fri, 11 May 2012 23:15:16 +0000 (23:15 +0000)]
[analyzer] Test objC boxing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156660 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add buffer overflow test case.
Anna Zaks [Fri, 11 May 2012 23:15:11 +0000 (23:15 +0000)]
[analyzer] Add buffer overflow test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156659 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure that we recognize __attribute__((align)) as a synonym for
Douglas Gregor [Fri, 11 May 2012 23:01:43 +0000 (23:01 +0000)]
Make sure that we recognize __attribute__((align)) as a synonym for
__attribute__((aligned)). Fixes <rdar://problem/11435441>, a
regression I introduced in r156003. This is the narrow fix; a more
comprehensive fix is coming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156657 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen diagnosing inaccessible temporary destructors in decltype expressions, use
Richard Smith [Fri, 11 May 2012 22:20:10 +0000 (22:20 +0000)]
When diagnosing inaccessible temporary destructors in decltype expressions, use
the correct type and the correct source location in the diagnostic. Spotted by
Johannes Schaub!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156654 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMerge branch 'format-string-braced-init'
Matt Beaumont-Gay [Fri, 11 May 2012 22:10:59 +0000 (22:10 +0000)]
Merge branch 'format-string-braced-init'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156653 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCoerce byval aggregate arguments to integers whose size matches the integer
Akira Hatanaka [Fri, 11 May 2012 21:56:58 +0000 (21:56 +0000)]
Coerce byval aggregate arguments to integers whose size matches the integer
register size of the target architecture.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156650 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThe Lexer constructor expects a source location at the start of the
Argyrios Kyrtzidis [Fri, 11 May 2012 21:39:18 +0000 (21:39 +0000)]
The Lexer constructor expects a source location at the start of the
file buffer, not at the start of lexing.

Fixes assertion hit in format diagnostics. rdar://11418366

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156647 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix handling of vector return types.
Akira Hatanaka [Fri, 11 May 2012 21:01:17 +0000 (21:01 +0000)]
Fix handling of vector return types.

A vector should be returned via the hidden pointer argument except if its size
is equal to or smaller than 16-bytes and the target ABI is N32 or N64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156642 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHexagon V5 intrinsics support in clang.
Sirish Pande [Fri, 11 May 2012 19:39:08 +0000 (19:39 +0000)]
Hexagon V5 intrinsics support in clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156630 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR11857: When the wrong number of arguments are provided for a function
Richard Smith [Fri, 11 May 2012 05:16:41 +0000 (05:16 +0000)]
PR11857: When the wrong number of arguments are provided for a function
which expects exactly one argument, include the name of the argument in
the diagnostic text. Patch by Terry Long!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156607 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a test case for going through typedefs until we reach "BOOL", that NSAPI::isObjCT...
Argyrios Kyrtzidis [Fri, 11 May 2012 01:53:27 +0000 (01:53 +0000)]
Add a test case for going through typedefs until we reach "BOOL", that NSAPI::isObjCTypedef() is doing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156604 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a recent regression with the merging of format attributes.
Rafael Espindola [Fri, 11 May 2012 00:36:07 +0000 (00:36 +0000)]
Fix a recent regression with the merging of format attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156597 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFor final output files create them with mode 0664 to match other
Eric Christopher [Fri, 11 May 2012 00:10:07 +0000 (00:10 +0000)]
For final output files create them with mode 0664 to match other
compilers and expected defaults.

Part of rdar://11325849

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156592 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[objc] When boxing a BOOL/NSInteger/NSUInteger type, use the corresponding
Argyrios Kyrtzidis [Thu, 10 May 2012 23:12:03 +0000 (23:12 +0000)]
[objc] When boxing a BOOL/NSInteger/NSUInteger type, use the corresponding
numberWithBool:/numberWithInteger:/numberWithUnsignedInteger: NSNumber selectors.

rdar://11428703

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156583 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInclude line that was meant to be in my last commit.
Ted Kremenek [Thu, 10 May 2012 22:49:10 +0000 (22:49 +0000)]
Include line that was meant to be in my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156582 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix insidious RegionStore bug where we (a) didn't handle vector types and (b) had
Ted Kremenek [Thu, 10 May 2012 22:02:39 +0000 (22:02 +0000)]
Fix insidious RegionStore bug where we (a) didn't handle vector types and (b) had
a horrible bug in GetLazyBindings where we falsely appended a field suffix when traversing 3 or more
layers of lazy bindings.  I don't have a reduced test case yet; but I have added the original source
to an internal regression test suite.  I'll see about coming up with a reduced test case.

Fixes <rdar://problem/11405978> (for real).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156580 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Exit early if constraint solver is given a non-integer symbol
Anna Zaks [Thu, 10 May 2012 21:49:52 +0000 (21:49 +0000)]
[analyzer] Exit early if constraint solver is given a non-integer symbol
to reason about.

As part of taint propagation, we now allow creation of non-integer
symbolic expressions like a cast from int to float.

Addresses PR12511 (radar://11215362).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156578 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHexagon V5 FP support.
Sirish Pande [Thu, 10 May 2012 20:19:54 +0000 (20:19 +0000)]
Hexagon V5 FP support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156567 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't crash when using objc boxed expression with parsing error.
Argyrios Kyrtzidis [Thu, 10 May 2012 20:02:36 +0000 (20:02 +0000)]
Don't crash when using objc boxed expression with parsing error.

rdar://11426994

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156565 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen AST-dumping the ObjCBoxedExpr node, also print out what selector it chose.
Argyrios Kyrtzidis [Thu, 10 May 2012 20:02:31 +0000 (20:02 +0000)]
When AST-dumping the ObjCBoxedExpr node, also print out what selector it chose.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156564 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProvide a man page for scan-build. Patch by James Lowden!
Ted Kremenek [Thu, 10 May 2012 19:10:47 +0000 (19:10 +0000)]
Provide a man page for scan-build.  Patch by James Lowden!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156559 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[preprocessor] Make sure that MacroExpands callbacks are always in source order.
Argyrios Kyrtzidis [Thu, 10 May 2012 18:57:19 +0000 (18:57 +0000)]
[preprocessor] Make sure that MacroExpands callbacks are always in source order.

Fixes assertion hit in the preprocessing record. rdar://11426523

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156557 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTest for previously checked in patch.
Fariborz Jahanian [Thu, 10 May 2012 17:05:15 +0000 (17:05 +0000)]
Test for previously checked in patch.
// rdar://11374235

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156552 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix an assertion hit when the serialized diagnostics writer receive a diagnostic
Argyrios Kyrtzidis [Thu, 10 May 2012 05:03:45 +0000 (05:03 +0000)]
Fix an assertion hit when the serialized diagnostics writer receive a diagnostic
from the frontend when the location is invalid and the SourceManager null.

Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it
to the calls accordingly (as reference when it is expected to not be null, or pointer
when it may be null).
This effectively makes DiagnosticRenderer not tied to a specific SourceManager,
removing a hack from TextDiagnosticPrinter.

rdar://11386874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156536 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWarn about visibility attributes in typedefs.
Rafael Espindola [Thu, 10 May 2012 03:01:34 +0000 (03:01 +0000)]
Warn about visibility attributes in typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156534 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix an old (2009) FIXME:
Rafael Espindola [Thu, 10 May 2012 02:50:16 +0000 (02:50 +0000)]
Fix an old (2009) FIXME:

// FIXME: This needs to happen before we merge declarations. Then,
// let attribute merging cope with attribute conflicts.

This was already being done for variables, but for functions we were merging
then first and then applying the attributes. To avoid duplicating merging
logic, some of the helpers in SemaDeclAttr.cpp become methods that can
handle merging two attributes in one decl or inheriting attributes from one
decl to another.

With this change we are now able to produce errors for variables with
incompatible visibility attributes or warn about unused dllimports in
variables.

This changes the attribute list iteration back to being in reverse source
code order, as that matches what decl merging does and avoids differentiating
the two cases is the merge*Attr methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156531 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Do not highlight the range of the statement in case of leak.
Anna Zaks [Thu, 10 May 2012 01:37:40 +0000 (01:37 +0000)]
[analyzer] Do not highlight the range of the statement in case of leak.

We report a leak at a point a leaked variable is no longer accessible.
The statement that happens to be at that point is not relevant to the
leak diagnostic and, thus, should not be highlighted.

radar://11178519

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156530 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRecursiveASTVisitor:
Richard Smith [Wed, 9 May 2012 23:51:36 +0000 (23:51 +0000)]
RecursiveASTVisitor:

We don't create any declaration to mark the explicit instantiation of function
templates other than the instantiation itself, so visit that when traversing
the function template decl.

This is a temporary fix, pending the creation of a Decl node to represent the
explicit instantiation.

Patch by Daniel Jasper!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156522 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjective-c. Fixes a 'fixit' where location of
Fariborz Jahanian [Wed, 9 May 2012 21:49:29 +0000 (21:49 +0000)]
objective-c. Fixes a 'fixit' where location of
'*' on objective-c class name was misplaced.
// rdar://11311333

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156517 91177308-0d34-0410-b5e6-96231b3b80d8