Commit Graph

107758 Commits

Author SHA1 Message Date
Chandler Carruth c933221826 Factor out (some of) the checking for invalid forms of pointer
arithmetic into a couple of common routines. Use these to make the
messages more consistent in the various contexts, especially in terms of
consistently diagnosing binary operators with invalid types on both the
left- and right-hand side. Also, improve the grammar and wording of the
messages some, handling both two pointers and two (different) types.

The wording of function pointer arithmetic diagnostics still strikes me
as poorly phrased, and I worry this makes them slightly more awkward if
more consistent. I'm hoping to fix that with a follow-on patch and test
case that will also make them more helpful when a typedef or template
type parameter makes the type completely opaque.

Suggestions on better wording are very welcome, thanks to Richard Smith
for some initial help on that front.

llvm-svn: 133906
2011-06-27 08:02:19 +00:00
Nick Lewycky a61df3f843 Teach one piece of scalarrepl to handle lifetime markers. When transforming an
alloca that only holds a copy of a global and we're going to replace the users
of the alloca with that global, just nuke the lifetime intrinsics. Part of
PR10121.

llvm-svn: 133905
2011-06-27 05:40:02 +00:00
Nick Lewycky 3e334a42d7 Move onlyUsedByLifetimeMarkers to ValueTracking so that it can be used by other
passes as well.

llvm-svn: 133904
2011-06-27 04:20:45 +00:00
Jakob Stoklund Olesen ff653a2eed Grow the X86FloatingPoint register map to hold 16 registers.
This allows for more live scratch registers which is needed to handle
live ST registers before return and inline asm instructions.

llvm-svn: 133903
2011-06-27 04:08:36 +00:00
Jakob Stoklund Olesen 537a302d1a Distinguish early clobber output operands from clobbered registers.
Both become <earlyclobber> defs on the INLINEASM MachineInstr, but we
now use two different asm operand kinds.

The new Kind_Clobber is treated identically to the old
Kind_RegDefEarlyClobber for now, but x87 floating point stack inline
assembly does care about the difference.

This will pop a register off the stack:

  asm("fstp %st" : : "t"(x) : "st");

While this will pop the input and push an output:

  asm("fst %st" : "=&t"(r) : "t"(x));

We need to know if ST0 was a clobber or an output operand, and we can't
depend on <dead> flags for that.

llvm-svn: 133902
2011-06-27 04:08:33 +00:00
Jakob Stoklund Olesen 6b356b18b4 Decode and pretty print inline asm operand descriptors.
The INLINEASM MachineInstrs have an immediate operand describing each
original inline asm operand. Decode the bits in MachineInstr::print() so
it is easier to read:

  INLINEASM <es:rorq $1,$0>, $0:[regdef], %vreg0<def>, %vreg1<def>, $1:[imm], 1, $2:[reguse] [tiedto:$0], %vreg2, %vreg3, $3:[regdef-ec], %EFLAGS<earlyclobber,imp-def>

llvm-svn: 133901
2011-06-27 04:08:29 +00:00
Rafael Espindola 2cf9489cf6 Remove unused methods.
llvm-svn: 133900
2011-06-26 22:44:34 +00:00
Rafael Espindola 676c405acb There is only one register coalescer. Merge it into the base class and
remove the analysis group.

