Commit Graph

237 Commits

Author SHA1 Message Date
Dan Gohman
d5826a33a5 Use the new tool_output_file in several tools. This fixes a variety
of problems with output files being left behind or output streams
being left unclosed. Fix llvm-mc to respect the -o option in all
modes, rather than hardcoding outs() in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111603 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 01:07:01 +00:00
Daniel Dunbar
3c14ca47fc llvm-mc: Add -show-inst-operands, for dumping the parsed instruction representation before matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 06:37:09 +00:00
Benjamin Kramer
1abcd06856 Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:48:06 +00:00
Chris Lattner
847da55716 start straightening out libedis's dependencies and make it fit
better in the llvm world.  Among other things, this changes:

1. The guts of libedis are now moved into lib/MC/MCDisassembler
2. llvm-mc now depends on lib/MC/MCDisassembler, not tools/edis,
   so edis and mc don't have to be built in series.
3. lib/MC/MCDisassembler no longer depends on the C api, the C
   API depends on it.
4. Various code cleanup changes. 

There is still a lot to be done to make edis fit with the llvm
design, but this is an incremental step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 18:25:19 +00:00
Daniel Dunbar
d73ada7d24 Target: Give the TargetAsmParser access to the TargetMachine.
- Unfortunate, but necessary for now to handle subtarget instruction matching. Eventually we should factor out the lower level target machine information so we don't need to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 00:33:49 +00:00
Daniel Dunbar
9fbb37e10d MC: Move several clients to using AsmParser constructor function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:31:33 +00:00
Daniel Dunbar
346cc61cd2 llvm-mc: Fix llvm-mc -as-lex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108644 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:31:28 +00:00
Daniel Dunbar
9186fa6b0c MC: Pass the target instance to the AsmParser constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 20:41:56 +00:00
Daniel Dunbar
9a56c328b1 llvm-mc: Don't set NO_INSTALL on llvm-mc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 22:00:08 +00:00
Dan Gohman
26a7074939 Avoid calling outs() and fouts() when the stream isn't really needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 19:47:36 +00:00
Daniel Dunbar
fdb5a86179 MC: Add an MCLoggingStreamer, for use in debugging integrated-as mismatches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 17:44:06 +00:00
Matt Fleming
d8a33ddcfe Currently, createMachOStreamer() is invoked directly in llvm-mc which
isn't ideal if we want to be able to use another object file format.

Add a createObjectStreamer() factory method so that the correct object
file streamer can be instantiated for a given target triple.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104318 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21 12:54:43 +00:00
Daniel Dunbar
596490682a Remove dead option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21 00:27:55 +00:00
Sean Callanan
972bf8dea1 Extended the edis "IsBranch" property to call
instructions as well.  Added support for checking
this to the llvm-mc tester as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 01:27:08 +00:00
Sean Callanan
be192dd1e9 Fixed a sign-extension bug in the X86 disassembler
that was causing PC-relative branch targets to be
evaluated incorrectly.  Also added support for
checking operand values to the llvm-mc tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 22:47:27 +00:00
Ted Kremenek
0a6f053732 Add CMake support for 'edis'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:52:50 +00:00
Chris Lattner
f23c769294 Make the disassembler respect the assembler dialect when printing instructions,
patch by Marius Wachtler!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 18:41:17 +00:00
Sean Callanan
668b15467b Second try at integrating the edis tester. This
time I use the LIBS variable, which is not subject
to a %.a -> -l% transformation, to link llvm-mc
against libEnhancedDisassembly.

