Commit Graph

83055 Commits

Author SHA1 Message Date
Evan Cheng 5fb45a2b85 Do not generate duplicate dbg_value instructions for function arguments.
llvm-svn: 102585
2010-04-29 01:40:30 +00:00
Dan Gohman d9e7322c9a Fix missing #include.
llvm-svn: 102584
2010-04-29 01:39:13 +00:00
Evan Cheng 70a0145d7c Avoid emitting a dbg_value machineinstr that's not going to be inserted into entry block.
llvm-svn: 102581
2010-04-29 01:23:55 +00:00
John McCall 17b61785a3 Test case for r102578.
llvm-svn: 102580
2010-04-29 01:20:45 +00:00
John McCall e23b871c4b Access-check during template argument deduction from the context of the
template decl itself, not its context.  Testcase to follow;  fixes selfhost.

llvm-svn: 102578
2010-04-29 01:18:58 +00:00
Evan Cheng 250e917e9d Frame index can be negative.
llvm-svn: 102577
2010-04-29 01:13:30 +00:00
Ted Kremenek 989da5eeff Fix CFG crasher involving statement expressions reported in PR 6938.
llvm-svn: 102576
2010-04-29 01:10:26 +00:00
Evan Cheng f4336ebb2a Check Reg against zero.
llvm-svn: 102573
2010-04-29 00:59:34 +00:00
John McCall 80e58cd3e9 Properly switch into the declaring scope of a template when performing
template argument deduction or (more importantly) the final substitution
required by such deduction.  Makes access control magically work in these
cases.

Fixes PR6967.

llvm-svn: 102572
2010-04-29 00:35:03 +00:00
Douglas Gregor d170206761 Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.

llvm-svn: 102571
2010-04-29 00:18:15 +00:00
Evan Cheng a5a8f76cea - Really preserve dbg_value instructions when the register is spilled.
- Also, update dbg_value is the value is being re-matted from a frame slot, e.g. fixed slots for arguments.

llvm-svn: 102565
2010-04-28 23:52:26 +00:00
Daniel Dunbar 92d5c1a4bf build: Add CLANG_NO_RUNTIME build variable, which disables building clang
runtime library stuff, even if compiler-rt is available.

llvm-svn: 102560
2010-04-28 23:36:26 +00:00
Daniel Dunbar 12c82080a2 Driver: Add support for -fobjc-abi-version=.
- <rdar://problem/7919678>

llvm-svn: 102559
2010-04-28 23:25:24 +00:00
Devang Patel bb728e17d3 tidy up.
llvm-svn: 102558
2010-04-28 23:24:13 +00:00
Kevin Enderby 4822841b82 Fixed the word sized Bit Scan Forward/Reverse instructions, they needed the
Operand size override prefix to be part of their records.

llvm-svn: 102556
2010-04-28 23:20:40 +00:00
Evan Cheng 6e822459ed Replace r102368 with code that's less fragile. This creates DBG_VALUE instructions for function arguments early and insert them after instruction selection is done.
llvm-svn: 102554
2010-04-28 23:08:54 +00:00
Alexis Hunt c46382e4b3 Ensure that cv-qualifiers are correctly removed for post-inc/decrements
as well as pre- and post-inc/decrements in C (not that I think it
matters for any C code).

llvm-svn: 102552
2010-04-28 23:02:27 +00:00
Douglas Gregor ea679ec125 Fix template instantiation for __builtin_offfsetof expressions that refer to members of anonymous structs/unions
llvm-svn: 102551
2010-04-28 22:43:14 +00:00
Nate Begeman a8a9d6a1f0 A bit more neon work, adds work (but the ABI is wrong), types mostly stamped out.
llvm-svn: 102549
2010-04-28 22:37:01 +00:00
Douglas Gregor 10982ea3f9 Diagnose __builtin_offsetof expressions that refer to bit-fields
llvm-svn: 102548
2010-04-28 22:36:06 +00:00
Chris Lattner 669064a772 fix this to work with objdir != srcdir
llvm-svn: 102547
2010-04-28 22:34:35 +00:00
Fariborz Jahanian 499b902510 Support for construct/destruct of ivar array
of c++ objects (NeXt runtime).
radar 7900343.

llvm-svn: 102546
2010-04-28 22:30:33 +00:00
Dale Johannesen 2288ef6c33 Fix comment.
llvm-svn: 102545
2010-04-28 22:23:46 +00:00
Dale Johannesen 8d6d94f493 Test for llvm-gcc checkin 102543.
llvm-svn: 102544
2010-04-28 22:17:33 +00:00
Douglas Gregor 882211c1da Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

  1) CodeGen cannot handle the case where __builtin_offsetof is not a
  constant expression, so it produces an error. So, to avoid
  regressing in C, we retain the old UnaryOperator-based
  __builtin_offsetof implementation in C while using the shiny new
  OffsetOfExpr implementation in C++. The old implementation can go
  away once we have proper CodeGen support for this case, which we
  expect won't cause much trouble in C++.

  2) __builtin_offsetof doesn't work well with non-POD class types,
  particularly when the designated field is found within a base
  class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests. 

llvm-svn: 102542
2010-04-28 22:16:22 +00:00
Fariborz Jahanian 0dec1e0d56 IRGen for initialization/destruction of
ivar class objects (NeXt runtime).
(radar 7900343).

llvm-svn: 102533
2010-04-28 21:28:56 +00:00
Bob Wilson c892b6dbb0 Add an option to the Apple-style build to control whether libLTO.dylib should
be installed.  Disable it by default.

