Commit Graph

106125 Commits

Author SHA1 Message Date
Evan Cheng a3b4203cbc Remove dead option.
llvm-svn: 131947
2011-05-24 01:43:38 +00:00
Andrew Trick 37f0082804 FileCheck-ize a couple of IV unit tests.
llvm-svn: 131946
2011-05-24 01:02:49 +00:00
Rafael Espindola 7e9ca2c095 Fix cmake dependencies.
llvm-svn: 131943
2011-05-24 00:58:06 +00:00
Akira Hatanaka cb4a1a8d3f Simplify offset calculation of stack frame objects for $gp restore location and
variable arguments in LowerCall and LowerFormalArguments. This should also fix
the bug in which handling of variable arguments is incorrect when the front-end
optimizes away unused fixed arguments.

llvm-svn: 131942
2011-05-24 00:23:52 +00:00
Devang Patel 433a11b95a Test case for r131940.
llvm-svn: 131941
2011-05-24 00:22:40 +00:00
Devang Patel 354fa0798f Fix debug info for blocks' variable.
llvm-svn: 131940
2011-05-24 00:22:25 +00:00
Andrew Trick 1ea0243bd0 Test case for r130799 - indvars: Added canExpandBackEdgeTakenCount.
llvm-svn: 131939
2011-05-24 00:17:53 +00:00
Alexis Hunt 6a31f2c7c9 Delete the extraneous return statement that was causing my earlier
issues and also add a test.

We should now handle defaulted members of templates properly. No
comment as to whether or not this also holds for templated functions,
but defaulting those is kind of insane.

llvm-svn: 131938
2011-05-23 23:56:01 +00:00
Johnny Chen 0084527b82 Refactor InstructionLLVM::Dump() a little bit to reduce the entropy by introducing
a new file static utility function AddSymbolicInfo() which is called from places
within InstructionLLVM::Dump().

llvm-svn: 131937
2011-05-23 23:29:23 +00:00
Devang Patel faaa16ea2c Remove unnecessary comment.
llvm-svn: 131936
2011-05-23 23:16:14 +00:00
David Chisnall b85775c3ba Fix bug introduced with r131930.
llvm-svn: 131935
2011-05-23 23:15:11 +00:00
Greg Clayton 49c0fe24d6 Don't resolve the path when we extract the path from the dyld info or we
can end up with an invalid path if the path resolves to something different
on the local machine. It is very important not to since remote debugging will
mention paths that might exist on the current machine (like 
"/System/Library/Frameworks/CoreFoundation/CoreFoundation" which on the desktop
systems is a symlink to "/System/Library/Frameworks/CoreFoundation/Versions/A/CoreFoundation").

We will let the platform plug-ins resolve the paths in a later stage.

