]> granicus.if.org Git - clang/log
clang
15 years agoC++ destructors can have a single unnamed void parameter. Fixes <rdar://problem/6841210>.
Anders Carlsson [Thu, 30 Apr 2009 23:18:11 +0000 (23:18 +0000)]
C++ destructors can have a single unnamed void parameter. Fixes <rdar://problem/6841210>.

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

15 years agoRemove a warning when this file is compiled optimized.
Fariborz Jahanian [Thu, 30 Apr 2009 23:08:58 +0000 (23:08 +0000)]
Remove a warning when this file is compiled optimized.

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

15 years agoRework the way we handle constructor decls to be less hacky and fix PR3948 completely.
Anders Carlsson [Thu, 30 Apr 2009 22:41:11 +0000 (22:41 +0000)]
Rework the way we handle constructor decls to be less hacky and fix PR3948 completely.

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

15 years agoUse of super class ivar to synthesize property is back to being error.
Fariborz Jahanian [Thu, 30 Apr 2009 21:39:24 +0000 (21:39 +0000)]
Use of super class ivar to synthesize property is back to being error.

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

15 years agoretain/release checker: Hook up attributes 'objc_ownership_retain' and
Ted Kremenek [Thu, 30 Apr 2009 20:00:31 +0000 (20:00 +0000)]
retain/release checker: Hook up attributes 'objc_ownership_retain' and
'objc_ownership_release' to the effects on receivers.

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

15 years agoMake a home for exception specs in the AST. Now Sema can hook them up.
Sebastian Redl [Thu, 30 Apr 2009 19:20:55 +0000 (19:20 +0000)]
Make a home for exception specs in the AST. Now Sema can hook them up.

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

15 years agoAllow attributes 'objc_ownership_retain' and 'objc_ownership_release' to be
Ted Kremenek [Thu, 30 Apr 2009 19:18:03 +0000 (19:18 +0000)]
Allow attributes 'objc_ownership_retain' and 'objc_ownership_release' to be
applied to ObjCMethodDecls, not just parameters. This allows one to specific
side-effects on the receiver of a message expression. No checker support yet.

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

15 years agoHook up Sema support for attributes on Objective-C method declarations that
Ted Kremenek [Thu, 30 Apr 2009 18:41:06 +0000 (18:41 +0000)]
Hook up Sema support for attributes on Objective-C method declarations that
appear between the return type and the selector. This is a separate code path
from regular attribute processing, as we only want to (a) accept only a specific
set of attributes in this place and (b) want to distinguish to clients the
context in which an attribute was added to an ObjCMethodDecl.

Currently, the attribute 'objc_ownership_returns' is the only attribute that
uses this new feature. Shortly I will add a warning for 'objc_ownership_returns'
to be placed at the end of a method declaration.

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

15 years agoAdd parsing support in an Objective-C method declaration for attributes between
Ted Kremenek [Thu, 30 Apr 2009 17:55:29 +0000 (17:55 +0000)]
Add parsing support in an Objective-C method declaration for attributes between
the return type and selector. Haven't hooked this up to Sema yet.

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

15 years agoName the "return-type" DiagGroup and reference it in a few places.
Steve Naroff [Thu, 30 Apr 2009 17:53:16 +0000 (17:53 +0000)]
Name the "return-type" DiagGroup and reference it in a few places.

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

15 years agoProperly compute the alignment of typedefs that make use of the
Douglas Gregor [Thu, 30 Apr 2009 17:32:17 +0000 (17:32 +0000)]
Properly compute the alignment of typedefs that make use of the
"aligned" attribute. Previously, we were skipping over these
attributes when we jumped directly to the canonical type. Now,
ASTContext::getTypeInfo walks through typedefs and other
"non-canonical" types manually, looking for "aligned" attributes on
typedefs.

As part of this change, I moved the GNU-specific logic (such as
determining the alignment of void or of a function pointer) out of the
expression evaluator and into ASTContext::getTypeInfo.

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

15 years agoAPI for message dispatch of methods returning floats
Fariborz Jahanian [Thu, 30 Apr 2009 16:31:11 +0000 (16:31 +0000)]
API for message dispatch of methods returning floats
to match gcc's closely.

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

