]> granicus.if.org Git - clang/log
clang
15 years agoDriver: Generate an error when trying to pass an LLVM bc input to a
Daniel Dunbar [Sat, 2 May 2009 20:14:53 +0000 (20:14 +0000)]
Driver: Generate an error when trying to pass an LLVM bc input to a
non-Darwin linker (sorry Gold + LTO-plugin users).

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

15 years agoUse clang to find clang-cc, if it isn't in path.
Daniel Dunbar [Sat, 2 May 2009 20:08:07 +0000 (20:08 +0000)]
Use clang to find clang-cc, if it isn't in path.

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

15 years agowhen creating custom warning diagnostics, do not attempt to map
Chris Lattner [Sat, 2 May 2009 19:34:21 +0000 (19:34 +0000)]
when creating custom warning diagnostics, do not attempt to map
them with -Werror.  Custom diags cannot be mapped, and this makes
-Werror cause a determinstic crash for the checker and other
clients of the custom diagnostics machinery.  rdar://6816191

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

15 years agoretain/release checker: Enhance leak description to say that the bug
Ted Kremenek [Sat, 2 May 2009 19:05:19 +0000 (19:05 +0000)]
retain/release checker: Enhance leak description to say that the bug
occurs in GC mode.

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

15 years agoFix a thinko and a test.
Anders Carlsson [Sat, 2 May 2009 18:36:10 +0000 (18:36 +0000)]
Fix a thinko and a test.

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

15 years agoDragonFly ToolChain definition for driver.
Daniel Dunbar [Sat, 2 May 2009 18:28:39 +0000 (18:28 +0000)]
DragonFly ToolChain definition for driver.
 - Patch by Alex Hornung!

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

15 years agoDowngrade the invalid offsetof error to a warning.
Anders Carlsson [Sat, 2 May 2009 17:45:47 +0000 (17:45 +0000)]
Downgrade the invalid offsetof error to a warning.

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

15 years agoWhen determining whether an expression refers to a bit-field, look
Douglas Gregor [Sat, 2 May 2009 02:18:30 +0000 (02:18 +0000)]
When determining whether an expression refers to a bit-field, look
into the left-hand side of an assignment expression. This completes
most of PR3500; the only remaining part is to deal with the
GCC-specific implementation-defined behavior for "unsigned long" (and
other) bit-fields.

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

15 years agoAdd CFG support for @synchronized. This fixes <rdar://problem/6848820>.
Ted Kremenek [Sat, 2 May 2009 01:49:13 +0000 (01:49 +0000)]
Add CFG support for @synchronized.  This fixes <rdar://problem/6848820>.

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

15 years agoWhen creating a dwarf record type for an objc interface, make sure to propagate
Chris Lattner [Sat, 2 May 2009 01:13:16 +0000 (01:13 +0000)]
When creating a dwarf record type for an objc interface, make sure to propagate
the runtime version number onto it, so that the debugger knows it's an objc
interface, not a C struct.  rdar://6848435

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

15 years agocapture whether optimizations are enabled or not in debug info
Chris Lattner [Sat, 2 May 2009 01:04:13 +0000 (01:04 +0000)]
capture whether optimizations are enabled or not in debug info

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

15 years agoencode the version of the objc runtime into the dwarf compile unit. rdar://6848435,
Chris Lattner [Sat, 2 May 2009 01:00:04 +0000 (01:00 +0000)]
encode the version of the objc runtime into the dwarf compile unit.  rdar://6848435,
several other fixes coming.

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

15 years agoUpdate checker build.
Ted Kremenek [Sat, 2 May 2009 00:42:33 +0000 (00:42 +0000)]
Update checker build.

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

15 years agoAdd another null pointer check test case.
Ted Kremenek [Sat, 2 May 2009 00:41:02 +0000 (00:41 +0000)]
Add another null pointer check test case.

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