llvm-mc -edis works the same as llvm-mc
-disassemble, but outputs tokens and operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 19:43:00 +00:00
Chris Lattner
cfc99a99bd revert r100842 which broke several of the build bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 04:24:20 +00:00
Sean Callanan
8c0a1608d5 Added a tester for the enhanced disassembler,
integrated into the llvm-mc testing tool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 01:43:16 +00:00
Chris Lattner
519466c32f tidy #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:07:18 +00:00
Chris Lattner
d374087be5 fix an ugly wart in the MCInstPrinter api where the
raw_ostream to print an instruction to had to be specified
at MCInstPrinter construction time instead of being able
to pick at each call to printInstruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:04:31 +00:00
Chris Lattner
4d12fdc2d9 remove some extraneous casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:03:50 +00:00
Daniel Dunbar
ac2884a717 llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 22:49:09 +00:00
Daniel Dunbar
2d9f5d1d7f llvm-mc: Support -filetype=null, for timing purposes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 23:47:12 +00:00
Daniel Dunbar
c6ab1901f9 llvm-mc: Fix MCInstPrinter memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:35 +00:00
Daniel Dunbar
d40297ce49 llvm-mc: Fix memory leak of MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:25 +00:00
Daniel Dunbar
4d4358e8b0 llvm-mc: Fix target selection for --disassemble to use GetTarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 18:07:50 +00:00
Chris Lattner
4c42a6de9f fix an MCInstPrinter leak that jyasskin pointed out:
createAsmStreamer now takes ownership of the instprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:48:53 +00:00
Daniel Dunbar
4ca906560a llvm-mc: Delete output files on error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 19:31:47 +00:00
Daniel Dunbar
5e6a7a248b llvm-mc: Support -n, useful for comparing -integrated-as output since the
compiler may not lead with the text section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:20:57 +00:00
Daniel Dunbar
181ab6a854 llvm-mc: Support -arch as a simplified form of -triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:20:38 +00:00
Chris Lattner
fdab14b105 remove MAI argument from createAsmStreamer since it
can get it from the context now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:28:53 +00:00
Chris Lattner
c18409aed8 change MCContext to always have an MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 22:53:35 +00:00
Daniel Dunbar
1f3e445184 MC: Provide MCAssembler with a TargetAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:27 +00:00
Chris Lattner
86020e4628 give MCCodeEmitters access to the current MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:12:47 +00:00
Daniel Dunbar
5532cf44a0 llvm-mc: Remove --show-fixups and always show as part of --show-encoding.
Also, fix a silly memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 01:41:14 +00:00
Daniel Dunbar
6b71653c82 llvm-mc: Add --show-fixups option, for displaying the instruction fixup information in the asm comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 23:00:14 +00:00
Daniel Dunbar
9dee8e3009 llvm-mc: Add --show-inst option, for showing the MCInst inline with the assembly
output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 18:18:30 +00:00
Sean Callanan
2e235a826d Fixed the disassembler so it accepts multiple
instructions on a single line.  Also made it a
bit more forgiving when it reports errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 03:46:41 +00:00
Chris Lattner
43b5f9312d make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:43:08 +00:00
Chris Lattner
07404415ab pass "-fasm-verbose" into createAsmStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 07:06:15 +00:00
Chris Lattner
e73a31f667 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 06:49:46 +00:00
Chris Lattner
be343b3ca3 move some files out of the llvm-mc tool into the MCParser library so
other tools can link it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 01:58:08 +00:00
Chris Lattner
c6ef277a0b create a new MCParser library and move some stuff into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 01:44:57 +00:00
Chris Lattner
03949c9db3 remove some confused code that used strtoull
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 01:17:12 +00:00
Sean Callanan
fd0b0288e2 Moved handling of inclusion from the AsmLexer to
the AsmParser, breaking AsmLexer's dependence on
SourceMgr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 00:19:58 +00:00
Sean Callanan
bf2013ee22 Changed the AsmParser to handle error messages itself
rather than passing them off to the AsmLexer to handle.
This means the AsmLexer no longer requires a SourceMgr
to do error handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 23:19:55 +00:00
Sean Callanan
10d33a4937 Promoted the reference to the SourceMgr from AsmLexer
into AsmParser, in preparation for making AsmLexer
independent of the SourceMgr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:45:23 +00:00
Sean Callanan
79036e421f Modified MCAsmLexer to return error information upward
rather than printing it locally, reducing its dependence
on SourceMgr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:18:24 +00:00