15 years agoWarn about invalid return statements by default.
Steve Naroff [Thu, 30 Apr 2009 16:01:26 +0000 (16:01 +0000)]
Warn about invalid return statements by default.

This fixes <rdar://problem/6839489> 10A345: Clang does not warm about mismatched returns (void return from a bool function)

Will implement -Wreturn-type, -Wno-return-type in another commit.

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

15 years agoUpdate checker build.
Ted Kremenek [Thu, 30 Apr 2009 15:15:37 +0000 (15:15 +0000)]
Update checker build.

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

15 years agoFix for PR4108: be a bit looser with the casts that we accept in
Eli Friedman [Thu, 30 Apr 2009 07:03:22 +0000 (07:03 +0000)]
Fix for PR4108: be a bit looser with the casts that we accept in
constant initializers.

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

15 years agoaccept and ignore two new warning specifiers. -Wno-discard-qual seems easy
Chris Lattner [Thu, 30 Apr 2009 06:36:43 +0000 (06:36 +0000)]
accept and ignore two new warning specifiers.  -Wno-discard-qual seems easy
to hook up if someone was interested.

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

15 years agofix i128 to return in 2 64-bit registers (rax/rdx on x86-64)
Chris Lattner [Thu, 30 Apr 2009 06:22:07 +0000 (06:22 +0000)]
fix i128 to return in 2 64-bit registers (rax/rdx on x86-64)

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

15 years agoonly support int128_t on 64-bit and larger targets. 32-bit targets don't
Chris Lattner [Thu, 30 Apr 2009 06:18:40 +0000 (06:18 +0000)]
only support int128_t on 64-bit and larger targets.  32-bit targets don't
have support for __divti3 and friends.

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

15 years agoHandle case in EvalReturn where we cache out in the ExplodedGraph.
Ted Kremenek [Thu, 30 Apr 2009 05:51:50 +0000 (05:51 +0000)]
Handle case in EvalReturn where we cache out in the ExplodedGraph.

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

15 years agoretain/release checker: Use the ObjCMethodDecl in the @implementation if no
Ted Kremenek [Thu, 30 Apr 2009 05:47:23 +0000 (05:47 +0000)]
retain/release checker: Use the ObjCMethodDecl in the @implementation if no
matching ObjCMethodDecl exists in the @interface.

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

15 years agoretain/release checker: Resolve method decl in @interface after getting the
Ted Kremenek [Thu, 30 Apr 2009 05:41:14 +0000 (05:41 +0000)]
retain/release checker: Resolve method decl in @interface after getting the
ObjCInterfaceDecl, not before.

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

15 years agoint128_t is apparently 128-bit aligned on all 64-bit targets, and
Chris Lattner [Thu, 30 Apr 2009 02:55:13 +0000 (02:55 +0000)]
int128_t is apparently 128-bit aligned on all 64-bit targets, and
not supported on 32-bit targets, so we can define it to be 128-bit
aligned there too :)

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

15 years agoinitial support for __[u]int128_t, which should be basically
Chris Lattner [Thu, 30 Apr 2009 02:43:43 +0000 (02:43 +0000)]
initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC.  The codegen/mangling angle hasn't
been fully ironed out yet.  Note that we accept int128_t even in
32-bit mode, unlike gcc.

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

15 years agoRemove two unused options.
Bill Wendling [Thu, 30 Apr 2009 00:55:13 +0000 (00:55 +0000)]
Remove two unused options.

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

15 years agoSema checking for incorrect placement of __block. Radar 6441502
Mike Stump [Thu, 30 Apr 2009 00:19:40 +0000 (00:19 +0000)]
Sema checking for incorrect placement of __block.  Radar 6441502

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

15 years agoUse the new code gen optimization enum instead of passing in the optimization
Bill Wendling [Wed, 29 Apr 2009 23:53:23 +0000 (23:53 +0000)]
Use the new code gen optimization enum instead of passing in the optimization
level. This is more expressive.

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

15 years agoMake DISABLE_SMART_POINTERS work, again
Douglas Gregor [Wed, 29 Apr 2009 23:37:31 +0000 (23:37 +0000)]
Make DISABLE_SMART_POINTERS work, again

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

