Commit Graph

60364 Commits

Author SHA1 Message Date
Anders Carlsson 0a63741a3f Add code for emitting C++ destructors. Not used yet.
llvm-svn: 72591
2009-05-29 21:03:38 +00:00
Douglas Gregor 7de5966d76 Create a new PrintingPolicy class, which we pass down through the AST
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.

llvm-svn: 72590
2009-05-29 20:38:28 +00:00
Bill Wendling 006459ecd4 Enable GVN Load PRE.
llvm-svn: 72589
2009-05-29 20:38:16 +00:00
Eli Friedman bd32745978 Make sure we don't give the wrong warning, and make sure not to set
hadError (suppressing future diagnostics) if we didn't print an 
error.

llvm-svn: 72588
2009-05-29 20:20:05 +00:00
Eli Friedman be7e42b27f Add an assertion so that we don't accidentally build constant arrays of
VLAs.

llvm-svn: 72587
2009-05-29 20:17:55 +00:00
Duncan Sands 15de591890 Dan noticed that the verifier wasn't thoroughly checking uses of
invoke results (see the testcases).  Tighten up the checking.

llvm-svn: 72586
2009-05-29 19:39:36 +00:00
Eli Friedman 9444638e4e Re-add a slightly more general version of the check from r72578; it is
actually necessary in some obscure cases.

llvm-svn: 72585
2009-05-29 19:23:46 +00:00
Mike Stump a678874975 Oops, the testcase I was thinking of is supposed to error out. I
tried other things that might trip, but they all worked.

llvm-svn: 72584
2009-05-29 19:14:13 +00:00
Eli Friedman 20da71e3b6 Add a couple missing ARM defines.
llvm-svn: 72583
2009-05-29 19:00:15 +00:00
Douglas Gregor 6181ded4ad Reduce the amount of stack space we use in SmallVectors during
template instantiation. This helps reduce our stack footprint when
performing deep template instantiations.

llvm-svn: 72582
2009-05-29 18:27:38 +00:00
Eli Friedman 893abe482d Revert r72575, which isn't really right, and fix up other code to
handle the construct in question correctly.

llvm-svn: 72581
2009-05-29 18:22:49 +00:00
Sebastian Redl d643456d45 Reject incomplete types in exception specs.
llvm-svn: 72580
2009-05-29 18:02:33 +00:00
Bruno Cardoso Lopes 9d809cad50 Fix some typos
llvm-svn: 72579
2009-05-29 17:08:57 +00:00
Mike Stump 7f12d51a48 Fixup codegen for composition of vla types using a normal array type.
llvm-svn: 72578
2009-05-29 17:06:45 +00:00
Torok Edwin 0b0ddb21fe just show the instruction, its not that slow.
llvm-svn: 72577
2009-05-29 16:58:36 +00:00
Sebastian Redl eed0ec5fdb Fix usage of placement new. Placement new is not actually declared implicitly.
llvm-svn: 72576
2009-05-29 16:43:59 +00:00
Mike Stump fc30bf9b16 Avoid dumping during semantic analysis when checking array types when
a vla is used.

llvm-svn: 72575
2009-05-29 16:34:15 +00:00
Mike Stump de83126b80 We don't want to validate bad code,
llvm-svn: 72574
2009-05-29 16:24:13 +00:00
Mike Stump f9f89a3fee Note another case that doesn't work yet.
llvm-svn: 72573
2009-05-29 16:12:36 +00:00
Mike Stump df0fe27b66 Fixup the rest of the trivial cases of the codegen of volatile. If
any body can spot codegen bugs with volatile, or knows of any in the
bug database, let me know.

llvm-svn: 72572
2009-05-29 15:46:01 +00:00
Sebastian Redl 10b9de45c3 Disallow exception specifications on multi-level indirections.
llvm-svn: 72571
2009-05-29 15:01:05 +00:00
Douglas Gregor 82dbbd7054 Some cleanups and commenting to our declaration-name handling
llvm-svn: 72570
2009-05-29 14:49:33 +00:00
Douglas Gregor 0558094464 Follow-on test case for template instantiation of interesting DeclGroups
llvm-svn: 72569
2009-05-29 14:26:40 +00:00
Douglas Gregor 8157b07caf Now that we have declared/defined tag types within DeclGroups,
instantiation of tags local to member functions of class templates
(and, eventually, function templates) works when the tag is defined as
part of the decl-specifier-seq, e.g.,

  struct S { T x, y; } s1;