llvm-svn: 133899
2011-06-26 22:34:10 +00:00
Richard Smith 95ce4f67a3 Fix PR10187: when diagnosing a two-phase-lookup-related failure, don't assert that any names we find are valid candidates for the call.
llvm-svn: 133898
2011-06-26 22:19:54 +00:00
Rafael Espindola ea1a9c342d Merge SimpleRegisterCoalescing.cpp into RegisterCoalescer.cpp.
llvm-svn: 133897
2011-06-26 22:06:36 +00:00
Rafael Espindola 14a314b1c6 merge SimpleRegisterCoalescing.h into RegisterCoalescer.h.
llvm-svn: 133896
2011-06-26 21:54:28 +00:00
Rafael Espindola fef3c64a1f Move RegisterCoalescer.h to lib/CodeGen.
llvm-svn: 133895
2011-06-26 21:41:06 +00:00
Johnny Chen 2027e2af21 Move more top level test dirs to reside under functionalities dir.
llvm-svn: 133894
2011-06-26 21:36:28 +00:00
Johnny Chen 1429bcb330 A couple of directory renamings; get rid of 'tests' from the directory names.
llvm-svn: 133893
2011-06-26 21:27:27 +00:00
Johnny Chen 436975b26c Move some top level directories to reside under functionalities dir.
llvm-svn: 133892
2011-06-26 21:24:46 +00:00
Johnny Chen e9d979f463 Create new directory named 'functionalities' to house some existing top level directories.
llvm-svn: 133891
2011-06-26 21:11:46 +00:00
Johnny Chen a9dd83be4b Move hello_world to now reside under python_api dir.
llvm-svn: 133890
2011-06-26 20:59:36 +00:00
Johnny Chen 4ad8edd10f Simplified the test cases, before moving the file to reside under python_api dir.
llvm-svn: 133889
2011-06-26 20:48:37 +00:00
Rafael Espindola 4c9613c5e5 Remove unnecessary wrapper.
llvm-svn: 133886
2011-06-26 19:47:36 +00:00
Johnny Chen 8d798eb3c6 Move struct_types, stepping, and set_values dirs to now reside under lang/c.
Move stl dir to now reside under lang/cpp.

llvm-svn: 133884
2011-06-25 21:07:03 +00:00
Johnny Chen 23beac3368 Move global_variables dir to lang/c and foundation dir to lang/objc.
llvm-svn: 133883
2011-06-25 20:55:22 +00:00
Johnny Chen 04d9e8323e Move test dirs forward and function_types to now reside under lang/c.
llvm-svn: 133882
2011-06-25 20:49:06 +00:00
Johnny Chen fb8cd3712a Move some directories to now reside under lang/c or lang/cpp.
llvm-svn: 133881
2011-06-25 20:43:57 +00:00
Johnny Chen 6684b1e19a Move enum_types to now reside under lang/c.
llvm-svn: 133880
2011-06-25 20:29:41 +00:00
Johnny Chen 30a6a1e365 Move namespace directory to now reside under lang/cpp.
llvm-svn: 133879
2011-06-25 20:21:10 +00:00
Johnny Chen 91b6b77795 Move C++-related test directories to now reside under lang.
llvm-svn: 133878
2011-06-25 20:19:47 +00:00
Johnny Chen 33e89de95a Move objc-related test directories to now reside under lang/objc.
llvm-svn: 133877
2011-06-25 20:16:38 +00:00
Johnny Chen 53af50ac56 Start moving things around to have a more hierarchical directory structure.
llvm-svn: 133876
2011-06-25 20:07:20 +00:00
Dan Bailey b49b736519 PTX: corrected tests that were failing
llvm-svn: 133875
2011-06-25 19:41:17 +00:00
Chad Rosier 15db390f8f Replace dyn_cast<> with cast<> since the cast is already guarded by the necessary check.
llvm-svn: 133874
2011-06-25 18:51:28 +00:00
Dan Bailey b7ee561399 PTX: Reverting implementation of i8.
The .b8 operations in PTX are far more limiting than I first thought. The mov operation isn't even supported, so there's no way of converting a .pred value into a .b8 without going via .b16, which is
not sensible. An improved implementation needs to use the fact that loads and stores automatically extend and truncate to implement support for EXTLOAD and TRUNCSTORE in order to correctly support
boolean values.