llvm-svn: 131934
2011-05-23 23:14:34 +00:00
Alexis Hunt 61ae8d395e Implement explicit specialization of explicitly-defaulted constructors.
The general out-of-line case (including explicit instantiation mostly
works except that the definition is being lost somewhere between the AST
and CodeGen, so the definition is never emitted.

llvm-svn: 131933
2011-05-23 23:14:04 +00:00
David Chisnall 1254f6efe2 Don't omit retain / release / autorelease message sends in hybrid GC mode.
llvm-svn: 131932
2011-05-23 23:13:25 +00:00
David Chisnall 3fe89562e8 Fix some problems where functions must be bitcast but we're expecting a llvm::Function of the right type.
PR9994.

llvm-svn: 131930
2011-05-23 22:33:28 +00:00
Akira Hatanaka dfb8cda11f Expand f64 FPOW.
llvm-svn: 131928
2011-05-23 22:23:58 +00:00
Akira Hatanaka 6af5bd2537 Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.
llvm-svn: 131927
2011-05-23 22:16:43 +00:00
Devang Patel efec7715ec Revert 121907 (it causes llc crash) and apply original patch from PR9817.
llvm-svn: 131926
2011-05-23 22:04:42 +00:00
Johnny Chen a542f10092 Fix usage comment.
llvm-svn: 131925
2011-05-23 21:56:08 +00:00
Johnny Chen b5aa97ecc5 Add a Python utility to help convert the Mail.app saved 'Raw Message Source' .eml file to a git-am friendly file.
llvm-svn: 131924
2011-05-23 21:50:12 +00:00
Sean Callanan 79763a42ab This commit integrates support for the LLVM MCJIT
into the mainline LLDB codebase.  MCJIT introduces
API improvements and better architectural support.

This commit adds a new subsystem, the
ProcessDataAllocator, which is responsible for
performing static data allocations on behalf of the
IR transformer.  MCJIT currently does not support
the relocations required to store the constant pool
in the same allocation as the function body, so we
allocate a heap region separately and redirect
static data references from the expression to that
heap region in a new IR modification pass.

This patch also fixes bugs in the IR
transformations that were exposed by the transition
to the MCJIT.  Finally, the patch also pulls in a
more recent revision of LLVM so that the MCJIT is
available for use.

llvm-svn: 131923
2011-05-23 21:40:23 +00:00
Akira Hatanaka 9dbb45b596 Fixes related to coding style.
llvm-svn: 131922
2011-05-23 21:13:59 +00:00
Dan Gohman 911fa9084c Document llvm.exp and llvm.pow.
llvm-svn: 131921
2011-05-23 21:13:03 +00:00
Alexis Hunt 1fb4e76218 Correctly propagate defaultedness across template instantiation. This
fixes PR9965, but we're not out of the water yet, as we do not
successfully handle out-of-line definitions, due to my utter
misunderstanding of how we manage templates.

llvm-svn: 131920
2011-05-23 21:07:59 +00:00
Dan Gohman 6c4a319088 When checking for signed multiplication overflow, watch out for INT_MIN and -1.
This fixes PR9845.

llvm-svn: 131919
2011-05-23 21:07:39 +00:00
Jim Grosbach bae9fee95f Propagate error correctly in the MC Asm parser for leading '$' expressions.
llvm-svn: 131918
2011-05-23 20:36:04 +00:00
Akira Hatanaka 90d96f44ce Fix MipsAsmPrinter::printSavedRegsBitmaskChange. Remove functions and variables
in MipsFunctionInfo that are no longer used.

llvm-svn: 131917
2011-05-23 20:34:30 +00:00
Chris Lattner d71ed9431a clarify this, apparently it is confusing :)
llvm-svn: 131916
2011-05-23 20:17:44 +00:00
Akira Hatanaka f9e5750fc8 Change StackDirection from StackGrowsUp to StackGrowsDown.
The following improvements are accomplished as a result of applying this patch:
- Fixed frame objects' offsets (relative to either the virtual frame pointer or
  the stack pointer) are set before instruction selection is completed. There is
  no need to wait until Prologue/Epilogue Insertion is run to set them.
- Calculation of final offsets of fixed frame objects is straightforward. It is
  no longer necessary to assign negative offsets to fixed objects for incoming
  arguments in order to distinguish them from the others.
- Since a fixed object has its relative offset set during instruction
  selection, there is no need to conservatively set its alignment to 4.
- It is no longer necessary to reorder non-fixed frame objects in 
  MipsFrameLowering::adjustMipsStackFrame.

llvm-svn: 131915
2011-05-23 20:16:59 +00:00
Greg Clayton cdbf866727 Calculate the dyld slide from all in memory info without having to use the
lldb module.

llvm-svn: 131914
2011-05-23 20:06:52 +00:00
Johnny Chen 54dc300653 Add more workarounds for "bl #..." and "blx #..." where the ARMAsmParser fails to parse/recognize
the (PC-relative) immediate operand.

llvm-svn: 131913
2011-05-23 19:41:31 +00:00
Manuel Klimek b66b5cef00 Fix examples compile break due to rewrite of isa.
llvm-svn: 131912
2011-05-23 18:25:41 +00:00
Greg Clayton 8d400e1750 Fixed an issue in the EmulateInstructionARM there the IT opcode was trying to
parse NOP instructions. I added the new table entries for the NOP for the
plain NOP, Yield, WFE, WFI, and SEV variants. Modified the opcode emulation
function EmulateInstructionARM::EmulateMOVRdSP(...) to notify us when it is
creating a frame. Also added an abtract way to detect the frame pointer 
register for both the standard ARM ABI and for Darwin.

Fixed GDBRemoteRegisterContext::WriteAllRegisterValues(...) to correctly be
able to individually write register values back if case the 'G' packet is
not implemented or returns an error.

Modified the StopInfoMachException to "trace" stop reasons. On ARM we currently
use the BVR/BCR register pairs to say "stop when the PC is not equal to the 
current PC value", and this results in a EXC_BREAKPOINT mach exception that
has 0x102 in the code.

Modified debugserver to create the short option string from long option
definitions to make sure it doesn't get out of date. The short option string
was missing many of the newer short option values due to a modification of
the long options defs, and not modifying the short option string.

