]> granicus.if.org Git - clang/log
clang
16 years agouse a slightly more sensible position for an array ref's "getExprLoc"
Chris Lattner [Tue, 13 Jan 2009 21:11:15 +0000 (21:11 +0000)]
use a slightly more sensible position for an array ref's "getExprLoc"

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

16 years agoccc: Darwin: Implement some important general argument translations
Daniel Dunbar [Tue, 13 Jan 2009 21:07:43 +0000 (21:07 +0000)]
ccc: Darwin: Implement some important general argument translations
for the Darwin tool chain.
 - Ideally we would localize these to tool specific argument
   processing but for now this matches gcc closely.

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

16 years agoTurn off some Destroy calls that are currenly causing double-destruction of ScopedDec...
Douglas Gregor [Tue, 13 Jan 2009 19:47:12 +0000 (19:47 +0000)]
Turn off some Destroy calls that are currenly causing double-destruction of ScopedDecls. We will re-enable this later, when we have time to fully solve the ownership issue.

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

16 years agoccc: Allow internal tool chain specific argument translation.
Daniel Dunbar [Tue, 13 Jan 2009 18:51:26 +0000 (18:51 +0000)]
ccc: Allow internal tool chain specific argument translation.
 - Pulled -Xarch processing into this.

 - Get rid of manual creation of forwarding arg array.

 - Use Darwin/CC1 instead of generic GCC cc1 on X86.

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

16 years agoUse the unqualified type for GCCs struct/union cast extension
Anders Carlsson [Tue, 13 Jan 2009 17:00:51 +0000 (17:00 +0000)]
Use the unqualified type for GCCs struct/union cast extension

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

