Commit Graph

52389 Commits

Author SHA1 Message Date
Daniel Dunbar fab583b7c6 ccc: Darwin/CC1: Hardcode (for now) some -m options to match gcc.
llvm-svn: 62146
2009-01-13 04:51:51 +00:00
Daniel Dunbar 8af0d3447e ccc: Allow host to over-ride default arch based on command line
arguments (e.g., -m32 and -m64).

llvm-svn: 62145
2009-01-13 04:05:40 +00:00
Evan Cheng f343168f1f FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is copied to a physical register, it's not necessarily defined by a copy. We have to watch out it doesn't clobber any sub-register that might be live during its live interval. If the live interval crosses a basic block, then it's not safe to check with the less conservative check (by scanning uses and defs) because it's possible a sub-register might be live out of the block.
llvm-svn: 62144
2009-01-13 03:57:45 +00:00
Zhongxing Xu d90c6d92e9 Improve c++ methods printing in DeclContextPrinter.
llvm-svn: 62143
2009-01-13 03:26:38 +00:00
Zhongxing Xu 2436f86024 add a fixme.
llvm-svn: 62142
2009-01-13 03:07:41 +00:00
Zhongxing Xu 100f30bd0d Improve DeclContextPrinter: print enum name.
llvm-svn: 62140
2009-01-13 02:41:08 +00:00
Daniel Dunbar dec798bf37 Bug fix, __private_extern__ globals were always introducing a definition.
llvm-svn: 62139
2009-01-13 02:25:00 +00:00
Zhongxing Xu cff637a568 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.  

llvm-svn: 62138
2009-01-13 01:49:57 +00:00
Ted Kremenek f9d3f0711a Updated checker build.
llvm-svn: 62137
2009-01-13 01:41:37 +00:00
Zhongxing Xu 9aabf025e5 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.

