Commit Graph

107040 Commits

Author SHA1 Message Date
Nico Weber 0870debb8b Warn on "void f(int a[10]) { sizeof(a); }"
llvm-svn: 133036
2011-06-15 02:47:03 +00:00
Eli Friedman e8bbc10880 Stop using memdep for a check that didn't really make sense with memdep. In terms of specific issues, using memdep here checks irrelevant instructions and won't work properly once we start returning "unknown" more aggressively from memdep.
llvm-svn: 133035
2011-06-15 01:25:56 +00:00
Evan Cheng 6d02d9044b PerformBFICombine - (bfi A, (and B, Mask1), Mask2) -> (bfi A, B, Mask2) iff
the bits being cleared by the AND are not demanded by the BFI.

The previous BFI dag combine rule was actually incorrect (or used to be
correct until BFI representation changed).

rdar://9609030

llvm-svn: 133034
2011-06-15 01:12:31 +00:00
Ted Kremenek 70f05fdfee Sema: show shift result in hexadecimal
Change the output for -Wshift-overflow and
-Wshift-sign-overflow to an unsigned hexadecimal. It makes
more sense for looking at bits than a signed decimal does.
Also, change the diagnostic's wording from "overrides"
to "sets".

This uses a new optional argument in APInt::toString()
that adds the '0x' prefix to hexademical numbers.

This fixes PR 9651.

Patch by nobled@dreamwidth.org!

llvm-svn: 133033
2011-06-15 00:54:52 +00:00
Ted Kremenek b05f02e956 add option for literal formatting to APInt::toString()
toString() now takes an optional bool argument that,
depending on the radix, adds the appropriate prefix
to the integer's string representation that makes it into a
meaningful C literal, e.g.:

hexademical: '-f' becomes '-0xf'
octal: '77' becomes '077'
binary: '110' becomes '0b110'

Patch by nobled@dreamwidth.org!

llvm-svn: 133032
2011-06-15 00:51:55 +00:00
Eli Friedman 7d58bc7bc0 Add "unknown" results for memdep, which mean "I don't know whether a dependence for the given instruction exists in the given block". This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions.
llvm-svn: 133031
2011-06-15 00:47:34 +00:00
Chris Lattner e67977214f mention new VLA behavior in gnu* vs c* mode dox.
llvm-svn: 133030
2011-06-15 00:41:40 +00:00
Jakob Stoklund Olesen 22ea424d43 Move the list of register classes into CodeGenRegBank as well.
No functional change intended.

llvm-svn: 133029
2011-06-15 00:20:40 +00:00
Tanya Lattner e9e6705cf9 Add an optimization that looks for a specific pair-wise add pattern and generates a vpaddl instruction instead of scalarizing the add.
Includes a test case.

llvm-svn: 133027
2011-06-14 23:48:48 +00:00
Rafael Espindola 2efebb3610 Add triple.
llvm-svn: 133026
2011-06-14 23:47:36 +00:00
Douglas Gregor a860e6aebc Introduce a -cc1-level option to turn off related result type
inference, to be used (only) by the Objective-C rewriter.

llvm-svn: 133025
2011-06-14 23:20:43 +00:00
Ted Kremenek 192ed0b7ee [format strings] correctly suggest correct type for '%@' specifiers. Fixes <rdar://problem/9607158>.
llvm-svn: 133024
2011-06-14 22:56:51 +00:00
Anna Zaks cd7f70e8b5 Anna's test commit (#2).
llvm-svn: 133023
2011-06-14 22:40:29 +00:00
Chad Rosier 818e116723 When pattern matching during instruction selection make sure shl x,1 is not
converted to add x,x if x is a undef.  add undef, undef does not guarantee
that the resulting low order bit is zero.
Fixes <rdar://problem/9453156> and <rdar://problem/9487392>.