15 years agoChange to warning when property uses an ivar in super class
Fariborz Jahanian [Wed, 29 Apr 2009 23:31:56 +0000 (23:31 +0000)]
Change to warning when property uses an ivar in super class
in an @synthesize diective, as it breaks few projects.

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

15 years agoJust because a declaration has the same name as its containing class doesn't mean...
Anders Carlsson [Wed, 29 Apr 2009 23:19:39 +0000 (23:19 +0000)]
Just because a declaration has the same name as its containing class doesn't mean that it's a constructor. Fixes rdar://problem/6815988.

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

15 years agoRevert r70424. We don't need it
Douglas Gregor [Wed, 29 Apr 2009 23:06:13 +0000 (23:06 +0000)]
Revert r70424. We don't need it

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

15 years agoretain/release checker: When determining whether an analyzed method can return
Ted Kremenek [Wed, 29 Apr 2009 23:03:22 +0000 (23:03 +0000)]
retain/release checker: When determining whether an analyzed method can return
an owned object, consult its summary instead of inspecting the selector. This
picks up annotations, and is just more general.

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

15 years agoAdd PCH version to the -v output
Douglas Gregor [Wed, 29 Apr 2009 22:47:43 +0000 (22:47 +0000)]
Add PCH version to the -v output

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

15 years agoUndid setting of the flag for msg_Send for 32bit code gen.
Fariborz Jahanian [Wed, 29 Apr 2009 22:47:27 +0000 (22:47 +0000)]
Undid setting of the flag for msg_Send for 32bit code gen.
It seems to effect code gen. Add a FIXME instead.

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

15 years agoFormat cleanup. No functionality change.
Ted Kremenek [Wed, 29 Apr 2009 22:25:52 +0000 (22:25 +0000)]
Format cleanup.  No functionality change.

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

15 years agoImplement semantic analysis for transparent unions. This is largely
Douglas Gregor [Wed, 29 Apr 2009 22:16:16 +0000 (22:16 +0000)]
Implement semantic analysis for transparent unions. This is largely
based on a patch from Anders Johnsen. CodeGen support is incomplete,
in that we do not properly coerce to the first field's type.

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

15 years agoRemove extra line.
Mike Stump [Wed, 29 Apr 2009 22:11:32 +0000 (22:11 +0000)]
Remove extra line.

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

15 years agoFix null dereference.
Ted Kremenek [Wed, 29 Apr 2009 22:05:03 +0000 (22:05 +0000)]
Fix null dereference.

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

15 years agoBugReporter/PathDiagnostics:
Ted Kremenek [Wed, 29 Apr 2009 21:58:13 +0000 (21:58 +0000)]
BugReporter/PathDiagnostics:
- Add an (optional) short description for BugReports for clients that want
  to distinguish between long and short descriptions for bugs
- Make the bug report for VLA less obscene for Plist diagnostics by using
  the short description

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

15 years agouse of an ivar specified on a property @synthesize
Fariborz Jahanian [Wed, 29 Apr 2009 21:45:02 +0000 (21:45 +0000)]
use of an ivar specified on a property @synthesize
and found in super class triggers a diagnostics.

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

15 years agoFixup Sema and CodeGen for block literal attributes when the return
Mike Stump [Wed, 29 Apr 2009 21:40:37 +0000 (21:40 +0000)]
Fixup Sema and CodeGen for block literal attributes when the return
type and argument types are missing, and let return type deduction
happen before we give errors for returning from a noreturn block.
Radar 6441502

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

15 years agoReformat long line. No functionality change.
Ted Kremenek [Wed, 29 Apr 2009 21:31:59 +0000 (21:31 +0000)]
Reformat long line.  No functionality change.

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

15 years agoMatch addPassesToEmitFile API change.
Evan Cheng [Wed, 29 Apr 2009 21:02:33 +0000 (21:02 +0000)]
Match addPassesToEmitFile API change.

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

15 years agoExport lazy references of .objc_class_name of class names
Fariborz Jahanian [Wed, 29 Apr 2009 20:40:05 +0000 (20:40 +0000)]
Export lazy references of .objc_class_name of class names
referenced in a category implementation meta-data
(Next objc 32bit abi).

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

