Michael J. Spencer
b0d61540cb
Change relocation API to be per section.
...
llvm-svn: 141376
2011-10-07 18:15:25 +00:00
Benjamin Kramer
8a529dc10a
llvm-objdump: Detach symbol listing from section enumeration for mach-o.
...
This reduces memory usage as we don't add the same symbol multiple times anymore.
llvm-svn: 140278
2011-09-21 22:16:43 +00:00
Benjamin Kramer
37a7151b1f
llvm-objdump: Take the data from the right object when there's no dSYM around.
...
llvm-svn: 140269
2011-09-21 18:18:53 +00:00
Benjamin Kramer
9eaefa9786
llvm-objdump: Fix use after free.
...
llvm-svn: 140237
2011-09-21 04:01:19 +00:00
Benjamin Kramer
699128e58a
llvm-objdump: Output line info next to the disassembly if available.
...
MachO-only at the moment, sorry.
Usage:
$ llvm-objdump -d -m -g -dsym=a.out.dSYM/Contents/Resources/DWARF/a.out a.out
_main:
100000e90: 55 pushq %rbp ## test.c:11:3
…
llvm-svn: 140224
2011-09-21 01:13:19 +00:00
Benjamin Kramer
2ad2eb527b
llvm-objdump: factor code better, add comments.
...
llvm-svn: 140153
2011-09-20 17:53:01 +00:00
Benjamin Kramer
444f079d34
Nope, there's another one!
...
llvm-svn: 140045
2011-09-19 20:23:01 +00:00
Benjamin Kramer
babc5291f4
Missed one instance of implicit pointer conversion.
...
llvm-svn: 140044
2011-09-19 20:14:46 +00:00
Benjamin Kramer
78ee973788
Try to make MSVC 2010 happy.
...
llvm-svn: 140042
2011-09-19 20:08:52 +00:00
Benjamin Kramer
43a772eda1
Add a MachO-specific "mode" to llvm-objdump, that, if enabled, gathers additional information that are only available on MachO.
...
- It can take FunctionStarts from a binary to find entry points more accurately.
- Symbol offsets in executables are correct now.
llvm-svn: 140028
2011-09-19 17:56:04 +00:00
Owen Anderson
a0c3b97221
Don't attach annotations to MCInst's. Instead, have the disassembler return, and the printer accept, an annotation string which can be passed through if the client cares about annotations.
...
llvm-svn: 139876
2011-09-15 23:38:46 +00:00
Benjamin Kramer
75d1cf3391
Object: make the following changes into SymbolRef
...
- Add enum SymbolType and function getSymbolType()
- Add function isGlobal() - it's returns true for symbols that can be used in another objects, such as library functions.
- Rename function getAddress() to getOffset() and add new function getAddress(), because currently getAddress() returns section offset of symbol first byte. new getAddress() return symbol address.
- Change usage SymbolRef::getAddress() to getOffset() in tools/llvm-nm and tools/llvm-objdump.
Patch by Danil Malyshev!
llvm-svn: 139683
2011-09-14 01:22:52 +00:00
James Molloy
4c493e8050
Refactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= handling to llvm-mc. Reviewed by Owen Anderson.
...
llvm-svn: 139237
2011-09-07 17:24:38 +00:00
Evan Cheng
2bb4035707
Move TargetRegistry and TargetSelect from Target to Support where they belong.
...
These are strictly utilities for registering targets and components.
llvm-svn: 138450
2011-08-24 18:08:43 +00:00
Evan Cheng
4d6c9d711d
Some refactoring so TargetRegistry.h no longer has to include any files
...
from MC.
llvm-svn: 138367
2011-08-23 20:15:21 +00:00
Benjamin Kramer
c22d50e5c3
Add MCInstrAnalysis class. This allows the targets to specify own versions of MCInstrDescs functions.
...
- Add overrides for ARM.
- Teach llvm-objdump to use this instead of plain MCInstrDesc.
llvm-svn: 137059
2011-08-08 18:56:44 +00:00
Benjamin Kramer
4c0423bc8f
llvm-objdump: disassembly enhancements
...
- Indent simple loops
- Print unreachable blocks as .byte directives
llvm-svn: 137058
2011-08-08 18:41:34 +00:00
Benjamin Kramer
5d173c0dab
llvm-objdump: Use help of CFG to print assembly when --cfg is passed.
...
This way we can avoid printing unreachable code (data).
llvm-svn: 137057
2011-08-08 18:32:12 +00:00
Benjamin Kramer
9ea35e470c
I will save before I commit.
...
I will save before I commit.
I will save before I commit.
I will save before I commit.
llvm-svn: 136007
2011-07-25 23:10:23 +00:00
Benjamin Kramer
bf11531492
llvm-objdump: Ignore unreachable blocks when printing the CFG.
...
llvm-svn: 136000
2011-07-25 23:04:36 +00:00
Evan Cheng
61faa55b74
Separate MCInstPrinter registration from AsmPrinter registration.
...
llvm-svn: 135974
2011-07-25 21:20:24 +00:00
Evan Cheng
f60768a14e
Fix last bits of MC layer issues. llvm-mc doesn't need to initialize TargetMachine's anymore.
...
llvm-svn: 135963
2011-07-25 20:53:02 +00:00
Evan Cheng
8c886a40d2
Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
...
InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC.
llvm-svn: 135812
2011-07-22 21:58:54 +00:00
Benjamin Kramer
39e05ac3d7
llvm-objdump: Don't ignore errors from raw_fd_ostream.
...
llvm-svn: 135787
2011-07-22 18:35:11 +00:00
Benjamin Kramer
cb2d7bee35
llvm-objdump: Skip branches that leave the current function.
...
In "normal" code these only happen when disassembling data, so we
won't lose anything if we just drop them.
llvm-svn: 135786
2011-07-22 18:35:09 +00:00
Chandler Carruth
2d71c421f9
Move the registered target printing in version strings completely out of
...
the Support library. Now its part of the TargetRegistry, and the three
commands that care about this explicitly register this extra bit of
version information.
The set of commands which care was computed by intersecting those which
use the Support library's version string printing and those that
initialize all the registered targets in a way that produces
a meaningful list. The only odd ball out is that 'clang -cc1as -version'
no longer prints the registered targets. I don't think anyone is really
interested in that (especially as the fact that llvm-mc does so is under
a FIXME), but if someone really does want this back I'll happily apply
the same patch there.
llvm-svn: 135757
2011-07-22 07:50:48 +00:00
Francois Pichet
7f023ae4bb
Unbreak the MSVC build. Since the "next" function already exists in the MSVC headers, we need the explicit llvm:: qualifier to prevent a conflict.
...
llvm-svn: 135623
2011-07-20 21:35:29 +00:00
Benjamin Kramer
82f64488ec
Fix cmake.
...
llvm-svn: 135609
2011-07-20 19:43:38 +00:00
Benjamin Kramer
87ee76ca73
Sketch out an CFG reconstruction mode for llvm-objdump.
...
- Not great yet, but it's a start.
- Requires an object file with a symbol table. (I really want to fix this, but it'll need a whole new algorithm)
- ELF and COFF won't work at the moment due to libObject shortcomings.
To try it out run
$ llvm-objdump -d --cfg foo.o
This will create a graphviz file for every symbol in the object file's text section containing a CFG.
llvm-svn: 135608
2011-07-20 19:37:35 +00:00
Benjamin Kramer
46d9cd5f72
Fix off-by-one.
...
llvm-svn: 135533
2011-07-19 22:59:25 +00:00
Evan Cheng
2129f59637
Introduce MCCodeGenInfo, which keeps information that can affect codegen
...
(including compilation, assembly). Move relocation model Reloc::Model from
TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine.
llvm-svn: 135468
2011-07-19 06:37:02 +00:00
Benjamin Kramer
e0dda9c1c8
Teach llvm-objdump to disassemble sections symbol by symbol.
...
llvm-svn: 135289
2011-07-15 18:39:24 +00:00
Evan Cheng
1705ab00ab
Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes.
...
llvm-svn: 135219
2011-07-14 23:50:31 +00:00
Eli Friedman
402339b875
Remove some unnecessary includes.
...
llvm-svn: 134528
2011-07-06 20:48:27 +00:00
Evan Cheng
ab37af9af3
createMCInstPrinter doesn't need TargetMachine anymore.
...
llvm-svn: 134525
2011-07-06 19:45:42 +00:00
Evan Cheng
fe6e405e8c
Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name to
...
be the first encoded as the first feature. It then uses the CPU name to look up
features / scheduling itineray even though clients know full well the CPU name
being used to query these properties.
The fix is to just have the clients explictly pass the CPU name!
llvm-svn: 134127
2011-06-30 01:53:36 +00:00
Michael J. Spencer
1d6167fd30
Object: Add proper error handling.
...
llvm-svn: 133872
2011-06-25 17:55:23 +00:00
Jay Foad
1a180156b6
Remove unused STL header includes.
...
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Bill Wendling
00f0cddfd4
We need to pass the TargetMachine object to the InstPrinter if we are printing
...
the alias of an InstAlias instead of the thing being aliased. Because we need to
know the features that are valid for an InstAlias.
This is part of a work-in-progress.
llvm-svn: 127986
2011-03-21 04:13:46 +00:00
Michael J. Spencer
c6bc900893
llvm-objdump: Remove redundant includes.
...
llvm-svn: 123902
2011-01-20 07:22:13 +00:00
Michael J. Spencer
05350e6d7c
llvm-nm: Fix warning.
...
llvm-svn: 123901
2011-01-20 07:22:04 +00:00
Michael J. Spencer
2670c2528c
Add llvm-objdump
...
llvm-svn: 123898
2011-01-20 06:39:06 +00:00