llvm-svn: 133022
2011-06-14 22:29:10 +00:00
Rafael Espindola 1bf96ac607 Check the llc output.
llvm-svn: 133021
2011-06-14 22:24:32 +00:00
Johnny Chen 67a3e9e40c Update usage comment.
llvm-svn: 133020
2011-06-14 22:23:54 +00:00
Daniel Dunbar 7487bbb72a build/clang_darwin: Fix previous change to CheckArches to not cause problem when
command produces error output on stdout instead of stderr (and suppress the
stderr output while at it).

llvm-svn: 133019
2011-06-14 22:21:49 +00:00
Eli Friedman 164b1d753a PR10136: fix PPCTargetLowering::LowerCall_SVR4 so that a necessary CopyToReg doesn't appear to be dead.
Roman, since you're writing tests for other PPC-SVR4 vararg-related stuff, would you mind writing a test for this?

llvm-svn: 133018
2011-06-14 22:16:20 +00:00
Anna Zaks d7f7fcd3cb Anna's test commit.
llvm-svn: 133017
2011-06-14 22:10:12 +00:00
Fariborz Jahanian d53eca68f0 Bad table discription of fromat-y2k causes
no-format-y2k turn off -Wformat altogether. 
// rdar://9504680

llvm-svn: 133015
2011-06-14 21:54:00 +00:00
Stuart Hastings f96281f4b7 Test case for x86 MMX inline asm. rdar://problem/8886707
llvm-svn: 133014
2011-06-14 21:51:38 +00:00
Jim Grosbach ed1da49673 Revert 133010. Self-hosted buildbot unhappy.
Apparently llvm itself generates undefined assembler local labels, causing
self-hosting problems with this patch. Reverting until that's sorted out.

llvm-svn: 133013
2011-06-14 21:51:20 +00:00
Blaine Garst f562bf239c fix example as per rdar://problem/9461587
llvm-svn: 133012
2011-06-14 21:41:00 +00:00
Eli Friedman 50ed150632 Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch 2 of 3.
llvm-svn: 133011
2011-06-14 21:20:53 +00:00
Jim Grosbach 627e780902 Diagnostic for undefined assembler local symbols.
When an assembler local symbol is used but not defined in a module, a
Darwin assembler wants to issue a diagnostic to that effect.

rdar://9559714

llvm-svn: 133010
2011-06-14 21:13:25 +00:00
Rafael Espindola 761cee0785 Add a test for the recent regression.
llvm-svn: 133009
2011-06-14 20:38:50 +00:00
Howard Hinnant ce53420e37 Provide names for template and function parameters in forward declarations. The purpose is to aid automated documentation tools.
llvm-svn: 133008
2011-06-14 19:58:17 +00:00
Eli Friedman 8a3264ad48 Revert r133004 ; it's breaking nightly tests.
llvm-svn: 133007
2011-06-14 19:30:33 +00:00
Johnny Chen 25e68e3c1b Primitive attach support for linux
This patch is a starting point for the attach functionality.

Signed-off-by: Johnny Chen <johnny.chen@apple.com>
llvm-svn: 133006
2011-06-14 19:19:50 +00:00
Chris Lattner 848fa212e8 revert r133003 and fix the bug properly: the issue was that ## in a token
lexer is not a paste operator, it is a normal token.  This fixes a conformance
issue shown here:
http://p99.gforge.inria.fr/c99-conformance/c99-conformance-clang-2.9.html

and it defines away the crash from before.

llvm-svn: 133005
2011-06-14 18:19:37 +00:00
Rafael Espindola 5e85158321 Partial revert of 132882.
Dan noted that this would work on the case shown on the commit message. I think
the case that was failing was a bb ending with a redundant conditional jump:

...
jne foo

foo:
...

I was unable to find any such case in the tests or in a debug build of clang,
so I will revert this part of the patch and watch the bots.