16 years agoDeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (cause...
Argyrios Kyrtzidis [Tue, 13 Jan 2009 13:11:58 +0000 (13:11 +0000)]
DeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (causes compilation error on MSVC).
Add DeclContext::getDeclKind() and use that instead of DeclContext::KindTrait.

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

16 years agoccc: Bug fix, '-f...' should be part of the '-f' group.
Daniel Dunbar [Tue, 13 Jan 2009 07:39:45 +0000 (07:39 +0000)]
ccc: Bug fix, '-f...' should be part of the '-f' group.

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

16 years agoAdd simple tool for comparing drivers (hardcoded to gcc and xcc) which
Daniel Dunbar [Tue, 13 Jan 2009 07:38:29 +0000 (07:38 +0000)]
Add simple tool for comparing drivers (hardcoded to gcc and xcc) which
support -###.

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

16 years agoccc: Darwin/Link also runs dsymutil in one very particular situation.
Daniel Dunbar [Tue, 13 Jan 2009 06:44:28 +0000 (06:44 +0000)]
ccc: Darwin/Link also runs dsymutil in one very particular situation.

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

16 years agoPrint function parameters in DeclContextPrinter.
Zhongxing Xu [Tue, 13 Jan 2009 06:25:33 +0000 (06:25 +0000)]
Print function parameters in DeclContextPrinter.

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

16 years agoccc: Bug fix and gcc compatibility tweak.
Daniel Dunbar [Tue, 13 Jan 2009 06:25:31 +0000 (06:25 +0000)]
ccc: Bug fix and gcc compatibility tweak.

 - --gstabs only goes to Darwin/Assembler when dealing with an
     assembly file from the command line.

 - Relative placement of -o option for cc1 moves depending on
   -fsyntax-only/-S, how quaint.

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

16 years agoccc: Add option groups.
Daniel Dunbar [Tue, 13 Jan 2009 05:54:38 +0000 (05:54 +0000)]
ccc: Add option groups.
 - Simple mechanism for group together sets of options so the driver
   can efficiently deal with them as a group (i.e., for forwarding -i*
   to cc1).

 - Use to finish off the major missing pieces of Darwin/CC1 support.

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

16 years agoWarn when someone tries to pass a variable with a non-POD type to a varargs function...
Anders Carlsson [Tue, 13 Jan 2009 05:48:52 +0000 (05:48 +0000)]
Warn when someone tries to pass a variable with a non-POD type to a varargs function/method/block.

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

16 years agoFix argument-passing bugs in a call to object
Douglas Gregor [Tue, 13 Jan 2009 05:10:00 +0000 (05:10 +0000)]
Fix argument-passing bugs in a call to object

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

16 years agoccc: Darwin/CC1: Hardcode (for now) some -m options to match gcc.
Daniel Dunbar [Tue, 13 Jan 2009 04:51:51 +0000 (04:51 +0000)]
ccc: Darwin/CC1: Hardcode (for now) some -m options to match gcc.

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

16 years agoccc: Allow host to over-ride default arch based on command line
Daniel Dunbar [Tue, 13 Jan 2009 04:05:40 +0000 (04:05 +0000)]
ccc: Allow host to over-ride default arch based on command line
arguments (e.g., -m32 and -m64).

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

16 years agoImprove c++ methods printing in DeclContextPrinter.
Zhongxing Xu [Tue, 13 Jan 2009 03:26:38 +0000 (03:26 +0000)]
Improve c++ methods printing in DeclContextPrinter.

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

16 years agoadd a fixme.
Zhongxing Xu [Tue, 13 Jan 2009 03:07:41 +0000 (03:07 +0000)]
add a fixme.

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

16 years agoImprove DeclContextPrinter: print enum name.
Zhongxing Xu [Tue, 13 Jan 2009 02:41:08 +0000 (02:41 +0000)]
Improve DeclContextPrinter: print enum name.

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

16 years agoBug fix, __private_extern__ globals were always introducing a definition.
Daniel Dunbar [Tue, 13 Jan 2009 02:25:00 +0000 (02:25 +0000)]
Bug fix, __private_extern__ globals were always introducing a definition.

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

16 years agoAdd KillStruct to region store.
Zhongxing Xu [Tue, 13 Jan 2009 01:49:57 +0000 (01:49 +0000)]
Add KillStruct to region store.
 - put the killed region in the kill set.
 - set its default value to unknown.
 - removes all bindings for its subregions.

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

16 years agoUpdated checker build.
Ted Kremenek [Tue, 13 Jan 2009 01:41:37 +0000 (01:41 +0000)]
Updated checker build.

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

16 years agoAdd an initial framework of a DeclContextPrinter. It can print DeclContext and
Zhongxing Xu [Tue, 13 Jan 2009 01:29:24 +0000 (01:29 +0000)]
Add an initial framework of a DeclContextPrinter. It can print DeclContext and
its Decls in indented format. An Example:

$ cat t.cpp
class A {
  int a;
  void f();
};
void A::f() {
  a = 3;
}

$ clang -print-decl-contexts t.cpp
[translation unit] 0x9754d7c
    <typedef> __builtin_va_list
    [class] A 0x9753310
        <class> A 0x975ce20
        <field> a
        <c++ method> f
        <c++ ctor> A
        <c++ ctor> A
        <c++ method> operator=
        <c++ dtor> ~A
    [c++ method] f [[0x9753310]]

Some comments: '<>' indicates a declaration, '[]' indicates a definition, '[[
]]' displays the semantic DeclContext which is different from the lexical
DeclContext.  The symbols printed can definitely be changed in the future.

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

16 years agoPatch to fix encoding of Enum bitfields in ObjC.
Fariborz Jahanian [Tue, 13 Jan 2009 01:18:13 +0000 (01:18 +0000)]
Patch to fix encoding of Enum bitfields in ObjC.

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

16 years agoThis test now passes.
Ted Kremenek [Tue, 13 Jan 2009 01:06:56 +0000 (01:06 +0000)]
This test now passes.

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

16 years agoccc: Darwin/CC1: Be bug compatible with gcc in a corner case.
Daniel Dunbar [Tue, 13 Jan 2009 01:04:40 +0000 (01:04 +0000)]
ccc: Darwin/CC1: Be bug compatible with gcc in a corner case.

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

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