Commit Graph

60327 Commits

Author SHA1 Message Date
Eli Friedman 5d3a16f693 ARM is a legitimate Darwin architecture; don't assert.
llvm-svn: 72538
2009-05-28 20:57:06 +00:00
Eli Friedman e1dc193f35 Re-commit r72514 and r72516 with a fixed version of BR_CC lowering.
This patch removes some special cases for opcodes and does a bit of 
cleanup.

llvm-svn: 72536
2009-05-28 20:40:34 +00:00
Evan Cheng cc3ae1f2ff Fix MOVMSKPDrr encoding.
llvm-svn: 72535
2009-05-28 18:55:28 +00:00
Evan Cheng 60618fe4ac Fix PSIGND encoding bug. Patch by Sean Callanan.
llvm-svn: 72534
2009-05-28 18:48:53 +00:00
Evan Cheng 6673ff08fe Incorporate patch feedbacks.
llvm-svn: 72533
2009-05-28 18:41:02 +00:00
Daniel Dunbar e6986d8e60 NightlyTest: Write "sentdata.txt" files and run the -submit-aux script before
sending data to the server.
 - Otherwise if the server connection fails the external script never runs.

Also, create content before initiating connection to try and decrease time we
are connected to llvm.org.

llvm-svn: 72532
2009-05-28 18:31:40 +00:00
Sanjiv Gupta ae028d48be Emit debug info for locals with proper scope.
llvm-svn: 72531
2009-05-28 18:24:11 +00:00
Bill Wendling f193838d2b Temporarily revert r72514 (and dependent patch r72516). It was causing this
failure during llvm-gcc bootstrap:

Assertion failed: (!Tmp2.getNode() && "Can't legalize BR_CC with legal condition!"), function ExpandNode, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 2923.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:1727: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

llvm-svn: 72530
2009-05-28 18:18:59 +00:00
Sanjiv Gupta fc4707a331 Mark the branch insns correctly.
llvm-svn: 72529
2009-05-28 17:32:56 +00:00
Douglas Gregor 019d3750cb Add the missing public: thanks, Fariborz
llvm-svn: 72528
2009-05-28 16:41:44 +00:00
Daniel Dunbar 044a702f2f Move clang-cc's -v output to the start (vs. end) of compilation, and change
clang -> clang-cc to be less confusing.

llvm-svn: 72527
2009-05-28 16:37:33 +00:00
Douglas Gregor 9e927abc41 Introduced DeclContext::isDependentContext, which determines whether a
given DeclContext is dependent on type parameters. Use this to
properly determine whether a TagDecl is dependent; previously, we were
missing the case where the TagDecl is a local class of a member
function of a class template (phew!).

Also, make sure that, when we instantiate declarations within a member
function of a class template (or a function template, eventually),
that we add those declarations to the "instantiated locals" map so
that they can be found when instantiating declaration references.

Unfortunately, I was not able to write a useful test for this change,
although the assert() that fires when uncommenting the FIXME'd line in
test/SemaTemplate/instantiate-declref.cpp tells the "experienced user"
that we're now doing the right thing.

llvm-svn: 72526
2009-05-28 16:34:51 +00:00
Sanjiv Gupta 335311c67a Fixing problems that got exposed after the refactoring of LegalizeDAG done in 72447.
llvm-svn: 72521
2009-05-28 06:59:57 +00:00
Chris Lattner 378d72cc40 update test for r72519
llvm-svn: 72520
2009-05-28 05:41:32 +00:00
Chris Lattner 7f4153dbee fix the "pasting formed 'a]', an invalid preprocessing token"
diagnostic to include the full instantiation location for the
invalid paste.  For:

#define foo(a, b)  a ## b
#define bar(x) foo(x, ])
bar(a)
bar(zdy)

Instead of:

t.c:3:22: error: pasting formed 'a]', an invalid preprocessing token
#define foo(a, b)  a ## b
                     ^
t.c:3:22: error: pasting formed 'zdy]', an invalid preprocessing token

we now produce:

t.c:7:1: error: pasting formed 'a]', an invalid preprocessing token
bar(a)
^
t.c:4:16: note: instantiated from:
#define bar(x) foo(x, ])
               ^
t.c:3:22: note: instantiated from:
#define foo(a, b)  a ## b
                     ^
t.c:8:1: error: pasting formed 'zdy]', an invalid preprocessing token
bar(zdy)
^
t.c:4:16: note: instantiated from:
#define bar(x) foo(x, ])
               ^