15 years agoMinor simplification; also silences gcc warning.
Eli Friedman [Wed, 29 Apr 2009 20:29:43 +0000 (20:29 +0000)]
Minor simplification; also silences gcc warning.

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

15 years agoType of msgSend message dispatch API is a vararg.
Fariborz Jahanian [Wed, 29 Apr 2009 19:14:43 +0000 (19:14 +0000)]
Type of msgSend message dispatch API is a vararg.

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

15 years agoSema and CodeGen support for attributes on blocks. Radar 6441502
Mike Stump [Wed, 29 Apr 2009 19:03:13 +0000 (19:03 +0000)]
Sema and CodeGen support for attributes on blocks.  Radar 6441502

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

15 years agoretain/release checker: Hoist code for bug reports above transfer function logic
Ted Kremenek [Wed, 29 Apr 2009 18:50:19 +0000 (18:50 +0000)]
retain/release checker: Hoist code for bug reports above transfer function logic
(those diffs are just code moving) and move the logic for "return of owned
object" leak reporting to EvalReturnStmt.

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

15 years agoMake sure to pass the same options to the static analyzer as the
Daniel Dunbar [Wed, 29 Apr 2009 18:32:25 +0000 (18:32 +0000)]
Make sure to pass the same options to the static analyzer as the
compiler.
 - Code generation options may still affect the language...

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

15 years agoaccept and ignore two new warning options. PR410[45]
Chris Lattner [Wed, 29 Apr 2009 18:15:38 +0000 (18:15 +0000)]
accept and ignore two new warning options.  PR410[45]

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

15 years agoPR4103: improve source location information for members of the current
Eli Friedman [Wed, 29 Apr 2009 17:56:47 +0000 (17:56 +0000)]
PR4103: improve source location information for members of the current
class.  This isn't perfect, but it's a big improvement over not having
any location information.

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

15 years agoHave the parser communicate the exception specification to the action.
Sebastian Redl [Wed, 29 Apr 2009 17:30:04 +0000 (17:30 +0000)]
Have the parser communicate the exception specification to the action.

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

15 years agoAdd version of getMethodSummary() that can be used to query the summary for the
Ted Kremenek [Wed, 29 Apr 2009 17:17:48 +0000 (17:17 +0000)]
Add version of getMethodSummary() that can be used to query the summary for the
method currently being analyzed.

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

15 years agoRename getMethodSummary() -> getInstanceMethodSummary().
Ted Kremenek [Wed, 29 Apr 2009 17:09:14 +0000 (17:09 +0000)]
Rename getMethodSummary() -> getInstanceMethodSummary().

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

15 years agoIntegrate 3 months of ObjC rewriter fixes (from the Apple/objective-rewrite branch).
Steve Naroff [Wed, 29 Apr 2009 16:37:50 +0000 (16:37 +0000)]
Integrate 3 months of ObjC rewriter fixes (from the Apple/objective-rewrite branch).

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

15 years agoPR4103: Silence bogus unused expression warning.
Eli Friedman [Wed, 29 Apr 2009 16:35:53 +0000 (16:35 +0000)]
PR4103: Silence bogus unused expression warning.

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

15 years agoAdd test case for transfer function logic for OSCompareAndSwap32Barrier.
Ted Kremenek [Wed, 29 Apr 2009 16:03:59 +0000 (16:03 +0000)]
Add test case for transfer function logic for OSCompareAndSwap32Barrier.

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

15 years agoAdd corner case logic to BasicStoreManager and GRSimpleVals::EvalBinOp to enable
Ted Kremenek [Wed, 29 Apr 2009 16:03:27 +0000 (16:03 +0000)]
Add corner case logic to BasicStoreManager and GRSimpleVals::EvalBinOp to enable
reasoning about OSCompareAndSwap32Barrier/OSCompareAndSwap64Barrier. Essentially
the address of reference to a region (pointer-to-pointer) can be casted to
(int32_t*), and we need to handle the logic to convert the involved locations
back and forth from nonloc::LocAsInteger, nonloc::ConcreteInt, to Loc and
loc::ConcreteInt respectively. This adds some potentially suspect logic to
BasicStoreManager that allows the analyzer to reason about abuses of the C type
system. This should probably be refined, be ported over to RegionStoreManager,
and extended with "path-sensitive type checking" to flag bugs in clearly
incoherent code.

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