llvm-svn: 133873
2011-06-25 18:16:28 +00:00
Michael J. Spencer 1d6167fd30 Object: Add proper error handling.
llvm-svn: 133872
2011-06-25 17:55:23 +00:00
Michael J. Spencer 6d7138a168 Modify llvm-nm to use new Binary creation method.
llvm-svn: 133871
2011-06-25 17:54:59 +00:00
Michael J. Spencer ec29b121ff Make Binary the parent of ObjectFile and update children to new interface.
llvm-svn: 133870
2011-06-25 17:54:50 +00:00
Michael J. Spencer b02c95d43e Add Binary class. This is a cleaner parent than ObjectFile.
llvm-svn: 133869
2011-06-25 17:54:29 +00:00
Michael J. Spencer e4446923cf Add Object/Error.
llvm-svn: 133868
2011-06-25 17:42:56 +00:00
Nick Lewycky 967e745530 Enhance the sanity check for block sizes; check that the resulting pointer is
pointing to the range [first character, last character] instead of just not
after the last character. Patch by Yan Ivnitskiy!

llvm-svn: 133867
2011-06-25 17:08:50 +00:00
Greg Clayton 1ba7c4d01e Bumped Xcode project versions to lldb-65 and debugserver-140.
llvm-svn: 133865
2011-06-25 04:35:01 +00:00
Eli Friedman 5836852e9c Cleanup cast IRGen a bit; no intended functionality change.
llvm-svn: 133864
2011-06-25 02:58:47 +00:00
Chad Rosier f3e11190f3 Test case for r133858 (tail call optimize in the presence of byval).
llvm-svn: 133863
2011-06-25 02:44:56 +00:00
Richard Smith cfcdf3a659 Fix a couple more issues related to r133854:
When performing semantic analysis on a member declaration, fix the check for whether we are declaring a function to check for parenthesized declarators, declaration via decltype, etc.

Also fix the semantic check to not treat FuncType* as a function type.

llvm-svn: 133862
2011-06-25 02:28:38 +00:00
John McCall b793de703e Do not apply the ARC move optimization to 'const'-qualified xvalues.
llvm-svn: 133861
2011-06-25 02:26:44 +00:00
John McCall 55e1fbc848 LValue carries a type now, so simplify the main EmitLoad/Store APIs
by removing the redundant type parameter.

llvm-svn: 133860
2011-06-25 02:11:03 +00:00
Oscar Fuentes 8ca6622e9a Update CMake library dependencies.
llvm-svn: 133859
2011-06-25 02:10:19 +00:00
Chad Rosier bde13d3f76 Enable tail call optimization in the presence of a byval (x86-32 and x86-64).
<rdar://problem/9483883>

llvm-svn: 133858
2011-06-25 02:04:56 +00:00
Jason Molenda d8a2aaa472 Add support for a QEnvironmentHexEncoded packet which takes its
arguments in hex-encoded form instead of the old QEnvironment packet
which takes them as plain-text strings.  Environment variables
containing remote protocol special chars like '#' would fail to set
with QEnvironment.

llvm-svn: 133857
2011-06-25 01:55:21 +00:00
Jim Grosbach 8fbb89ffa4 Move ARM-specific test to ARM directory.
Hopefully make the x86-target-only Windows bots happy.

llvm-svn: 133856
2011-06-25 01:53:17 +00:00
John McCall 77527a8e65 Mark the multiply which occurs as part of performing pointer
arithmetic on a VLA as 'nsw', per discussion with djg, and
implement pointer arithmetic (other than array accesses) and
pointer subtraction for VLA types.

llvm-svn: 133855
2011-06-25 01:32:37 +00:00
Douglas Gregor c15b0cfc1f When deciding how to parse "= something" as part of a member
declaration, determine whether the declaration will end up declaring a
function using semantic criteria (e.g., it will have function type)
rather than purely syntactic criteria (e.g., it has the form of a
function declarator). Fixes <rdar://problem/9670557>.

llvm-svn: 133854
2011-06-25 00:56:27 +00:00
Douglas Gregor 03bf47c0f0 Unbreak CMake build
llvm-svn: 133853
2011-06-25 00:51:50 +00:00