15 years agoFix bitfield promotions in several more cases. We don't seem to work hard enough...
Douglas Gregor [Sat, 2 May 2009 00:36:19 +0000 (00:36 +0000)]
Fix bitfield promotions in several more cases. We don't seem to work hard enough at determining whether an expression is a bitfield or not, yet.

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

15 years agoFix crasher in CFG construction when not properly handling ASTs that contain
Ted Kremenek [Sat, 2 May 2009 00:13:27 +0000 (00:13 +0000)]
Fix crasher in CFG construction when not properly handling ASTs that contain
expressions not yet properly handled by the CFGBuilder. This failure resulted in
a null CFGBlock* being used in rare cases (causing a crash).

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

15 years agoWhen -fmessage-length=N is not specified, and if standard error is
Douglas Gregor [Sat, 2 May 2009 00:03:46 +0000 (00:03 +0000)]
When -fmessage-length=N is not specified, and if standard error is
going to a terminal, word-wrap to the length of the terminal.

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

15 years agoexplicitly know that the alignment of Type* is 3 bits.
Chris Lattner [Fri, 1 May 2009 23:47:59 +0000 (23:47 +0000)]
explicitly know that the alignment of Type* is 3 bits.

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

15 years agoAdd Sema checking for __block on vm declarations. Radar 6441502
Mike Stump [Fri, 1 May 2009 23:41:47 +0000 (23:41 +0000)]
Add Sema checking for __block on vm declarations.  Radar 6441502

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

15 years agoAdd another test case found due to an analyzer regression.
Ted Kremenek [Fri, 1 May 2009 23:35:18 +0000 (23:35 +0000)]
Add another test case found due to an analyzer regression.

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

15 years agoMake install target actually work, dependencies FTW.
Daniel Dunbar [Fri, 1 May 2009 23:34:58 +0000 (23:34 +0000)]
Make install target actually work, dependencies FTW.

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

15 years agoWhen printing a source line as part of a diagnostic, the source line
Douglas Gregor [Fri, 1 May 2009 23:32:58 +0000 (23:32 +0000)]
When printing a source line as part of a diagnostic, the source line
might be wider than we're supposed to print. In this case, we try to
select the "important" subregion of the source line, which contains
everything that we want to show (e.g., with underlining and the caret
itself) and tries to also contain some of the context.

From the fantastically long line in the test case, we get an error
message that slices down to this:

