]> granicus.if.org Git - clang/log
clang
16 years agostatic analyzer: Handle casts from arrays to integers. This fixes PR 3297.
Ted Kremenek [Tue, 13 Jan 2009 01:04:21 +0000 (01:04 +0000)]
static analyzer: Handle casts from arrays to integers.  This fixes PR 3297.

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

16 years agoInvert condition on branch (was causing RegionStore::ArrayToPointer to return 'unknow...
Ted Kremenek [Tue, 13 Jan 2009 01:03:27 +0000 (01:03 +0000)]
Invert condition on branch (was causing RegionStore::ArrayToPointer to return 'unknown' on most cases.

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

16 years agoAdd the proper restrictions on the left-hand argument of a built-in
Douglas Gregor [Tue, 13 Jan 2009 00:52:54 +0000 (00:52 +0000)]
Add the proper restrictions on the left-hand argument of a built-in
assignment operator candidate (C++ [over.match.oper]p4).

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

16 years agoMake sure we don't name a constructor or destructor with a qualified
Douglas Gregor [Tue, 13 Jan 2009 00:11:19 +0000 (00:11 +0000)]
Make sure we don't name a constructor or destructor with a qualified
type. It leads to very weird errors.

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

16 years agoPatch to implement code gen for aggrgate-valued property used
Fariborz Jahanian [Mon, 12 Jan 2009 23:27:26 +0000 (23:27 +0000)]
Patch to implement code gen for aggrgate-valued property used
to access a field of its type.

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

16 years agoCleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak
Douglas Gregor [Mon, 12 Jan 2009 23:27:07 +0000 (23:27 +0000)]
Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak

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

16 years agoUpdate C++ status and add a few more tests of overloading for member function calls
Douglas Gregor [Mon, 12 Jan 2009 23:20:38 +0000 (23:20 +0000)]
Update C++ status and add a few more tests of overloading for member function calls

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

16 years agoFix test case (incomplete "expected-warning" line)
Ted Kremenek [Mon, 12 Jan 2009 23:09:55 +0000 (23:09 +0000)]
Fix test case (incomplete "expected-warning" line)

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

16 years agoPatch by Roman Divacky:
Ted Kremenek [Mon, 12 Jan 2009 23:09:09 +0000 (23:09 +0000)]
Patch by Roman Divacky:

Extend string-literal checking for printf() format string to handle conditional
ternary operators where both sides are literals.

This fixes PR 3319: http://llvm.org/bugs/show_bug.cgi?id=3319

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

16 years agoFix crasher due to use-after-release: DeclContext now owns all ObjCMethodDecls, and...
Ted Kremenek [Mon, 12 Jan 2009 22:49:54 +0000 (22:49 +0000)]
Fix crasher due to use-after-release: DeclContext now owns all ObjCMethodDecls, and shouldn't be released elsewhere.

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

16 years agoImplement support for anonymous structs and unions in C. Both C and
Douglas Gregor [Mon, 12 Jan 2009 22:49:06 +0000 (22:49 +0000)]
Implement support for anonymous structs and unions in C. Both C and
C++ handle anonymous structs/unions in the same way. Addresses several
bugs:

  <rdar://problem/6259534>
  <rdar://problem/6481130>
  <rdar://problem/6483159>

The test case in PR clang/1750 now passes with -fsyntax-only, but
CodeGen for inline assembler still fails.

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

16 years agoccc: Bug fix, output can be NULL.
Daniel Dunbar [Mon, 12 Jan 2009 22:19:59 +0000 (22:19 +0000)]
ccc: Bug fix, output can be NULL.

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

16 years agoretain/release checker:
Ted Kremenek [Mon, 12 Jan 2009 21:45:02 +0000 (21:45 +0000)]
retain/release checker:
- Refactor a bunch of logic in the retain/release checker, making it more
  condense and easier to read.
- Add support for "Create" methods in the DiskArbitration framework

retain/release tests:
- Rename CFDate.m to retain-release.m, and move test from CFString.c to
  retain-release.m
- Add DiskArbitration framework tests cases.
- Add/refine and few more retain/release GC test cases.

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

16 years agoccc: Even more Darwin/cc1 argument translation support.
Daniel Dunbar [Mon, 12 Jan 2009 21:44:10 +0000 (21:44 +0000)]
ccc: Even more Darwin/cc1 argument translation support.

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

16 years ago(LLVM up) Match TargetData API change in LLVM TOT.
Daniel Dunbar [Mon, 12 Jan 2009 21:08:18 +0000 (21:08 +0000)]
(LLVM up) Match TargetData API change in LLVM TOT.

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

16 years agoPatch to supprt case of readonly property being
Fariborz Jahanian [Mon, 12 Jan 2009 19:55:42 +0000 (19:55 +0000)]
Patch to supprt case of readonly property being
assigned to when it has user declared setter method
defined in the class implementation (but no declaration in
the class itself).

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

16 years agoccc: Add leading space in -### output to match gcc.
Daniel Dunbar [Mon, 12 Jan 2009 19:36:35 +0000 (19:36 +0000)]
ccc: Add leading space in -### output to match gcc.

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

16 years agoccc: (Darwin) More argument translation for Darwin/Compile tool.
Daniel Dunbar [Mon, 12 Jan 2009 18:51:02 +0000 (18:51 +0000)]
ccc: (Darwin) More argument translation for Darwin/Compile tool.

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

16 years agoProperly set the scope of non-fields declared within a struct, union,
Douglas Gregor [Mon, 12 Jan 2009 18:45:55 +0000 (18:45 +0000)]
Properly set the scope of non-fields declared within a struct, union,
or enum to be outside that struct, union, or enum. Fixes several
regressions:

  <rdar://problem/6487662>
  <rdar://problem/6487669>
  <rdar://problem/6487684>
  <rdar://problem/6487702>
  PR clang/3305
  PR clang/3312

There is still some work to do in Objective-C++, but this requires
that each of the Objective-C entities (interfaces, implementations,
etc.) to be introduced into the context stack with
PushDeclContext/PopDeclContext. This will be a separate fix, later.

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

16 years agoccc: (Darwin) More argument translation for Darwin/Compile tool.
Daniel Dunbar [Mon, 12 Jan 2009 17:53:19 +0000 (17:53 +0000)]
ccc: (Darwin) More argument translation for Darwin/Compile tool.

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

16 years agoccc: (Darwin) Start implementing argument translation for
Daniel Dunbar [Mon, 12 Jan 2009 09:23:15 +0000 (09:23 +0000)]
ccc: (Darwin) Start implementing argument translation for
Darwin/Compile tool.

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

16 years agoccc: When constructing a named output, only use base name (not full
Daniel Dunbar [Mon, 12 Jan 2009 07:48:07 +0000 (07:48 +0000)]
ccc: When constructing a named output, only use base name (not full
path).

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

16 years agoccc: (Darwin) Move path resolution into ToolChain.
Daniel Dunbar [Mon, 12 Jan 2009 07:45:49 +0000 (07:45 +0000)]
ccc: (Darwin) Move path resolution into ToolChain.

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

16 years agoccc: Implement the rest of Darwin/Assembler argument translation.
Daniel Dunbar [Mon, 12 Jan 2009 07:40:25 +0000 (07:40 +0000)]
ccc: Implement the rest of Darwin/Assembler argument translation.

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

16 years agoccc: Implement macosx-version-min conditions (including a bug fix).
Daniel Dunbar [Mon, 12 Jan 2009 05:02:38 +0000 (05:02 +0000)]
ccc: Implement macosx-version-min conditions (including a bug fix).

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

16 years agoccc: Generalize Darwin/Link tool based on Darwin version.
Daniel Dunbar [Mon, 12 Jan 2009 04:21:12 +0000 (04:21 +0000)]
ccc: Generalize Darwin/Link tool based on Darwin version.

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

16 years agoccc: Support arguments which behave like linker inputs.
Daniel Dunbar [Mon, 12 Jan 2009 03:33:58 +0000 (03:33 +0000)]
ccc: Support arguments which behave like linker inputs.
 - Support comma joined options which magically turn into multiple
   value arguments (e.g., -Wl,)

 - Split out separate Arg::render routine for when an argument is
   being rendered as an input (as opposed to in its original form).

 - Add option flag for options which should be rendered without the
   option when they are used as an input (e.g., -Xlinker or -o).

 - Support -weak-l..., -weak_framework, and -weak_library.

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

16 years agoccc: (Darwin) Pass -ObjC to linker if -ObjC, -ObjC++ or -fobjc is
Daniel Dunbar [Mon, 12 Jan 2009 02:24:21 +0000 (02:24 +0000)]
ccc: (Darwin) Pass -ObjC to linker if -ObjC, -ObjC++ or -fobjc is
present.

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

16 years agoHandle multi-value inputs
Anders Carlsson [Mon, 12 Jan 2009 02:22:13 +0000 (02:22 +0000)]
Handle multi-value inputs

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

16 years agoMake sure to initialize the ConstraintInfo to 0
Anders Carlsson [Mon, 12 Jan 2009 02:15:29 +0000 (02:15 +0000)]
Make sure to initialize the ConstraintInfo to 0

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

16 years agosome more minor asqualtype bugs.
Chris Lattner [Mon, 12 Jan 2009 00:21:19 +0000 (00:21 +0000)]
some more minor asqualtype bugs.

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

16 years agoimprove some more is*Type predicates to look through asqualtypes.
Chris Lattner [Mon, 12 Jan 2009 00:10:42 +0000 (00:10 +0000)]
improve some more is*Type predicates to look through asqualtypes.

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

16 years agotestcase that works now with r62061
Chris Lattner [Mon, 12 Jan 2009 00:08:58 +0000 (00:08 +0000)]
testcase that works now with r62061

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

16 years agosimplify these predicates a bit.
Chris Lattner [Sun, 11 Jan 2009 23:59:49 +0000 (23:59 +0000)]
simplify these predicates a bit.

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

16 years agomake ScalarExprEmitter::EmitCompare() emit the expression with the correct type inste...
Nuno Lopes [Sun, 11 Jan 2009 23:22:37 +0000 (23:22 +0000)]
make ScalarExprEmitter::EmitCompare() emit the expression with the correct type instead of always zext it to an int
this fixes codegen of simple exprs in C++ like 'if (x != 0)'

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

16 years agoccc: Add fairly complete argument translation for Darwin link step.
Daniel Dunbar [Sun, 11 Jan 2009 23:13:15 +0000 (23:13 +0000)]
ccc: Add fairly complete argument translation for Darwin link step.
 - Some things are still hardcoded, and macosx-version-min comparison
   isn't implemented, but otherwise this very closely matches gcc.

 - The one exception is that arguments (like -framework or -Wl,) which are
   treated as linker inputs instead of options are not being
   forwarded yet.

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

16 years agoccc: Add several convenience methods for argument translation.
Daniel Dunbar [Sun, 11 Jan 2009 22:42:24 +0000 (22:42 +0000)]
ccc: Add several convenience methods for argument translation.

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

16 years agoccc: Add and name a host of arguments.
Daniel Dunbar [Sun, 11 Jan 2009 22:12:37 +0000 (22:12 +0000)]
ccc: Add and name a host of arguments.
 - Also, fix bug in MultipleValuesOption which was accepting joined
   arguments.

 - Add ArgList::getArgs, provides iterator over all arg instances for a
   given option.

 - Option definition is very much in need of cleaning...

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

16 years agoccc: Give the Host an opportunity to switch ToolChains when binding
Daniel Dunbar [Sun, 11 Jan 2009 22:06:22 +0000 (22:06 +0000)]
ccc: Give the Host an opportunity to switch ToolChains when binding
archs (as a driver driver).

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

16 years agoccc: Print -### output on stderr to match gcc.
Daniel Dunbar [Sun, 11 Jan 2009 22:03:55 +0000 (22:03 +0000)]
ccc: Print -### output on stderr to match gcc.

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

16 years agoMore inline asm fixes
Anders Carlsson [Sun, 11 Jan 2009 21:23:27 +0000 (21:23 +0000)]
More inline asm fixes

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

16 years agomake paste avoidance avoid pasting digraphs and :: only when digraphs or c++ is enabled
Chris Lattner [Sun, 11 Jan 2009 19:48:19 +0000 (19:48 +0000)]
make paste avoidance avoid pasting digraphs and :: only when digraphs or c++ is enabled
respectively.  Inspired by a patch by Dan Villiom Podlaski Christiansen.

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

16 years agoHandle readwrite constraints correctly
Anders Carlsson [Sun, 11 Jan 2009 19:46:50 +0000 (19:46 +0000)]
Handle readwrite constraints correctly

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

16 years agoForgot to commit this
Anders Carlsson [Sun, 11 Jan 2009 19:40:10 +0000 (19:40 +0000)]
Forgot to commit this

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

16 years agoUse a common function for emitting asm inputs and remove a FIXME
Anders Carlsson [Sun, 11 Jan 2009 19:32:54 +0000 (19:32 +0000)]
Use a common function for emitting asm inputs and remove a FIXME

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

16 years agothis patch "adds support for specifying multiple dependancy targets using ‘-MT’....
Chris Lattner [Sun, 11 Jan 2009 19:28:34 +0000 (19:28 +0000)]
this patch "adds support for specifying multiple dependancy targets using â€˜-MT’. Using this patch, I was able to use â€˜ccc’ as C compiler for the few C files in LLVM. In my brief testing, the output remains identical to that of GCC."

Patch by Dan Villiom Podlaski Christiansen!

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

16 years agoFix operator precedence.
Sebastian Redl [Sun, 11 Jan 2009 13:39:06 +0000 (13:39 +0000)]
Fix operator precedence.

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

16 years agoConvert property implementation to DeclContext::addDecl().
Steve Naroff [Sun, 11 Jan 2009 12:47:58 +0000 (12:47 +0000)]
Convert property implementation to DeclContext::addDecl().
This completes the ObjCContainerDecl AST cleanup (for now).

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

16 years agoA few property related cleanups to ObjCContainerDecl AST.
Steve Naroff [Sun, 11 Jan 2009 01:06:09 +0000 (01:06 +0000)]
A few property related cleanups to ObjCContainerDecl AST.

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

16 years agoConvert some more actions to smart pointers.
Sebastian Redl [Sun, 11 Jan 2009 00:38:46 +0000 (00:38 +0000)]
Convert some more actions to smart pointers.
No performance regression in my basic test.
Also fixed a type error in ActOnFinishSwitchStmt's arguments (body is a stmt).

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

16 years agoFix a misleading comment.
Steve Naroff [Sat, 10 Jan 2009 22:55:25 +0000 (22:55 +0000)]
Fix a misleading comment.

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

16 years agoThis patch fixes the code gen failures which was a fallout from
Fariborz Jahanian [Sat, 10 Jan 2009 21:06:09 +0000 (21:06 +0000)]
This patch fixes the code gen failures which was a fallout from
not merging protocol properties into the classes which
use those protocols. With this patch, all my exceutable
test pass again.

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

16 years agoExplicit declaration of property setters over-ride
Fariborz Jahanian [Sat, 10 Jan 2009 18:43:55 +0000 (18:43 +0000)]
Explicit declaration of property setters over-ride
prohibition of 'readonly' properties in an assignment.

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

16 years agoadd a bunch of castToDeclContext/castFromDeclContext methods.
Zhongxing Xu [Sat, 10 Jan 2009 14:38:38 +0000 (14:38 +0000)]
add a bunch of castToDeclContext/castFromDeclContext methods.

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

16 years agoadd castToDeclContext/castFromDeclContext methods to RecordDecl.
Zhongxing Xu [Sat, 10 Jan 2009 14:14:16 +0000 (14:14 +0000)]
add castToDeclContext/castFromDeclContext methods to RecordDecl.

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

16 years agoccc: Introduce ToolChains for mapping Actions to Tools which can
Daniel Dunbar [Sat, 10 Jan 2009 02:07:54 +0000 (02:07 +0000)]
ccc: Introduce ToolChains for mapping Actions to Tools which can
perform them.

 - A ToolChain is a coherent set of tools use in a compilation
   process. The idea is that a ToolChain holds roughly the information
   (specs, search paths, etc.) that is in a single gcc binary.

 - The default ToolChain is selected by the host and will generally
   correspond to what the default system compiler would do. However,
   this can be over-riden for a variety of purposes, for example the
   by the driver driver or for testing.

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

16 years agoccc: Add generic assembler & linker tools which effectively shell out
Daniel Dunbar [Sat, 10 Jan 2009 02:00:04 +0000 (02:00 +0000)]
ccc: Add generic assembler & linker tools which effectively shell out
to gcc.

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

16 years agoccc: Add information about whether type can be user specified (a -x
Daniel Dunbar [Sat, 10 Jan 2009 01:50:42 +0000 (01:50 +0000)]
ccc: Add information about whether type can be user specified (a -x
argument) to InputType.

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

16 years agoAllow multiple Microsoft calling-convention keywords. Fixes rdar://problem/6486133
Douglas Gregor [Sat, 10 Jan 2009 00:48:18 +0000 (00:48 +0000)]
Allow multiple Microsoft calling-convention keywords. Fixes rdar://problem/6486133

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

16 years agoassert if attempting to code gen. a property setter/getter
Fariborz Jahanian [Sat, 10 Jan 2009 00:13:01 +0000 (00:13 +0000)]
assert if attempting to code gen. a property setter/getter
coming from a protocol.

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

16 years agoDon't bother setting NextDeclarator for EnumConstantDecls. It isn't used
Douglas Gregor [Fri, 9 Jan 2009 23:23:35 +0000 (23:23 +0000)]
Don't bother setting NextDeclarator for EnumConstantDecls. It isn't used

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

16 years agoWhen we see a reference to a struct, class, or union like "struct X"
Douglas Gregor [Fri, 9 Jan 2009 22:42:13 +0000 (22:42 +0000)]
When we see a reference to a struct, class, or union like "struct X"
that is neither a definition nor a forward declaration and where X has
not yet been declared as a tag, introduce a declaration
into the appropriate scope (which is likely *not* to be the current
scope). The rules for the placement of the declaration differ slightly
in C and C++, so we implement both and test the various corner
cases. This implementation isn't 100% correct due to some lingering
issues with the function prototype scope (for a function parameter
list) not being the same scope as the scope of the function
definition. Testcase is FIXME'd; this probably isn't an important issue.

Addresses <rdar://problem/6484805>.

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

16 years agoAdd utils/SummarizeErrors.
Daniel Dunbar [Fri, 9 Jan 2009 22:39:43 +0000 (22:39 +0000)]
Add utils/SummarizeErrors.
 - Little script for scanning a compile log and summarizing warnings,
   errors, assertions, and crashes.
 - Is very slow, and stack trace regexs probably only work on Darwin.

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

16 years agoAdd some comments to the virtual work. Thanks to Doug Gregor for the review.
Sebastian Redl [Fri, 9 Jan 2009 22:29:03 +0000 (22:29 +0000)]
Add some comments to the virtual work. Thanks to Doug Gregor for the review.

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

16 years agoccc: Get host information via Driver methods.
Daniel Dunbar [Fri, 9 Jan 2009 22:21:24 +0000 (22:21 +0000)]
ccc: Get host information via Driver methods.

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

16 years agoDead stores checker: Don't flag dead stores for self-assignments (common escape hatch...
Ted Kremenek [Fri, 9 Jan 2009 22:15:01 +0000 (22:15 +0000)]
Dead stores checker: Don't flag dead stores for self-assignments (common escape hatch for 'unused variable' warnings).

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

16 years agoEnhance PTH 'getSpelling' caching:
Ted Kremenek [Fri, 9 Jan 2009 22:05:30 +0000 (22:05 +0000)]
Enhance PTH 'getSpelling' caching:
- Refactor caching logic into a helper class PTHSpellingSearch
- Allow "random accesses" in the spelling cache, thus catching the remaining
  cases where 'getSpelling' wasn't hitting the PTH cache

For -Eonly, PTH, Cocoa.h:
- This reduces wall time by 3% (user time unchanged, sys time reduced)
- This reduces the amount of paged source by 1112K.
  The remaining 1112K still being paged in is from somewhere else
  (investigating).

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

16 years agoPrevent a segfault for vaarg expressions on unsupported architectures.
Sebastian Redl [Fri, 9 Jan 2009 21:09:38 +0000 (21:09 +0000)]
Prevent a segfault for vaarg expressions on unsupported architectures.

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

16 years agoThis patch removes mergeProperties and does the property lookup
Fariborz Jahanian [Fri, 9 Jan 2009 21:04:52 +0000 (21:04 +0000)]
This patch removes mergeProperties and does the property lookup
in designated protocols lazily.

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

16 years agoImplement EmitUnsupportedRValue to generate an appropriately typed RValue.
Daniel Dunbar [Fri, 9 Jan 2009 20:09:28 +0000 (20:09 +0000)]
Implement EmitUnsupportedRValue to generate an appropriately typed RValue.

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

16 years agoVery basic support for pure virtual functions.
Sebastian Redl [Fri, 9 Jan 2009 19:57:06 +0000 (19:57 +0000)]
Very basic support for pure virtual functions.

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

16 years agoReplace DeclContext's vector of ScopedDecl pointers with a linked list
Douglas Gregor [Fri, 9 Jan 2009 19:42:16 +0000 (19:42 +0000)]
Replace DeclContext's vector of ScopedDecl pointers with a linked list
of ScopedDecls (using the new ScopedDecl::NextDeclInScope
pointer). Performance-wise:

  - It's a net win in memory utilization, since DeclContext is now one
    pointer smaller than it used to be (std::vectors are typically 3
    pointers; we now use 2 pointers) and
  - Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang)
    is about 1.9% faster than before, most likely because we no longer
    have the memory allocations and copying associated with the
    std::vector.

I'll re-enable serialization of DeclContexts once I've sorted out the
NextDeclarator/NextDeclInScope question.

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

16 years agoMake sure that ScopedDecls passed to DeclContext::addDecl are added into their lexica...
Douglas Gregor [Fri, 9 Jan 2009 18:51:29 +0000 (18:51 +0000)]
Make sure that ScopedDecls passed to DeclContext::addDecl are added into their lexical context

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

16 years agoAlways print out SourceManager stats with 'Stats' is true. This revealed that PTH...
Ted Kremenek [Fri, 9 Jan 2009 18:20:21 +0000 (18:20 +0000)]
Always print out SourceManager stats with 'Stats' is true.  This revealed that PTH always pulls in the source pages with -fsyntax-only (investigating further).

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

16 years agoProvide a new kind of iterator, the specific_decl_iterator, that
Douglas Gregor [Fri, 9 Jan 2009 17:18:27 +0000 (17:18 +0000)]
Provide a new kind of iterator, the specific_decl_iterator, that
filters the decls seen by decl_iterator with two criteria: the dynamic
type of the declaration and a run-time predicate described by a member
function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl
considerably. It has no measurable performance impact.

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

16 years agoEmit more refined "unsupported" error for block expressions.
Daniel Dunbar [Fri, 9 Jan 2009 17:04:29 +0000 (17:04 +0000)]
Emit more refined "unsupported" error for block expressions.

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

16 years agoGive "unsupported" error on calls through block pointers instead of
Daniel Dunbar [Fri, 9 Jan 2009 16:50:52 +0000 (16:50 +0000)]
Give "unsupported" error on calls through block pointers instead of
crashes.

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

16 years agoMove property API's up to ObjCContainerDecl (removing a lot of duplicate code).
Steve Naroff [Fri, 9 Jan 2009 15:36:25 +0000 (15:36 +0000)]
Move property API's up to ObjCContainerDecl (removing a lot of duplicate code).
Add isa/cast/dyncast support for ObjCContainerDecl.
Renamed classprop_iterator/begin/end to prop_iterator/begin/end (the class prefix was confusing).
More simplifications to Sema::ActOnAtEnd()...
Added/changed some FIXME's as a result of the above work.

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

16 years agoFix rdar://6480479 - [parser] infinite loop on invalid input
Chris Lattner [Fri, 9 Jan 2009 04:34:13 +0000 (04:34 +0000)]
Fix rdar://6480479 - [parser] infinite loop on invalid input

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

16 years agoConvert block types in IRgen. This is not the correct type, but
Daniel Dunbar [Fri, 9 Jan 2009 02:48:46 +0000 (02:48 +0000)]
Convert block types in IRgen. This is not the correct type, but
matches llvm-gcc (?).

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

16 years agoBlock pointer types are not aggregate types.
Daniel Dunbar [Fri, 9 Jan 2009 02:44:18 +0000 (02:44 +0000)]
Block pointer types are not aggregate types.

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

16 years agoDon't crash when our FunctionDecl has a non-identifier name
Douglas Gregor [Fri, 9 Jan 2009 01:47:02 +0000 (01:47 +0000)]
Don't crash when our FunctionDecl has a non-identifier name

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

16 years agoFix crash on null deference when searching for readwrite properties in
Daniel Dunbar [Fri, 9 Jan 2009 01:04:21 +0000 (01:04 +0000)]
Fix crash on null deference when searching for readwrite properties in
categories.
 - Also, simplify nesting via early return.

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

16 years agoccc: Start defining host information.
Daniel Dunbar [Fri, 9 Jan 2009 01:00:40 +0000 (01:00 +0000)]
ccc: Start defining host information.
 - For use by the driver in places where the host alters driver
   behavior (for example, running as a driver driver on darwin).

 - Allow user override for testing purposes.

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

16 years agoAddressed the issue in <rdar://problem/6479085>, where we failed to
Douglas Gregor [Fri, 9 Jan 2009 00:49:46 +0000 (00:49 +0000)]
Addressed the issue in <rdar://problem/6479085>, where we failed to
rewrite @class declarations that showed up within linkage
specifications because those @class declarations never made it any
place where the rewriter could find them.

Moved all of the ObjC*Decl nodes over to ScopedDecls, so that they can
live in the appropriate top-level or transparent DeclContext near the
top level, e.g., TranslationUnitDecl or LinkageSpecDecl. Objective-C
declarations now show up in a traversal of the declarations in a
DeclContext (they didn't before!). This way, the rewriter finds all
Objective-C declarations within linkage specifications.

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

16 years agoRe-enable PTH testing for Cocoa.h and Carbon.h (and include testing for Objective...
Ted Kremenek [Fri, 9 Jan 2009 00:41:48 +0000 (00:41 +0000)]
Re-enable PTH testing for Cocoa.h and Carbon.h (and include testing for Objective-C++).

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

16 years agoAdding support for ObjC methods which have c-style
Fariborz Jahanian [Fri, 9 Jan 2009 00:38:19 +0000 (00:38 +0000)]
Adding support for ObjC methods which have c-style
parameter list. This is work in progress.

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

16 years agoEnable support for '-x objective-c++-header'.
Ted Kremenek [Fri, 9 Jan 2009 00:38:08 +0000 (00:38 +0000)]
Enable support for '-x objective-c++-header'.

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

16 years agoSimpler solution to LiteralSupport compatibility: just add one whitespace character...
Ted Kremenek [Fri, 9 Jan 2009 00:37:37 +0000 (00:37 +0000)]
Simpler solution to LiteralSupport compatibility: just add one whitespace character after each cached string.

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

16 years agoInvert assertion condition.
Ted Kremenek [Fri, 9 Jan 2009 00:36:11 +0000 (00:36 +0000)]
Invert assertion condition.

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

16 years agoTemporarily revert r61956 and r61957 (PTH tests failing).
Ted Kremenek [Fri, 9 Jan 2009 00:27:29 +0000 (00:27 +0000)]
Temporarily revert r61956 and r61957 (PTH tests failing).

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

16 years agoEnhance -fsyntax-only test of Carbon.h to also include testing for PTH.
Ted Kremenek [Thu, 8 Jan 2009 23:42:56 +0000 (23:42 +0000)]
Enhance -fsyntax-only test of Carbon.h to also include testing for PTH.

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

16 years agoEnhance -fsyntax-only test of Cocoa.h to also include testing for PTH.
Ted Kremenek [Thu, 8 Jan 2009 23:41:35 +0000 (23:41 +0000)]
Enhance -fsyntax-only test of Cocoa.h to also include testing for PTH.

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

16 years agoPTH: For the cached spellings of literals, store one whitespace character after the...
Ted Kremenek [Thu, 8 Jan 2009 23:40:50 +0000 (23:40 +0000)]
PTH: For the cached spellings of literals, store one whitespace character after the spelling to accomodate sanity checking in LiteralSuppoert.cpp.

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

16 years agoAdd mm_malloc.h, patch by Sam Weinig.
Anders Carlsson [Thu, 8 Jan 2009 23:30:09 +0000 (23:30 +0000)]
Add mm_malloc.h, patch by Sam Weinig.

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

16 years agoPlace warning about 'readonly' property attributes which
Fariborz Jahanian [Thu, 8 Jan 2009 23:23:10 +0000 (23:23 +0000)]
Place warning about 'readonly' property attributes which
are related to setter syntax under -Wreadonly-setter-attrs
to prevent warnings in projects built with gcc.

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

16 years agoRevert my previous, failed attempt to pretty-print anonymous struct/union accesses...
Douglas Gregor [Thu, 8 Jan 2009 22:45:41 +0000 (22:45 +0000)]
Revert my previous, failed attempt to pretty-print anonymous struct/union accesses well. Added a FIXME so we know to revisit this later

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

16 years agoFix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to iterate and destroy...
Ted Kremenek [Thu, 8 Jan 2009 20:49:27 +0000 (20:49 +0000)]
Fix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to iterate and destroy all contained ObjCMethodDecls in one sweep.  This fixes a use-after-free error found by valgrind.

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

16 years agoRemove double-insertion of EnumConstantDecls. Thanks to Zhongxing Xu for pointing...
Douglas Gregor [Thu, 8 Jan 2009 20:48:26 +0000 (20:48 +0000)]
Remove double-insertion of EnumConstantDecls. Thanks to Zhongxing Xu for pointing this out

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

16 years agoAdded iterator mechanism to ObjCContainerDecl to iterate over both class and instance...
Ted Kremenek [Thu, 8 Jan 2009 20:48:19 +0000 (20:48 +0000)]
Added iterator mechanism to ObjCContainerDecl to iterate over both class and instance methods at the same time.

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