Commit Graph

57228 Commits

Author SHA1 Message Date
Daniel Dunbar d640be24fd (LLVM up) Update to use llvm::sys::getHostTriple().
- Always pass -triple to clang-cc (-arch will be removed).

 - clang-cc doesn't play guess work with the target triple anymore.

llvm-svn: 68119
2009-03-31 17:35:15 +00:00
Daniel Dunbar fb1a6eb69b Add llvm::sys::getHostTriple and remove
llvm::sys::getOS{Name,Version}.

Right now the implementation just derives from LLVM_HOSTTRIPLE (which
is wrong, but it doesn't look like we have a define for the target
triple). Ideally this routine would actually be able to compute the
triple for targets we care about.

llvm-svn: 68118
2009-03-31 17:30:15 +00:00
Steve Naroff 1bf3b718cd Add -Wdeprecated-declarations to driver and add a test case.
llvm-svn: 68117
2009-03-31 17:28:26 +00:00
Anders Carlsson 452e1c8a6a We fully support namespace aliases now.
llvm-svn: 68116
2009-03-31 17:17:14 +00:00
Fariborz Jahanian 3254a6f94c More toward nonfragile abi's synthesized ivars.
llvm-svn: 68115
2009-03-31 17:00:52 +00:00
Steve Naroff 66afeb5968 Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.
Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).

llvm-svn: 68114
2009-03-31 16:53:37 +00:00
Dan Gohman d51f196ff5 Minor top-level comment fix.
llvm-svn: 68113
2009-03-31 16:51:18 +00:00
Dan Gohman 90ea62cba6 Tidy up some comments.
llvm-svn: 68112
2009-03-31 16:48:35 +00:00
Dan Gohman 0837aa99ea Add a comment.
llvm-svn: 68111
2009-03-31 16:46:45 +00:00
Douglas Gregor f1b876d5de Implement -Wmissing-prototypes. Fixes PR3911.
llvm-svn: 68110
2009-03-31 16:35:03 +00:00
Rafael Espindola 9277379fc0 remove unused arguments.
llvm-svn: 68109
2009-03-31 16:16:57 +00:00
Steve Naroff ea9a107ada Add support for -Wdeprecated-declarations.
This fixes <rdar://problem/6712496> Unable to disable deprecated warning.

llvm-svn: 68108
2009-03-31 15:00:11 +00:00
Steve Naroff f2a880ca22 Incorporate feedback from Eli.
llvm-svn: 68107
2009-03-31 10:29:45 +00:00
Chris Lattner 8b14b98bab Fix a problem in ASTContext::addRecordToClass handling forward declarations.
In a case like:

@class foo;
foo *P;

addRecordToClass was making an empty shadow struct for the foo interface and
completing it.  Later when an:

@interface foo
...
@endif

foo *Q;

was seen, ASTContext::addRecordToClass would think that foo was already laid
out and not lay out the definition.  This fixes it to create a forward declared
struct the first time around, then complete it when the definition is seen.

Note that this causes two tests to regress, because something is trying to get
the size of the forward declared structs returned by this.  Previously, this
would end up getting a size of zero but now it properly dies.  I'm not sure
what the right solution is for this, so I xfailed the tests.

Fariborz, please take a look at this.  The testcase in rdar://6676794 now gets
farther, but dies later because the objc ivar is not assigned a field number.

As an aside, I really don't like the fact that the objc front-end is creating
shadow C structs for ObjC types.  This seems like an implementation detail of
the code generator that could be fixed by better factoring of the extant code.

llvm-svn: 68106
2009-03-31 09:24:30 +00:00
Chris Lattner 05aa49128c remove a dead prototype
llvm-svn: 68105
2009-03-31 09:07:15 +00:00
Chris Lattner 733dc19be6 remove the warning. We don't control what users do, and this code
is run for perfectly reasonable things like NSString* because type
layout is recursive.

llvm-svn: 68104
2009-03-31 09:04:50 +00:00
Chris Lattner 6d35cc945f disable copying of Type objects.
llvm-svn: 68103
2009-03-31 08:58:42 +00:00
Chris Lattner 3e2f36e905 do not *copy* objc interface types, just use their reference.
llvm-svn: 68102
2009-03-31 08:55:07 +00:00
Chris Lattner 5b36ddb1ad fill in temporary smallvectors instead of vectors for performance.
Fix BuildAggrIvarLayout to not access vectors out of range.

llvm-svn: 68101
2009-03-31 08:48:01 +00:00
Bill Wendling 6afae239c2 Really temporarily revert r68073.
llvm-svn: 68100
2009-03-31 08:42:40 +00:00
Bill Wendling b8017e02ca Oy! When reverting r68073, I added in experimental code. Sorry...
llvm-svn: 68099
2009-03-31 08:41:31 +00:00
Chris Lattner d8a47c42cd simplify some casting
llvm-svn: 68098
2009-03-31 08:36:08 +00:00
Chris Lattner 06ae0e2c3b small cleanups.
llvm-svn: 68095
2009-03-31 08:33:16 +00:00
Chris Lattner f71b69f7f3 add a const version of the lookupFieldDeclForIvar method.
llvm-svn: 68094
2009-03-31 08:31:13 +00:00
Owen Anderson 4486c1fac0 Remove the "fast" cases for spill and restore point determination, as these were subtlely wrong in obscure cases. Patch the testcase
to account for this change.