t.c:3:22: note: instantiated from:
#define foo(a, b)  a ## b
                     ^

llvm-svn: 72519
2009-05-28 05:39:39 +00:00
Eli Friedman 1f906448bc Add a testcase which got fixed by recent legalization work.
llvm-svn: 72517
2009-05-28 05:10:20 +00:00
Eli Friedman 9b9df77260 Remove a couple of useless functions.
llvm-svn: 72516
2009-05-28 04:49:34 +00:00
Eli Friedman 3aa278394e Remove special cases for more opcodes.
This is basically the end of this series of patches for LegalizeDAG; the 
remaining special cases can't be removed without more infrastructure 
work.  There's a FIXME for each relevant opcode near the beginning of
SelectionDAGLegalize::LegalizeOp.

llvm-svn: 72514
2009-05-28 04:39:57 +00:00
Eli Friedman 5806e18ce1 Return the operand rather than a null SDValue when the given SELECT_CC
is actually legal.  Part of LegalizeDAG cleanups.

llvm-svn: 72513
2009-05-28 04:31:08 +00:00
Nick Lewycky 206876e2da Use Operands.data() instead of &Operands[0] where Operands is a potentially
empty SmallVector.

llvm-svn: 72512
2009-05-28 04:08:10 +00:00
Eli Friedman 5df7202d3b Remove special case for SETCC opcode; add some comments explaining why
some special cases are necessary.

llvm-svn: 72511
2009-05-28 03:56:57 +00:00
Jeffrey Yasskin 97021ae319 This patch brings the list of attributes in CPPBackend.cpp up to date with the
list in Attributes.h. It also reorders the CPPBackend list to match so that
it's easier to see that it's complete.

llvm-svn: 72510
2009-05-28 03:16:17 +00:00
Eli Friedman e1bc3798e6 Some minor cleanups.
llvm-svn: 72509
2009-05-28 03:06:16 +00:00
Bill Wendling 0feb0e6071 "The instructions MMX_PSADBWrm and MMX_PSADBWrr have opcode 0b11100000 (e0), but
the Intel manual (screenshot) says it should be 0b11110110 (f6).  The existing
encoding causes a disassembly conflict with MMX_PAVGBrm, which really should be
0f e0."

Patch by Sean Callanan!

llvm-svn: 72508
2009-05-28 02:04:00 +00:00
Evan Cheng a9cda8abf2 Added optimization that narrow load / op / store and the 'op' is a bit twiddling instruction and its second operand is an immediate. If bits that are touched by 'op' can be done with a narrower instruction, reduce the width of the load and store as well. This happens a lot with bitfield manipulation code.
e.g.
orl     $65536, 8(%rax)
=>
orb     $1, 10(%rax)

Since narrowing is not always a win, e.g. i32 -> i16 is a loss on x86, dag combiner consults with the target before performing the optimization.

llvm-svn: 72507
2009-05-28 00:35:15 +00:00
Mike Stump 01c2d0a17c Not setting all the fields is confusing...
llvm-svn: 72506
2009-05-28 00:16:27 +00:00
Daniel Dunbar 16f422ec86 Fix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar RValue.
llvm-svn: 72504
2009-05-27 23:45:33 +00:00
Douglas Gregor 14f5c132c1 Add a target triple, because this test depends on details of the x86-64 ABI
llvm-svn: 72503
2009-05-27 23:32:34 +00:00
Douglas Gregor e44a2adf41 Reimplement much of the way that we track nested classes in the
parser. Rather than placing all of the delayed member function
declarations and inline definitions into a single bucket corresponding
to the top-level class, we instead mirror the nesting structure of the
nested classes and place the delayed member functions into their
appropriate place. Then, when we actually parse the delayed member
function declarations, set up the scope stack the same way as it was
when we originally saw the declaration, so that we can find, e.g.,
template parameters that are in scope.

llvm-svn: 72502
2009-05-27 23:11:45 +00:00
Eli Friedman b5f33c1634 A few tweaks to the "Differences between various standard modes"
section.

llvm-svn: 72501
2009-05-27 23:02:57 +00:00
Eli Friedman 259109f9df restrict is not a keyword in gnu89 mode. Change TokenKinds.def to
reflect that.

llvm-svn: 72500
2009-05-27 22:48:34 +00:00
Eli Friedman 98dbc1c79a Don't vary token concatenation based on the language options; this
behavior is more likely to be confusing than useful.