15 years agoMemRegion pretty-printing: Convert DeclName to a string to print out the actual
Ted Kremenek [Wed, 29 Apr 2009 15:37:24 +0000 (15:37 +0000)]
MemRegion pretty-printing: Convert DeclName to a string to print out the actual
name of the tracked function.

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

15 years agoSymbolicRegions may also be live roots.
Zhongxing Xu [Wed, 29 Apr 2009 09:24:35 +0000 (09:24 +0000)]
SymbolicRegions may also be live roots.

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

15 years agoAdded comments to test case.
Zhongxing Xu [Wed, 29 Apr 2009 05:59:48 +0000 (05:59 +0000)]
Added comments to test case.

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

15 years agofix PR4021, array and functions decay in the receiver position of an objc message...
Chris Lattner [Wed, 29 Apr 2009 05:48:32 +0000 (05:48 +0000)]
fix PR4021, array and functions decay in the receiver position of an objc message send.

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

15 years agoFix PR4092 by improving error recovery in two ways:
Chris Lattner [Wed, 29 Apr 2009 05:12:23 +0000 (05:12 +0000)]
Fix PR4092 by improving error recovery in two ways:
1. In a struct field redefinition, don't mark the struct erroneous.  The
   field is erroneous, but the struct is otherwise well formed.
2. Don't emit diagnostics about functions that are known to be broken already.

Either fix is sufficient to silence the second diagnostic in the example,
but the combination is better :)

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

15 years agoretain/release checker: Refactor getMethodSummary() to not depend on ObjCMessageExpr.
Ted Kremenek [Wed, 29 Apr 2009 05:04:30 +0000 (05:04 +0000)]
retain/release checker: Refactor getMethodSummary() to not depend on ObjCMessageExpr.

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

15 years agoimplement -Wformat-security properly, which is enabled by default.
Chris Lattner [Wed, 29 Apr 2009 04:59:47 +0000 (04:59 +0000)]
implement -Wformat-security properly, which is enabled by default.
This enables one specific class of non-literal format warnings.

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

15 years agocode simplification, no functionality change.
Chris Lattner [Wed, 29 Apr 2009 04:49:34 +0000 (04:49 +0000)]
code simplification, no functionality change.

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