message-length.c:18:120: warning: comparison of distinct pointer types
      ('int *' and 'float *')
  a_func_to_call(ip == FloatPointer, ip[ALongIndexName],
                 ~~ ^  ~~~~~~~~~~~~

There are a bunch of gee-it-sounds-good heuristics in here, which seem
to do well on the various simple tests I've thrown at it. However,
we're going to need to look at a bunch more diagnostics to tweak these
heuristics.

This is the second part of <rdar://problem/6711348>. Almost there!

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

15 years agoIt's an error to call offsetof on a non-POD type.
Anders Carlsson [Fri, 1 May 2009 23:20:30 +0000 (23:20 +0000)]
It's an error to call offsetof on a non-POD type.

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

15 years agoAdd ONLY_MAN_DOCS variable to only install the man page, not the html
Daniel Dunbar [Fri, 1 May 2009 23:11:42 +0000 (23:11 +0000)]
Add ONLY_MAN_DOCS variable to only install the man page, not the html
and ps documentation.

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

15 years agoGet rid of CXXDestroyExpr.
Anders Carlsson [Fri, 1 May 2009 22:21:22 +0000 (22:21 +0000)]
Get rid of CXXDestroyExpr.

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

15 years agoAdd a new BFS GRWorkList and make it the default worklist model for
Ted Kremenek [Fri, 1 May 2009 22:18:46 +0000 (22:18 +0000)]
Add a new BFS GRWorkList and make it the default worklist model for
GRCoreEngine. This tends to result in shorter paths for pathological cases.

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

15 years agoRename CXXExprWithCleanup to CXXExprWithTemporaries.
Anders Carlsson [Fri, 1 May 2009 22:18:43 +0000 (22:18 +0000)]
Rename CXXExprWithCleanup to CXXExprWithTemporaries.

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

15 years agoWe can now call member functions where the base is a pointer.
Anders Carlsson [Fri, 1 May 2009 21:55:16 +0000 (21:55 +0000)]
We can now call member functions where the base is a pointer.

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

15 years agoImplement -fmessage-length=N, which word-wraps diagnostics to N columns.
Douglas Gregor [Fri, 1 May 2009 21:53:04 +0000 (21:53 +0000)]
Implement -fmessage-length=N, which word-wraps diagnostics to N columns.

Also, put a line of whitespace between the diagnostic and the source
code/caret line when the start of the actual source code text lines up
(or nearly lines up) with the most recent line of the diagnostic. For
example, here it's okay for the last line of the diagnostic to be
(vertically) next to the source line, because there is horizontal
whitespace to separate them:

decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin
      type can only take one argument
  typeof(int)(a,5)<<a;

However, here is a case where we need the vertical separation (since
there is no horizontal separation):

message-length.c:10:46: warning: incompatible pointer types initializing 'void
      (int, float, char, float)', expected 'int (*)(int, float, short,
      float)'

      int (*fp1)(int, float, short, float) = f;

This is part one of <rdar://problem/6711348>.

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

15 years agoImplement bit-field promotion rules for C99. Fixes PR3500.
Douglas Gregor [Fri, 1 May 2009 20:41:21 +0000 (20:41 +0000)]
Implement bit-field promotion rules for C99. Fixes PR3500.

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

15 years agoAdd support for -Wno-format-zero-length.
Eli Friedman [Fri, 1 May 2009 20:41:13 +0000 (20:41 +0000)]
Add support for -Wno-format-zero-length.

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

15 years agoCheck for method type conflict between declaration in
Fariborz Jahanian [Fri, 1 May 2009 20:07:12 +0000 (20:07 +0000)]
Check for method type conflict between declaration in
class/protocol and implementation which could be
an imm. implementation or down in the inheritance
hierarchy.

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

15 years agoReplace more release+static_cast with takeAs.
Anders Carlsson [Fri, 1 May 2009 19:49:17 +0000 (19:49 +0000)]
Replace more release+static_cast with takeAs.

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

15 years agoReplace a bunch of static_cast + release with takeAs.
Anders Carlsson [Fri, 1 May 2009 19:30:39 +0000 (19:30 +0000)]
Replace a bunch of static_cast + release with takeAs.

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

15 years agoStoreManager::CastRegion:
Ted Kremenek [Fri, 1 May 2009 19:22:20 +0000 (19:22 +0000)]
StoreManager::CastRegion:
- Don't layer TypedViewRegions on top of any region except
  SymbolicRegions and AllocaRegions.  This follows from my offline
  discussion within Zhongxing about how TypedViewRegions really only
  represent memory getting re-appropriated for a new purpose.

Fallout from this change:
- Move test case from xfail_rdar_6440393.m to misc-ps-64.m
  (it now passes).

- test/Analysis/fields.c now fails for region store (crash).
  Marking XFAIL.

- test/Analysis/rdar-6441136-region.c now fails (only runs with region store).
  Marking XFAIL.

  Diagnosis: The analyzer now correctly identifies an early out-of-bounds memory
   access then the one flagged:

  rdar-6541136-region.c:17:3: warning: Load or store into an out-of-bound memory position.
    *p = 1;
    ^~

  Changing the line:
   char *p = (void*) &wonky[1];
  to
   char *p = (void*) &wonky[0];

  (which should delay the buffer overrun) causes region store to crash, probably
  because it expects a TypedViewRegion.

- test/Analysis/casts.c (region store) now fails (crash).
  Marking XFAIL.

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

15 years agoBasic Store: Always convert a non::LocAsInteger to a Loc when storing to a pointer.
Ted Kremenek [Fri, 1 May 2009 19:04:28 +0000 (19:04 +0000)]
Basic Store: Always convert a non::LocAsInteger to a Loc when storing to a pointer.

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

15 years agoUpdate CMake file.
Ted Kremenek [Fri, 1 May 2009 18:43:00 +0000 (18:43 +0000)]
Update CMake file.

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

15 years agoGet rid of the implicit deref call when calling member functions where the base is...
Anders Carlsson [Fri, 1 May 2009 18:34:30 +0000 (18:34 +0000)]
Get rid of the implicit deref call when calling member functions where the base is a pointer.

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

15 years agoAdd function prototype for OSAtomicCompareAndSwap32Barrier.
Ted Kremenek [Fri, 1 May 2009 17:37:31 +0000 (17:37 +0000)]
Add function prototype for OSAtomicCompareAndSwap32Barrier.

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

15 years agoFix run line in failing test case (it was missing the '%s' for the
Ted Kremenek [Fri, 1 May 2009 17:29:33 +0000 (17:29 +0000)]
Fix run line in failing test case (it was missing the '%s' for the
file name, thus causing the test case to hang).

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

15 years agoteach -parse-noop about int128_t and friends.
Chris Lattner [Fri, 1 May 2009 16:33:20 +0000 (16:33 +0000)]
teach -parse-noop about int128_t and friends.

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

15 years agoBugReporter (extensive diagnostics): introduce the notion of a "dead"
Ted Kremenek [Fri, 1 May 2009 16:08:09 +0000 (16:08 +0000)]
BugReporter (extensive diagnostics): introduce the notion of a "dead"
location context.  This allows us to postpone the decision of whether
or not a context should add a control-flow piece to the diagnostics
when inspecting its subexpressions.

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

15 years agoFinish a thought in CheckVariableDeclaration's comment. No functionality change
Douglas Gregor [Fri, 1 May 2009 15:47:09 +0000 (15:47 +0000)]
Finish a thought in CheckVariableDeclaration's comment. No functionality change

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

15 years agoAdd testcase that illustrates the problem from r69699 regarding tentative definitions...
Douglas Gregor [Fri, 1 May 2009 15:45:53 +0000 (15:45 +0000)]
Add testcase that illustrates the problem from r69699 regarding tentative definitions of statics

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

15 years agoRemove #if 0'ed code.
Ted Kremenek [Fri, 1 May 2009 15:19:33 +0000 (15:19 +0000)]
Remove #if 0'ed code.

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

15 years agoAdd failing static analyzer case (this crashes).
Ted Kremenek [Fri, 1 May 2009 04:13:51 +0000 (04:13 +0000)]
Add failing static analyzer case (this crashes).

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

15 years agoPR4013 and PR4105: pointer-like types can only be cast to/from integers
Eli Friedman [Fri, 1 May 2009 02:23:58 +0000 (02:23 +0000)]
PR4013 and PR4105: pointer-like types can only be cast to/from integers
and other pointer-like types.

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

15 years agoC/ObjC work well enough with clang for them not to be a gcc strength anymore.
Chris Lattner [Fri, 1 May 2009 01:42:13 +0000 (01:42 +0000)]
C/ObjC work well enough with clang for them not to be a gcc strength anymore.

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

15 years agoadd word
Chris Lattner [Fri, 1 May 2009 01:40:42 +0000 (01:40 +0000)]
add word

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

15 years agoC/ObjC work well enough to claim support for them now.
Chris Lattner [Fri, 1 May 2009 01:40:17 +0000 (01:40 +0000)]
C/ObjC work well enough to claim support for them now.

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

15 years agoDon't assert when we think we need copy/dispose, but don't need them.
Mike Stump [Fri, 1 May 2009 01:31:57 +0000 (01:31 +0000)]
Don't assert when we think we need copy/dispose, but don't need them.
Radar 6838889

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

15 years agoDon't use indirect memory destinations for inline asm. Fixes 6841383.
Anders Carlsson [Fri, 1 May 2009 00:16:04 +0000 (00:16 +0000)]
Don't use indirect memory destinations for inline asm. Fixes 6841383.

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

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