llvm-svn: 72499
2009-05-27 22:33:06 +00:00
Sebastian Redl 5068f77ac7 Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.
llvm-svn: 72498
2009-05-27 22:11:52 +00:00
Eli Friedman 54eb224c3b Make the bad paste diagnostic print the entire pasted token.
llvm-svn: 72497
2009-05-27 22:00:37 +00:00
Dan Gohman 4d1823680d Revert 72493 and replace it with a more conservative fix, for now: don't
rewrite the comparison if there is any implicit extension or truncation
on the induction variable. I'm planning for IVUsers to eventually take
over some of the work of this code, and for it to be generalized.

llvm-svn: 72496
2009-05-27 21:10:47 +00:00
Eli Friedman a56159b7e9 Ger rid of some dead code.
llvm-svn: 72494
2009-05-27 20:39:00 +00:00
Dan Gohman f4d85325c0 In ChangeCompareStride, when the stride to be reused is truncated to
a smaller type, promoted its offset back up to the type of the new
comparison. This fixes PR4222.

llvm-svn: 72493
2009-05-27 20:00:18 +00:00
Fariborz Jahanian 7c1baf46d6 No write-barrier for initializations.
llvm-svn: 72492
2009-05-27 19:54:11 +00:00
Fariborz Jahanian 7551257f00 Change a confusing variable name.
llvm-svn: 72491
2009-05-27 19:48:48 +00:00
Sebastian Redl a81b0b7ef5 Add a big test case for I-C-Es in C++, and a fix to make it work. The fix might not be the right way to do it.
llvm-svn: 72490
2009-05-27 19:34:06 +00:00
Sebastian Redl eed3d4c73e Fix the type of a enum non-type template argument within the instantiation.
llvm-svn: 72489
2009-05-27 19:21:29 +00:00
Evan Cheng 4db1631a43 Fix sfence jit encoding. Patch by Sean Callanan.
llvm-svn: 72488
2009-05-27 18:38:01 +00:00
Douglas Gregor cd3a097925 Simplify, and improve the performance of, template instantiation for
declaration references. The key realization is that dependent Decls,
which actually require instantiation, can only refer to the current
instantiation or members thereof. And, since the current context
during instantiation contains all of those members of the current
instantiation, we can simply find the real instantiate that matches up
with the "current instantiation" template.

llvm-svn: 72486
2009-05-27 17:54:46 +00:00
Bill Wendling 0a9ea80013 This looks like it passes now.
llvm-svn: 72485
2009-05-27 17:43:21 +00:00
Douglas Gregor b8006fafe8 Add some more tests for instantiation of declaration references. Also,
improve some error recovery with explicit template instantiation.

llvm-svn: 72484
2009-05-27 17:30:49 +00:00
Bruno Cardoso Lopes a72a505a80 Added support for fround, fextend and FP_TO_SINT
llvm-svn: 72483
2009-05-27 17:23:44 +00:00
Douglas Gregor 7a74938fca Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.

llvm-svn: 72482
2009-05-27 17:20:35 +00:00
Douglas Gregor f98d9b60db Improve name lookup for and template instantiation of declaration
references. There are several smallish fixes here:

  - Make sure we look through template parameter scope when
    determining whether we're parsing a nested class (or nested class
    *template*). This makes sure that we delay parsing the bodies of
    inline member functions until after we're out of the outermost
    class (template) scope.
  - Since the bodies of member functions are always parsed
    "out-of-line", even when they were declared in-line, teach
    unqualified name lookup to look into the (semantic) parents.
  - Use the new InstantiateDeclRef to handle the instantiation of a
    reference to a declaration (in DeclRefExpr), which drastically
    simplifies template instantiation for DeclRefExprs.
  - When we're instantiating a ParmVarDecl, it must be in the current
    instantiation scope, so only look there.

Also, remove the #if 0's and FIXME's from the dynarray example, which
now compiles and executes thanks to Anders and Eli.

llvm-svn: 72481
2009-05-27 17:07:49 +00:00
Douglas Gregor bbcf90f936 Minor fix for CMake build system
llvm-svn: 72480
2009-05-27 16:52:17 +00:00
Anders Carlsson ddcbfe7b53 IRgen support for calls to functions that return references to aggregate exressions.
llvm-svn: 72479
2009-05-27 16:45:02 +00:00