Commit Graph

104440 Commits

Author SHA1 Message Date
Eric Christopher 22a19816f6 Make the file format strings a little prettier for mach-o.
llvm-svn: 129980
2011-04-22 04:08:58 +00:00
Bob Wilson bf0cd6b83d Add a testcase for svn r129964 (Neon load/store intrinsic alignments).
llvm-svn: 129979
2011-04-22 04:06:49 +00:00
Eric Christopher 1dd335de65 Add MachOObjectFile.cpp to cmake.
llvm-svn: 129978
2011-04-22 04:06:24 +00:00
Greg Clayton 385aa28cf6 Did some work on the "register read" command to only show the first register
set by default when dumping registers. If you want to see all of the register
sets you can use the "--all" option:

(lldb) register read --all

If you want to just see some register sets, you can currently specify them
by index:

(lldb) register read --set 0 --set 2

We need to get shorter register set names soon so we can specify the register
sets by name without having to type too much. I will make this change soon.

You can also have any integer encoded registers resolve the address values
back to any code or data from the object files using the "--lookup" option.
Below is sample output when stopped in the libc function "puts" with some
const strings in registers:

Process 8973 stopped
* thread #1: tid = 0x2c03, 0x00007fff828fa30f libSystem.B.dylib`puts + 1, stop reason = instruction step into
  frame #0: 0x00007fff828fa30f libSystem.B.dylib`puts + 1