llvm-svn: 68093
2009-03-31 08:27:09 +00:00
Bill Wendling c4b08e5eb0 Revert r68073. It's causing a failure in the Apple-style builds.
llvm-svn: 68092
2009-03-31 08:26:26 +00:00
Chris Lattner fe4847e331 reduce nesting.
llvm-svn: 68091
2009-03-31 08:18:48 +00:00
Chris Lattner 5d68896c7b Codegen sometimes crashes on comparisons that aren't legal, just
disable this feature for now, to err on the side of rejecting instead
of sometimes crashing.  rdar://6326239

llvm-svn: 68088
2009-03-31 07:46:52 +00:00
Chris Lattner 42bae59678 shrink subclassid, liberating some bits for future (ab)use.
llvm-svn: 68087
2009-03-31 07:25:22 +00:00
Anders Carlsson dafd621b22 Check in test for namespace aliases+using directives.
llvm-svn: 68086
2009-03-31 05:47:19 +00:00
Anders Carlsson 10b9f81eaf Document NamespaceAliasDecl.
llvm-svn: 68085
2009-03-31 04:51:13 +00:00
Ted Kremenek f0ec333fc1 Update test case.
llvm-svn: 68084
2009-03-31 03:34:38 +00:00
Dan Gohman 97a20b8dbf Fix live-out reg logic to not insert over-aggressive AssertZExt
instructions. This fixes lua.

llvm-svn: 68083
2009-03-31 01:38:29 +00:00
Evan Cheng 885bc6de52 X86 address mode isel tweak. If the base of the address is also used by a CopyToReg (i.e. it's likely live-out), do not fold the sub-expressions into the addressing mode to avoid computing the address twice. The CopyToReg use will be isel'ed to a LEA, re-use it for address instead.
This is not yet enabled.

llvm-svn: 68082
2009-03-31 01:13:53 +00:00
Douglas Gregor b67535d1b6 Parsing and AST representation for dependent template names that occur
within nested-name-specifiers, e.g., for the "apply" in

  typename MetaFun::template apply<T1, T2>::type

At present, we can't instantiate these nested-name-specifiers, so our
testing is sketchy.

llvm-svn: 68081
2009-03-31 00:43:58 +00:00
Douglas Gregor b874bd9f41 Really, really fix PointerUnion3::is
llvm-svn: 68079
2009-03-31 00:34:31 +00:00
Fariborz Jahanian b35b4a9b42 fe support for objc2's nonfragile-abi synthesized ivars.
llvm-svn: 68077
2009-03-31 00:06:29 +00:00
Steve Naroff 7b753d21b5 Implement UCN support for C string literals (C99 6.4.3) and add some very basic tests. Chris Goller has graciously offered to write some test to help validate UCN support.
From a front-end perspective, I believe this code should work for ObjC @-strings. At the moment, I believe we need to tweak the code generation for @-strings (which doesn't appear to handle them). Will be investigating.

llvm-svn: 68076
2009-03-30 23:46:03 +00:00
Eli Friedman 29f80c343b Slight generalization for Evaluate with const variables.
llvm-svn: 68075
2009-03-30 23:39:01 +00:00
Douglas Gregor dc572a3266 Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").

One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as

  std::(vector<int>)

we represent it as

  (std::vector)<int>

which more closely follows the C++ grammar. 

Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.

llvm-svn: 68074
2009-03-30 22:58:21 +00:00
Dan Gohman adccd30533 Except in asm-verbose mode, avoid printing labels for blocks that are
only reachable via fall-through edges. This dramatically reduces the
number of labels printed, and thus also the number of labels the
assembler must parse and remember.

llvm-svn: 68073
2009-03-30 22:55:17 +00:00
Ted Kremenek 89cc8ea794 Add partial CFG support for Objective-C exception-handling blocks. We basically
assume that @catch blocks are never executed.

llvm-svn: 68072
2009-03-30 22:29:21 +00:00
Devang Patel 6e68bd007a Loop Index Split can eliminate a loop if it can determin if loop body is executed only once. There was a bug in determining IV based value of the iteration for which the loop body is executed. Fix it.
llvm-svn: 68071
2009-03-30 22:24:10 +00:00
Ted Kremenek 7857bd2743 Re-apply 68028. The code had drifted enough that the tests would fail without
it.  Will discuss offline whether symbolic regions should by typed or typeless.

llvm-svn: 68070
2009-03-30 22:20:54 +00:00
Daniel Dunbar cbe5b2f800 Comment fix.
llvm-svn: 68069
2009-03-30 22:11:38 +00:00
Ted Kremenek 5715393da2 Revert 68028.
llvm-svn: 68068
2009-03-30 21:56:17 +00:00
Douglas Gregor d33a33cedb Make PointerUnion3::get work properly
llvm-svn: 68067
2009-03-30 21:44:13 +00:00
Evan Cheng a84a318873 When optimzing a mul by immediate into two, the resulting mul's should get a x86 specific node to avoid dag combiner from hacking on them further.
llvm-svn: 68066
2009-03-30 21:36:47 +00:00
Evan Cheng 09f5be8146 Turn a 2-address instruction into a 3-address one when it's profitable even if the two-address operand is killed.
e.g.
%reg1024<def> = MOV r1
%reg1025<def> = ADD %reg1024, %reg1026
r0            = MOV %reg1025

If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy.

llvm-svn: 68065
2009-03-30 21:34:07 +00:00
Fariborz Jahanian 6683b8a272 Added new info to property impl. AST node to support
objc2's ivar synthesis.

llvm-svn: 68064
2009-03-30 21:33:50 +00:00