llvm-svn: 133004
2011-06-14 18:12:31 +00:00
Chris Lattner 07efdfdafa Fix a crash on the testcase in PR9981 / rdar://9486765.
llvm-svn: 133003
2011-06-14 18:12:03 +00:00
Evan Cheng 965ed2e790 Also recognize ARM v4t and v5e variants.
llvm-svn: 133002
2011-06-14 18:08:33 +00:00
Dan Gohman 8355febbf4 This test is still failing. Delete the rest of it.
llvm-svn: 133001
2011-06-14 18:07:36 +00:00
Dan Gohman 92789eafe5 Revert r132991. This test is failing on the
llvm-gcc-x86_64-linux-selfhost buildbot and others.

llvm-svn: 133000
2011-06-14 18:03:11 +00:00
Jakob Stoklund Olesen 01eada6e5c Fix a compile time regression caused by too small hash tables.
Measure the worst case number of probes for a miss instead of the less
conservative number of probes required for an insertion.

Lower the limit to < 6 probes worst case.

This doubles the size of the ARM and X86 hash tables, other targets are
unaffected. LiveVariables runs 12% faster with this change.

<rdar://problem/9598545>

llvm-svn: 132999
2011-06-14 16:58:16 +00:00
Douglas Gregor d1cff77200 When profiling FunctionProtoTypes, don't canonicalize the expression
in a noexcept exception specification because it isn't part of the
canonical type. This ensures that we keep the exact expression written
in the noexcept exception specification, rather than accidentally
"adopting" a previously-written and canonically "equivalent" function
prototype. Fixes PR10087.

llvm-svn: 132998
2011-06-14 16:42:44 +00:00
Caroline Tice c1338e8d38 Add error message; clean up comment.
llvm-svn: 132997
2011-06-14 16:36:12 +00:00
Nico Weber c5e7386983 Warn on memset(ptr, 0, sizeof(ptr)). Diagnostic wording by Jordy Rose.
llvm-svn: 132996
2011-06-14 16:14:58 +00:00
Rafael Espindola 3aeaf9e4c1 Add 132986 back, but avoid non-determinism if a bb address gets reused.
llvm-svn: 132995
2011-06-14 15:31:54 +00:00
David Majnemer c6a998712d Remove the Fix-it for missing statement in switches
llvm-svn: 132994
2011-06-14 15:24:38 +00:00
Nadav Rotem 0e230bc7bb Add a testcase for #9623
llvm-svn: 132991
2011-06-14 13:23:10 +00:00
Benjamin Kramer 648788e722 StaticDiagNameIndex is never written to, place it into .rodata.
llvm-svn: 132990
2011-06-14 13:15:38 +00:00
Jay Foad 0b16695d93 Hyphenate "argument-dependent".
llvm-svn: 132989
2011-06-14 12:59:25 +00:00
Rafael Espindola 06ba7a68de revert 132986 to see if the bots go green.
llvm-svn: 132988
2011-06-14 12:48:26 +00:00
Nadav Rotem a0da74677e This testcase cause a failure on some bots. Remove the failing test until
further investigation.

llvm-svn: 132986
2011-06-14 09:10:37 +00:00
Nadav Rotem 10193c830b Add a testcase for checking the integer-promotion of many different vector
types (with power of two types such as 8,16,32 .. 512).

Fix a bug in the integer promotion of bitcast nodes. Enable integer expanding
only if the target of the conversion is an integer (when the type action is
scalarize).

Add handling to the legalization of vector load/store in cases where the saved
vector is integer-promoted.

llvm-svn: 132985
2011-06-14 08:11:52 +00:00
Nadav Rotem 571ae19af7 Disable trunc-store simplification on vectors.
llvm-svn: 132984
2011-06-14 07:18:26 +00:00
Chris Lattner f35de48c90 when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded to a constant
as constant size arrays.  This has slightly different semantics in some insane cases, but allows
us to accept some constructs that GCC does.  Continue to be pedantic in -std=c99 and other
modes.  This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code

llvm-svn: 132983
2011-06-14 06:38:10 +00:00
Cameron Zwarich b5f19d9f6f Be more obvious about what is being tested.
llvm-svn: 132982
2011-06-14 06:33:51 +00:00