llvm-svn: 102531
2010-04-28 21:08:01 +00:00
Jim Grosbach 04cbcca319 Add sizes non-floating point versions for the eh sjlj intrinsic expansions.
rdar://7895451

llvm-svn: 102526
2010-04-28 20:33:09 +00:00
Devang Patel 4c18a3ac80 Update tests. Now DBG_VALUE instruction is created only if alloca corresponding to llvm.dbg.declare is missing.
llvm-svn: 102524
2010-04-28 20:27:48 +00:00
Chris Lattner ee3576e8f1 declare targets with (void) instead of () since this is a C header.
Patch by Lars R in PR6961.

llvm-svn: 102523
2010-04-28 20:24:45 +00:00
Chris Lattner 450e29cb4c fix PR6112 - When globalopt (or any other pass) does RAUW(@G, %G),
metadata references in non-function-local MDNodes should drop to 
null.

llvm-svn: 102519
2010-04-28 20:16:12 +00:00
Evan Cheng d4d1a51895 Pretty print DBG_VALUE machine instructions.
Before:
DBG_VALUE %RSI, 0, !-1; dbg:SimpleRegisterCoalescing.cpp:2707
Now:
DBG_VALUE %RSI, 0, !"this"; dbg:SimpleRegisterCoalescing.cpp:2707

llvm-svn: 102518
2010-04-28 20:03:13 +00:00
Chris Lattner e82411b47f add regex support for -verify mode. You can now do things like
expected-error-re {{someregex}}

Patch by mike-m!

llvm-svn: 102516
2010-04-28 20:02:30 +00:00
Chris Lattner 08e9e72fa9 Rework global alignment computation again. Now we do round up
alignment of globals to the preferred alignment, but only when
there is no section specified on the global (by far the common
case).

llvm-svn: 102515
2010-04-28 19:58:07 +00:00
David Chisnall 01aa46795e Changed signature of GenerateMessageSend() function to pass the ObjCInterfaceDecl for class messages and removed the boolean IsClassMessage argument, which wasn't used anywhere.
Emitted some metadata on message sends to allow a later pass to do some speculative inlining of class methods (GNU runtime).  Speculative inlining of instance methods requires type feedback to be useful (work in progress), but for class methods it works quite nicely.  

llvm-svn: 102514
2010-04-28 19:33:36 +00:00
Devang Patel 888c17073a While lowering dbg_declare, emit DBG_VALUE machine instruction if alloca matching llvm.dbg.declare intrinsic is missing.
llvm-svn: 102513
2010-04-28 19:27:33 +00:00
Nate Begeman cb2563f0c3 Stub out NEON support, more to come.
llvm-svn: 102512
2010-04-28 18:37:32 +00:00
Jakob Stoklund Olesen 06e7242d32 Recompute kill flags from live intervals after coalescing instead of trying to
update them. Computing kill flags is notoriously difficult, and the coalescer
would get it wrong sometimes, and it would completely skip physical registers.

Now we simply remove kill flags based on the live intervals after coalescing.
This is a few percent slower, but now we get correct kill flags for physical
registers after coalescing.

llvm-svn: 102510
2010-04-28 18:28:39 +00:00
Jakob Stoklund Olesen 96fad31694 Teach X86FloatingPoint that a register can be killed multiple times by the same
instruction.

This instruction would crash the pass:

  INLINEASM <es:foo $0 $1>, 9, %FP0<kill>, 9, %FP0<kill>, 14, %EFLAGS<earlyclobber,def,dead>

Now it doesn't.

llvm-svn: 102509
2010-04-28 18:28:37 +00:00
Bob Wilson 7ebb5e4cb0 Undo most of my previous whitespace fix. I think I like it better this way
after all.

llvm-svn: 102508
2010-04-28 18:18:36 +00:00
Bob Wilson a2dbebc431 Fix inconsistent use of HOSTS and TARGETS variables.
llvm-svn: 102505
2010-04-28 18:06:27 +00:00
Bob Wilson 5f1074adde Fix whitespace.
llvm-svn: 102504
2010-04-28 17:50:03 +00:00
Daniel Dunbar edd5bae86c Revert "Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of", it is breaking the builds of quite a few projects (emacs, dovecot, gnutar, bison).
llvm-svn: 102501
2010-04-28 16:20:58 +00:00
Fariborz Jahanian c83726e64e More of Sema to implement initialization of
ivar of c++ object types.

llvm-svn: 102500
2010-04-28 16:11:27 +00:00
Benjamin Kramer 9c05bf46d1 Remove unused function.
llvm-svn: 102499
2010-04-28 15:54:45 +00:00
Benjamin Kramer d76b698ca6 Reduce string trashing in getQualifiedNameAsString.
llvm-svn: 102498
2010-04-28 14:33:51 +00:00
David Chisnall d472c85285 Emit the correct symbol name for the class (GNU runtime).
llvm-svn: 102497
2010-04-28 14:29:56 +00:00
Abramo Bagnara 41160fed4c Written storage class for declarations inside linkage specifications without braces is none.
llvm-svn: 102496
2010-04-28 13:11:54 +00:00
Evan Cheng 050df1b8de Enable i16 to i32 promotion by default.
llvm-svn: 102493
2010-04-28 08:30:49 +00:00
Evan Cheng f100557c9a Try operation promotion only if regular dag combine and target-specific ones failed to do anything.
llvm-svn: 102492
2010-04-28 07:10:39 +00:00