llvm-svn: 131911
2011-05-23 18:04:09 +00:00
Johnny Chen feb961b86a Fix the Align() utility which tries to align the raw disassembly with the edis'ed disassembly
so that both the opcode and the operands are aligned with the rest of output.

Comment out the code related to force_raw mode when disassembling arm or thumb for now.
It testing goes ok, we will remove the section of code related to force_raw.

llvm-svn: 131910
2011-05-23 18:00:40 +00:00
Devang Patel 9987d3098b Test case for r131908.
llvm-svn: 131909
2011-05-23 17:49:29 +00:00
Devang Patel 7992883811 Preserve debug info during iSel by keeping DanglingDebugInfoMap live until end of function.
Patch by Micah Villmow

llvm-svn: 131908
2011-05-23 17:44:13 +00:00
Devang Patel c4d9a84159 While replacing all uses of a SDValue with another value, do not forget to transfer SDDbgValue.
llvm-svn: 131907
2011-05-23 17:35:08 +00:00
Devang Patel 0f6b46b826 Clear list of instructions without DebugLoc.
llvm-svn: 131906
2011-05-23 17:34:18 +00:00
Duncan Sands f0f143e31d The dragonegg option to disable LLVM optimizations changed.
llvm-svn: 131903
2011-05-23 16:50:29 +00:00
Charles Davis d9eafdcfd5 Implement .seh_stackalloc and .seh_pushframe parsing.
I haven't implemented any of the ones that take registers yet. The problem is
that for x86-64 the streamer methods expect a native x86 register number (note:
%r8-%r15 want 8-15 instead of 0-7; same for %xmm8-%xmm15). I haven't figured
out exactly how I want to do that yet.

llvm-svn: 131899
2011-05-23 16:43:09 +00:00
Tobias Grosser 4e3f9a4c5c CodeGeneration: Use FIXME instead of XXX
Cleanup suggested by ether.

llvm-svn: 131898
2011-05-23 15:23:36 +00:00
Chris Lattner 026f5e61f0 fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of
UnitTests/ObjC/messages-2.m with the recent optimizer improvements.

llvm-svn: 131897
2011-05-23 05:15:43 +00:00
Francois Pichet efb1af9ae8 Emulate a MSVC bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated.
Example:
class A { public: int f();  };
class B : public A { private: using A::f; };
class C : public B { private: using B::f; };

Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it.

This fixes 1 error when parsing MFC code with clang.

llvm-svn: 131896
2011-05-23 03:43:44 +00:00
Cameron Zwarich bc90690b24 Fix <rdar://problem/9476260> by having tail calls always generate 32-bit branches
in Darwin Thumb2 code. Tail calls are already disabled on Thumb1.

llvm-svn: 131894
2011-05-23 01:57:17 +00:00
Chris Lattner 388cb8a57c rearrange two transforms, since one subsumes the other. Make the shift-exactness
xform recurse.

llvm-svn: 131888
2011-05-23 00:32:19 +00:00
Chris Lattner 8aff4f8efc Transform any logical shift of a power of two into an exact/NUW shift when
in a known-non-zero context.

llvm-svn: 131887
2011-05-23 00:21:50 +00:00
Bill Wendling f5199debc0 Use a more efficient data structure for the "operand map". The number of
operands to an instruction aren't great, so an iterative search is fairly quick
and doesn't have the overhead of std::map.

llvm-svn: 131886
2011-05-23 00:18:33 +00:00
Chris Lattner 321c58fc41 use the valuetracking isPowerOfTwo function, which is more powerful than checking
for a constant directly.  Thanks to Duncan for pointing this out.

llvm-svn: 131885
2011-05-23 00:09:55 +00:00
Chris Lattner 83791ced7b Teach valuetracking that byval arguments with a specified alignment are
aligned.

Teach memcpyopt to not give up all hope when confonted with an underaligned
memcpy feeding an overaligned byval.  If the *source* of the memcpy can be
determined to be adequeately aligned, or if it can be forced to be, we can
eliminate the memcpy.

This addresses PR9794.  We now compile the example into:

define i32 @f(%struct.p* nocapture byval align 8 %q) nounwind ssp {
entry:
  %call = call i32 @g(%struct.p* byval align 8 %q) nounwind
  ret i32 %call
}

in both x86-64 and x86-32 mode.  We still don't get a tailcall though,
because tailcalls apparently can't handle byval.

llvm-svn: 131884
2011-05-23 00:03:39 +00:00
Chris Lattner 4d37d99798 add a helper method to get the byval alignment of an argument.
llvm-svn: 131883
2011-05-22 23:57:23 +00:00