llvm-svn: 62136
2009-01-13 01:29:24 +00:00
Fariborz Jahanian 5c76772f49 Patch to fix encoding of Enum bitfields in ObjC.
llvm-svn: 62135
2009-01-13 01:18:13 +00:00
Ted Kremenek 75c4d57b9c This test now passes.
llvm-svn: 62132
2009-01-13 01:06:56 +00:00
Daniel Dunbar 260c84657f ccc: Darwin/CC1: Be bug compatible with gcc in a corner case.
llvm-svn: 62131
2009-01-13 01:04:40 +00:00
Ted Kremenek eb68db238f static analyzer: Handle casts from arrays to integers. This fixes PR 3297.
llvm-svn: 62130
2009-01-13 01:04:21 +00:00
Ted Kremenek 167f2fa5f4 Invert condition on branch (was causing RegionStore::ArrayToPointer to return 'unknown' on most cases.
llvm-svn: 62129
2009-01-13 01:03:27 +00:00
Douglas Gregor c5e61070f6 Add the proper restrictions on the left-hand argument of a built-in
assignment operator candidate (C++ [over.match.oper]p4).

llvm-svn: 62128
2009-01-13 00:52:54 +00:00
Devang Patel 5c6e1e3b7d Use DebugInfo interface to lower dbg_* intrinsics.
llvm-svn: 62127
2009-01-13 00:35:13 +00:00
Devang Patel 76007e009e Use DebugInfo interface to lower dbg_* intrinsics.
llvm-svn: 62126
2009-01-13 00:32:17 +00:00
Devang Patel f3456e8f07 Start using DebugInfo API to emit debug info.
llvm-svn: 62125
2009-01-13 00:20:51 +00:00
Douglas Gregor f399ef43c7 Make sure we don't name a constructor or destructor with a qualified
type. It leads to very weird errors.

llvm-svn: 62124
2009-01-13 00:11:19 +00:00
Fariborz Jahanian 30e7864661 Patch to implement code gen for aggrgate-valued property used
to access a field of its type.

llvm-svn: 62123
2009-01-12 23:27:26 +00:00
Douglas Gregor b3730b50c7 Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak
llvm-svn: 62122
2009-01-12 23:27:07 +00:00
Douglas Gregor ae5e28578c Update C++ status and add a few more tests of overloading for member function calls
llvm-svn: 62121
2009-01-12 23:20:38 +00:00
Dan Gohman 3065b6169f Document several current CodeGen limitations in LangRef.html.
Patches for any of these are welcome!

llvm-svn: 62120
2009-01-12 23:12:39 +00:00
Ted Kremenek 94a5f6f949 Fix test case (incomplete "expected-warning" line)
llvm-svn: 62119
2009-01-12 23:09:55 +00:00
Devang Patel 243b4add9a Emit debug info, only if at least one compile unit is seen.
llvm-svn: 62118
2009-01-12 23:09:42 +00:00
Ted Kremenek 6dfeb55897 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

llvm-svn: 62117
2009-01-12 23:09:09 +00:00
Devang Patel b71fbeb19f If multiple compile units are seen then emit them independently. In other words, do not force all DIEs into first, whatever it is, compile unit.
Note, multiple compile unit support is not well tested (it did not work correctly until now anyway.)

llvm-svn: 62116
2009-01-12 23:05:55 +00:00
Devang Patel 4aa4128ced Avoid cast<>, use light weith wrapper directly.
llvm-svn: 62115
2009-01-12 22:58:14 +00:00
Devang Patel 4223582f00 Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon.
llvm-svn: 62114
2009-01-12 22:54:42 +00:00
Ted Kremenek 6ae6513ce2 Fix crasher due to use-after-release: DeclContext now owns all ObjCMethodDecls, and shouldn't be released elsewhere.
llvm-svn: 62113
2009-01-12 22:49:54 +00:00
Douglas Gregor c6f58fe266 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.

llvm-svn: 62112
2009-01-12 22:49:06 +00:00
Daniel Dunbar dd0efa8aad ccc: Bug fix, output can be NULL.
llvm-svn: 62108
2009-01-12 22:19:59 +00:00
Dale Johannesen 433a9086c0 Enable recursive inlining. Reduce inlining threshold
back to 200; 400 seems to be too high, loses more than
it gains.

llvm-svn: 62107
2009-01-12 22:11:50 +00:00
Ted Kremenek 7e90422e95 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.

llvm-svn: 62106
2009-01-12 21:45:02 +00:00
Daniel Dunbar f538cfa254 ccc: Even more Darwin/cc1 argument translation support.
llvm-svn: 62105
2009-01-12 21:44:10 +00:00
Devang Patel 45d2cfd064 Add classof() methods to support isa<> and other related facilities.
llvm-svn: 62104
2009-01-12 21:38:43 +00:00
Dan Gohman 33a9cef204 The LLVM Assembly Language Reference incorrectly stated that the
prefix used for dll{import,export} is _imp__; it is actually __imp_.
Patch by Mahadevan R!

llvm-svn: 62103
2009-01-12 21:35:55 +00:00
Dan Gohman 87bc800384 Fix the instructions to work even when PATH does not contain ".".
Thanks to Martin Geisse for pointing this out!

llvm-svn: 62102
2009-01-12 21:29:24 +00:00
Daniel Dunbar 62db95e891 (LLVM up) Match TargetData API change in LLVM TOT.
llvm-svn: 62101
2009-01-12 21:08:18 +00:00
Duncan Sands dc020f9c3c Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Fariborz Jahanian 8e1555c7c3 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).

llvm-svn: 62098
2009-01-12 19:55:42 +00:00
Daniel Dunbar df5598444a ccc: Add leading space in -### output to match gcc.
llvm-svn: 62097
2009-01-12 19:36:35 +00:00
Devang Patel df31a7256d Add DwarfWriter interface to mainipulate source location info.
( May be this info should be directly handled by the dwarf writer ? )

llvm-svn: 62096
2009-01-12 19:17:34 +00:00
Chris Lattner ecbe933d6a remove some dead options.
llvm-svn: 62095
2009-01-12 19:02:50 +00:00
Daniel Dunbar b1a40a6a58 ccc: (Darwin) More argument translation for Darwin/Compile tool.
llvm-svn: 62093
2009-01-12 18:51:02 +00:00
Devang Patel f033d53264 Clear debug info at the end of function processing.
llvm-svn: 62092
2009-01-12 18:48:36 +00:00
Douglas Gregor 45a33ecce1 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.

llvm-svn: 62091
2009-01-12 18:45:55 +00:00
Devang Patel 5daa1abf25 There is no need to maintain separate labelid list in the dwarf writer. It is not a good idea.
llvm-svn: 62090
2009-01-12 18:41:00 +00:00
Daniel Dunbar d0b0eca12a ccc: (Darwin) More argument translation for Darwin/Compile tool.
llvm-svn: 62089
2009-01-12 17:53:19 +00:00