(lldb) register read --lookup 
General Purpose Registers:
  rax          = 0x0000000100000e98  "----------------------------------------------------------------------"
  rbx          = 0x0000000000000000
  rcx          = 0x0000000000000001  
  rdx          = 0x0000000000000000
  rdi          = 0x0000000100000e98  "----------------------------------------------------------------------"
  rsi          = 0x0000000100800000
  rbp          = 0x00007fff5fbff710
  rsp          = 0x00007fff5fbff280
  r8           = 0x0000000000000040  
  r9           = 0x0000000000000000
  r10          = 0x0000000000000000
  r11          = 0x0000000000000246  
  r12          = 0x0000000000000000
  r13          = 0x0000000000000000
  r14          = 0x0000000000000000
  r15          = 0x0000000000000000
  rip          = 0x00007fff828fa30f  libSystem.B.dylib`puts + 1
  rflags       = 0x0000000000000246  
  cs           = 0x0000000000000027  
  fs           = 0x0000000000000000
  gs           = 0x0000000000000000

As we can see, we see two constant strings and the PC (register "rip") is 
showing the code it resolves to.

I fixed the register "--format" option to work as expected.

Added a setting to disable skipping the function prologue when setting 
breakpoints as a target settings variable:

(lldb) settings set target.skip-prologue false

Updated the user settings controller boolean value handler funciton to be able
to take the default value so it can correctly respond to the eVarSetOperationClear
operation.

Did some usability work on the OptionValue classes.

Fixed the "image lookup" command to correctly respond to the "--verbose" 
option and display the detailed symbol context information when looking up
line table entries and functions by name. This previously was only working
for address lookups.

llvm-svn: 129977
2011-04-22 03:55:06 +00:00
Eric Christopher bafb9347dd Hook in mach-o object files into Object interface.
llvm-svn: 129976
2011-04-22 03:50:50 +00:00
Eric Christopher 3509d2dc95 Add support for 64-bit object files to Path.
llvm-svn: 129975
2011-04-22 03:50:19 +00:00
Eric Christopher 7b015c7598 Add an ObjectFile implementation for mach-o.
Patch by Patrick Walton!

llvm-svn: 129974
2011-04-22 03:19:48 +00:00
Eric Christopher 5c896f71ec 80-col fix.
llvm-svn: 129973
2011-04-22 03:07:06 +00:00
NAKAMURA Takumi 6e43e6fad0 include/llvm/Target/TargetAsmInfo.h: Fix a warning.
llvm-svn: 129972
2011-04-22 01:56:59 +00:00
Evan Cheng c0d2004e3c In Thumb2 mode, lower frame indix references to:
add <rd>, sp, #<imm8>
ldr <rd>, [sp, #<imm8>]
When the offset from sp is multiple of 4 and in range of 0-1020.
This saves code size by utilizing 16-bit instructions.

rdar://9321541

llvm-svn: 129971
2011-04-22 01:42:52 +00:00
Evan Cheng 8ea3af47bd Typo
llvm-svn: 129970
2011-04-22 01:40:20 +00:00
Chandler Carruth bab81b9797 Delete the other unused variable in this function. Sorry I missed this
the first time through.

llvm-svn: 129969
2011-04-22 01:29:18 +00:00
Chandler Carruth ea41470726 Remove an unused variable from a function. This is a likely cut-paste-o.
Silences GCC warning.

I wonder why Clang doesn't warn on this...

llvm-svn: 129968
2011-04-22 01:21:06 +00:00
Argyrios Kyrtzidis 98feafed27 Fix crashing rdar://9122854 & http://llvm.org/PR9461.
llvm-svn: 129967
2011-04-22 01:18:40 +00:00
Bill Wendling c14d7322ee Branch folding is folding a landing pad into a regular BB.
An exception is thrown via a call to _cxa_throw, which we don't expect to
return. Therefore, the "true" part of the invoke goes to a BB that has
'unreachable' as its only instruction. This is lowered into an empty MachineBB.
The landing pad for this invoke, however, is directly after the "true" MBB.
When the empty MBB is removed, the landing pad is directly below the BB with the
invoke call. The unconditional branch is removed and then the two blocks are
merged together.

The testcase is too big for a regression test.
<rdar://problem/9305728>

llvm-svn: 129965
2011-04-22 01:07:09 +00:00
Bob Wilson 23c28ee17e Define Neon load/store intrinsics for Clang as macros instead of functions.
This is needed so the front-end can see "aligned" attributes on the type
for the pointer arguments.  Radar 9311427.

llvm-svn: 129964
2011-04-22 00:37:01 +00:00
Johnny Chen d545d9cbbc Make the test case more robust by installing a teardown hook to kill the inferior
rather than calling "process kill" explicitly at the end of the test.

The test might not even reach the end because it could have failed prematurely.

llvm-svn: 129963
2011-04-22 00:33:09 +00:00
Johnny Chen 13af1b55cd Conditionalize the self.expect("dis -f", ...) test scenario to check on Intel disassembly
only when the test is currently running against the relevant architecture.

llvm-svn: 129960
2011-04-22 00:13:28 +00:00
Rafael Espindola 5395f44fe8 Compute the size of the FDE encoding instead of hard coding it. Update
X8664_ELFTargetObjectFile::getFDEEncoding to match reality.

llvm-svn: 129959
2011-04-22 00:08:43 +00:00
Nick Lewycky 207bce31e1 Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both.

This does not yet add the profile_rt library to the link step if -fprofile-arcs
is enabled when linking.

llvm-svn: 129956
2011-04-21 23:44:07 +00:00
Rafael Espindola 6aea59268a Remove unused argument.
llvm-svn: 129955
2011-04-21 23:39:26 +00:00
Nick Lewycky ab18d3088a Fix indentation. No functional change.
llvm-svn: 129954
2011-04-21 23:37:32 +00:00
Rafael Espindola ea61f22dd3 Don't pass address spaces to EmitULEB128IntValue.
llvm-svn: 129953
2011-04-21 23:26:40 +00:00
Devang Patel 94ad6ac13c Fix DWARF description of Q registers.
llvm-svn: 129952
2011-04-21 23:22:35 +00:00
Argyrios Kyrtzidis b77d6f0fd1 Don't hide #warnings in a system header, same as gcc. Fixes rdar://8495837.
llvm-svn: 129951
2011-04-21 23:08:23 +00:00
Argyrios Kyrtzidis 8a8b8773b6 Move the check whether a diagnostic must be ignored because it is in a system header
inside DiagnosticIDs::getDiagnosticLevel.

llvm-svn: 129950
2011-04-21 23:08:18 +00:00
Johnny Chen 9ee96e7b40 Add a HideStdout() method to our TestBase class and call it from TestAbbreviations.py
and TestAliases.py.  Pass the keyword argument 'check=False' to:

    self.runCmd("script my.date()", check=False)

since we want to restore sys.stdout no matter what the outcome of the runCmd is.

llvm-svn: 129949
2011-04-21 22:50:23 +00:00
Richard Smith d4257d847e Fix gcc warning. Add parens to this assert, incidentally reassociating it, but the condition is the same either way.
llvm-svn: 129948
2011-04-21 22:48:40 +00:00
Devang Patel 3712c14be9 Fix DWARF description of S registers.
llvm-svn: 129947
2011-04-21 22:48:26 +00:00
Devang Patel 6d1e4e9646 Add DW_OP_bit_piece.
llvm-svn: 129945
2011-04-21 22:26:13 +00:00
Eric Christopher fca8b75b71 Make sure we include __sync_synchronize on arm platforms if we need it.
llvm-svn: 129944
2011-04-21 22:05:05 +00:00
Richard Trieu 2c850c0980 Add a fixit suggest for missing case keywords inside a switch scope. For instance, in the following code, 'case ' will be suggested before the '1:'
switch (x) {
  1: return 0;
  default: return 1;
}

llvm-svn: 129943
2011-04-21 21:44:26 +00:00
Greg Clayton 2048ea5eba Fixed a case where if a function, inlined function, or global with a mangled
name had a DW_AT_name that was the same string as the DW_AT_MIPS_linkage_name,
then it would get added twice to the DWARF index.

llvm-svn: 129942
2011-04-21 21:41:13 +00:00
Nick Lewycky ed7504e65c Alphabetize this one flag, just to pull it out of my patch.
llvm-svn: 129941
2011-04-21 21:32:34 +00:00
Daniel Dunbar bbd482226e Driver/Darwin: Allow OS X deployment targets like 10.4.11, even though they
can't be represented in the environment define.

llvm-svn: 129939
2011-04-21 21:27:33 +00:00
Devang Patel 2266aa84a1 Refactor.
llvm-svn: 129938
2011-04-21 21:07:35 +00:00
Johnny Chen 72c40825dd Hopefully fix the last fallout of 'commands' to 'command' change.
llvm-svn: 129937
2011-04-21 20:55:57 +00:00
Johnny Chen 71aaf75e3d Use self.TraceOn() API.
llvm-svn: 129936
2011-04-21 20:48:32 +00:00
Johnny Chen ea80ba8b97 Use self.TraceOn() API to decide whether to print debug output.
llvm-svn: 129935
2011-04-21 20:27:45 +00:00
Devang Patel be22131c28 Test case for r129922
llvm-svn: 129934
2011-04-21 20:16:43 +00:00
Argyrios Kyrtzidis 446bcf2d4a Use the ArrayFiller to fill out "holes" in the array initializer due to designated initializers,
avoiding to create separate Exprs for each one.

llvm-svn: 129933
2011-04-21 20:03:38 +00:00
Jay Foad 5514afe6b2 PR9214: Convert Metadata API to use ArrayRef.
llvm-svn: 129932
2011-04-21 19:59:31 +00:00
Jay Foad ea324f154b PR9214: Convert Metadata API to use ArrayRef.
llvm-svn: 129929
2011-04-21 19:59:12 +00:00
Matt Beaumont-Gay 70597d4e50 Don't recycle loop variables.
llvm-svn: 129928
2011-04-21 19:46:23 +00:00
Greg Clayton 020b717f6a More iteration on the new option value stuff. We now define an
OptionValueCollection class that can be subclassed to provide access to 
internal settings that are stored as ObjectValue subclasses.

llvm-svn: 129926
2011-04-21 19:21:29 +00:00
Jakob Stoklund Olesen 6a663b8dc8 Allow allocatable ranges from global live range splitting to be split again.
These intervals are allocatable immediately after splitting, but they may be
evicted because of later splitting. This is rare, but when it happens they
should be split again.

The remainder intervals that cannot be allocated after splitting still move
directly to spilling.

SplitEditor::finish can optionally provide a mapping from new live intervals
back to the original interval indexes returned by openIntv().

Each original interval index can map to multiple new intervals after connected
components have been separated. Dead code elimination may also add existing
intervals to the list.

The reverse mapping allows the SplitEditor client to treat the new intervals
differently depending on the split region they came from.

llvm-svn: 129925
2011-04-21 18:38:15 +00:00
Manuel Klimek d861e8b7be Adds a function to run FrontendActions over in-memory code. This is
the first step towards a standalone Clang tool infrastructure.
The plan is to make it easy to build command line tools that run over
the AST of source files in a project outside of the build system.

llvm-svn: 129924
2011-04-21 18:37:41 +00:00
Rafael Espindola c3dc486752 Fix relative relocations. This is sufficient for running the rust testsuite with
MC :-)

llvm-svn: 129923
2011-04-21 18:36:50 +00:00
Devang Patel 46bda61a81 As per ARM docs, register Dx is described as DW_OP_regx(256+x) in DWARF.
llvm-svn: 129922
2011-04-21 17:51:06 +00:00
Devang Patel 28f2719d83 Add comment in output stream.
llvm-svn: 129921
2011-04-21 17:50:24 +00:00