Also, make sure that we don't try to default-initialize a dependent
type.

llvm-svn: 72568
2009-05-29 14:25:00 +00:00
Torok Edwin 6a94624a1b for instructions with void type we have no choice but print the instruction as
is, otherwise we get a <badref>.

llvm-svn: 72567
2009-05-29 10:28:44 +00:00
Torok Edwin 72070282eb Add a DEBUG() output to GVN that prints the instruction clobbering a load.
This is useful when trying to figure out why GVN didn't eliminate redundant
loads.

llvm-svn: 72565
2009-05-29 09:46:03 +00:00
Owen Anderson 04cfdd38a2 Fix an issue where phiMap was not being updated properly when doing load PRE.
Diagnosis and patch thanks to Jakub Staszak.

llvm-svn: 72562
2009-05-29 05:37:54 +00:00
Evan Cheng 87b037168e Default isNarrowingProfitable to false.
llvm-svn: 72561
2009-05-29 05:31:40 +00:00
Evan Cheng 8e97b85cde Remove an accidental commit.
llvm-svn: 72560
2009-05-29 05:28:52 +00:00
Eli Friedman 55b9ecbc7a If a declarator group declares a type, make sure to add that declaration
to the DeclGroup.

llvm-svn: 72559
2009-05-29 01:49:24 +00:00
Evan Cheng 716e688fca More h-registers tricks: folding zext nodes.
llvm-svn: 72558
2009-05-29 01:44:43 +00:00
Evan Cheng 86cdb4b345 Do not try to create a MVT type of width 0.
llvm-svn: 72557
2009-05-28 23:52:18 +00:00
Bill Wendling 2e09bd3d34 The MONITOR and MWAIT instructions have insufficient information for
decoding. Essentially, they both map to the same column in the "opcode
extensions for one- and two-byte opcodes" table in the x86 manual. The RawFrm
complicates decoding this.

Instead, use opcode 0x01, prefix 0x01, and form MRM1r. Then have the code
emitter special case these, a la [SML]FENCE.

llvm-svn: 72556
2009-05-28 23:40:46 +00:00
Douglas Gregor d6ab8744dc When we parse a tag specifier, keep track of whether that tag
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:

  1) In C++, one is not allowed to define tag types within a type
  specifier (e.g., static_cast<struct S { int x; } *>(0) is
  ill-formed) or within the result or parameter types of a
  function. We now diagnose this.

  2) We can extend DeclGroups to contain information about any tags
  that are declared/defined within the declaration specifiers of a
  variable, e.g.,

    struct Point { int x, y, z; } p;

  This will help improve AST printing and template instantiation,
  among other things.

  3) For C99, we can keep track of whether a tag type is defined
  within the type of a parameter, to properly cope with cases like,
  e.g.,

    int bar(struct T2 { int x; } y) {
      struct T2 z;
    }

  We can also do similar things wherever there is a type specifier,
  e.g., to keep track of where the definition of S occurs in this
  legal C99 code:

    (struct S { int x, y; } *)0

  

llvm-svn: 72555
2009-05-28 23:31:59 +00:00
Eli Friedman 2a69547f38 PR4281: Fix bogus CodeGen assertion. The issue is that
getUnqualifiedType() doesn't strip off all qualifiers for non-canonical 
types.

llvm-svn: 72552
2009-05-28 23:04:00 +00:00
Daniel Dunbar e88a7d518e NewNightlyTest.pl: Add a -parallel-jobs argument (set # of jobs for make with
-parallel, instead of always using 2).

llvm-svn: 72551
2009-05-28 22:45:24 +00:00
Eli Friedman e4b43e60b3 Add explicit test for PR4280.
llvm-svn: 72539
2009-05-28 21:04:35 +00:00
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