15 years agoadd a bunch of individual warnings to -Wformat (which is
Chris Lattner [Wed, 29 Apr 2009 04:41:16 +0000 (04:41 +0000)]
add a bunch of individual warnings to -Wformat (which is
on by default).

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

15 years agoWire up -Wformat=2 and -Wformat-extra-args
Chris Lattner [Wed, 29 Apr 2009 04:31:58 +0000 (04:31 +0000)]
Wire up -Wformat=2 and -Wformat-extra-args

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

15 years ago-Wformat should depend on format-extra-args so that -Wformat implies
Chris Lattner [Wed, 29 Apr 2009 04:16:52 +0000 (04:16 +0000)]
-Wformat should depend on format-extra-args so that -Wformat implies
the extra argument warnings, and -Wformat -Wno-format-extra-args
turns on -Wformat but not the extra-args warnings.

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

15 years agotweak warning options to be more like gcc:
Chris Lattner [Wed, 29 Apr 2009 04:15:07 +0000 (04:15 +0000)]
tweak warning options to be more like gcc:

1. All all variants of -Wformat*, make them imply -Wformat.  GCC warns
   if you use -Wformatfoo without -Wformat.  We just make one imply the
   other.
2. Make -Wformat-nonliteral default to off, like gcc.  It is an incredible
   nuisance.
3. Accept but currently ignore -Wformat-extra-args.

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

15 years agominor code cleanup
Chris Lattner [Wed, 29 Apr 2009 04:12:34 +0000 (04:12 +0000)]
minor code cleanup

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

15 years agoUpdate test case.
Zhongxing Xu [Wed, 29 Apr 2009 02:37:26 +0000 (02:37 +0000)]
Update test case.

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

15 years agoAs discussed with Ted offline, re-apply r70293.
Zhongxing Xu [Wed, 29 Apr 2009 02:30:09 +0000 (02:30 +0000)]
As discussed with Ted offline, re-apply r70293.

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

15 years agoXFAIL the test case.
Zhongxing Xu [Wed, 29 Apr 2009 01:50:12 +0000 (01:50 +0000)]
XFAIL the test case.

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

15 years agoAdd incredibly bare bones docs/tools.
Daniel Dunbar [Wed, 29 Apr 2009 01:00:32 +0000 (01:00 +0000)]
Add incredibly bare bones docs/tools.
 - Mirroring LLVM's docs/CommandGuide, a place to put .pod files which
   are used to generate man/html/etc documentation for tools provided
   as part of clang.

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

15 years agoImplement sema checking for noreturn.
Mike Stump [Wed, 29 Apr 2009 00:43:21 +0000 (00:43 +0000)]
Implement sema checking for noreturn.

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

15 years agoretain/release checker: Refactor the guts of getClassMethodSummary to not depend
Ted Kremenek [Wed, 29 Apr 2009 00:42:39 +0000 (00:42 +0000)]
retain/release checker: Refactor the guts of getClassMethodSummary to not depend
on ObjCMessageExpr. This will enable us to use it elsewhere. This should not
change any functionality.

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

15 years agoAdd regression test case provided by <rdar://problem/6833332>.
Ted Kremenek [Wed, 29 Apr 2009 00:41:31 +0000 (00:41 +0000)]
Add regression test case provided by <rdar://problem/6833332>.

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

15 years agoEnable PCH by default
Douglas Gregor [Tue, 28 Apr 2009 22:44:02 +0000 (22:44 +0000)]
Enable PCH by default

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

15 years agoForce driver's PTH test to use PTH
Douglas Gregor [Tue, 28 Apr 2009 22:43:20 +0000 (22:43 +0000)]
Force driver's PTH test to use PTH

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

15 years agoIn -fdiagnostics-print-source-range-info mode, print a space before the
Chris Lattner [Tue, 28 Apr 2009 22:33:16 +0000 (22:33 +0000)]
In -fdiagnostics-print-source-range-info mode, print a space before the
lines that clang extracts from the source code so that machine parsing can
easily ignore them.

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

15 years agoImplement ownership attribute 'objc_ownership_make_collectable'. This allows one
Ted Kremenek [Tue, 28 Apr 2009 22:32:26 +0000 (22:32 +0000)]
Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.

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

15 years agoadd support for -Wendif-labels, PR4101
Chris Lattner [Tue, 28 Apr 2009 22:19:16 +0000 (22:19 +0000)]
add support for -Wendif-labels, PR4101

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

15 years agoMake all PCH-incompatibility warnings into errors, and abort
Douglas Gregor [Tue, 28 Apr 2009 22:01:16 +0000 (22:01 +0000)]
Make all PCH-incompatibility warnings into errors, and abort
compilation if the user requested a PCH file but no such PCH file
exists.

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

15 years agoMake the PCH reader use the diagnostics system for its complaints.
Douglas Gregor [Tue, 28 Apr 2009 21:53:25 +0000 (21:53 +0000)]
Make the PCH reader use the diagnostics system for its complaints.

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

15 years agoImplement -Wfour-char-constants, which is an extension, not an extwarn,
Chris Lattner [Tue, 28 Apr 2009 21:51:46 +0000 (21:51 +0000)]
Implement -Wfour-char-constants, which is an extension, not an extwarn,
and apparently not part of -Wall

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

15 years agoImprove retain/release test cases for ownership attributes.
Ted Kremenek [Tue, 28 Apr 2009 21:43:40 +0000 (21:43 +0000)]
Improve retain/release test cases for ownership attributes.

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

15 years agoOptimize IdentifierInfo storage within the precompiled header. We've
Douglas Gregor [Tue, 28 Apr 2009 21:32:13 +0000 (21:32 +0000)]
Optimize IdentifierInfo storage within the precompiled header. We've
now gotten back about 180k of the 500k we lost.

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

15 years agoImplement a minor space optimization for the PCH identifier table,
Douglas Gregor [Tue, 28 Apr 2009 21:18:29 +0000 (21:18 +0000)]
Implement a minor space optimization for the PCH identifier table,
which eliminates the storage for IdentifierInfo in the "uninteresting
identifier" cases. Sadly, this only brought back 7k of the 500k we
lost :(

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

15 years agoFix a typo noticed by Gabor
Douglas Gregor [Tue, 28 Apr 2009 21:06:13 +0000 (21:06 +0000)]
Fix a typo noticed by Gabor

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

15 years agoReplace a lame fprintf with a slightly-less lame diagnostic
Douglas Gregor [Tue, 28 Apr 2009 20:36:16 +0000 (20:36 +0000)]
Replace a lame fprintf with a slightly-less lame diagnostic

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

15 years agoImplement checking for macro definitions that occur on the command
Douglas Gregor [Tue, 28 Apr 2009 20:33:11 +0000 (20:33 +0000)]
Implement checking for macro definitions that occur on the command
line when using a PCH that were not provided when building the PCH
file. If those names were used as identifiers somewhere in the PCH
file, reject the PCH file.

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

15 years agoRevert r70075 and r70078, which reorganized the PCH on-disk hash table
Douglas Gregor [Tue, 28 Apr 2009 20:01:51 +0000 (20:01 +0000)]
Revert r70075 and r70078, which reorganized the PCH on-disk hash table
for identifiers to separate "interesting" from "uninteresting"
identifiers. However, to cope with compiler invocations where the
predefines buffers mismatch, we need to be able to search the complete
identifier table. Cocoa.h.pch is now about 500k larger that it used to
be :(

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

15 years agoWith -ccc-pch-is-pch, always treat precompiled inputs as PCH,
Daniel Dunbar [Tue, 28 Apr 2009 19:38:45 +0000 (19:38 +0000)]
With -ccc-pch-is-pch, always treat precompiled inputs as PCH,
regardless of extension.
 - Otherwise we can't expect that just plugging in -ccc-pch-is-pch
   will work.

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

15 years agoPR4097: add logic to Evaluate to handle pointer equality comparisons.
Eli Friedman [Tue, 28 Apr 2009 19:17:36 +0000 (19:17 +0000)]
PR4097: add logic to Evaluate to handle pointer equality comparisons.

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

15 years agoAllow some differences between the predefines buffer used to build a
Douglas Gregor [Tue, 28 Apr 2009 18:58:38 +0000 (18:58 +0000)]
Allow some differences between the predefines buffer used to build a
PCH file and the predefines buffer used when including the PCH
file. We (explicitly) detect conflicting macro definitions (rejecting
the PCH file) and about missing macro definitions (they'll be
automatically pulled from the PCH file anyway).

We're missing some checking to make sure that new macro definitions
won't have any impact on the PCH file itself (e.g., #define'ing an
identifier that the PCH file used).

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

15 years agoimplement -Wmultichar
Chris Lattner [Tue, 28 Apr 2009 18:52:02 +0000 (18:52 +0000)]
implement -Wmultichar

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

15 years agoAdd some text to the user manual describing the current state of C
Eli Friedman [Tue, 28 Apr 2009 18:48:34 +0000 (18:48 +0000)]
Add some text to the user manual describing the current state of C
support in clang.

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

15 years agoRevert 70293.
Ted Kremenek [Tue, 28 Apr 2009 18:48:13 +0000 (18:48 +0000)]
Revert 70293.

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

15 years agomerge number.c into constants.c and start running it in -verify mode.
Chris Lattner [Tue, 28 Apr 2009 18:43:12 +0000 (18:43 +0000)]
merge number.c into constants.c and start running it in -verify mode.

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

15 years agoFix a minor edge case in C89 mode related to the definition of a
Eli Friedman [Tue, 28 Apr 2009 17:59:09 +0000 (17:59 +0000)]
Fix a minor edge case in C89 mode related to the definition of a
"function designator".

(This causes a minor glitch in the
diagnostics for C++ member pointers, but we weren't printing the
right diagnostic there anyway.)

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