Commit Graph

169 Commits

Author SHA1 Message Date
Daniel Dunbar
2928c83b01 Pass StringRef by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 10:58:06 +00:00
Chandler Carruth
8b67f774e9 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 01:35:46 +00:00
Chris Lattner
7c5b021793 add a twine version of MCContext::GetOrCreateSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:49:00 +00:00
Daniel Dunbar
a4d8667c87 MC: Set symbol values in MachO MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:58:23 +00:00
Daniel Dunbar
7eb85194f2 Minor formatting tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:58:15 +00:00
Daniel Dunbar
1253a6fa3b MC: Switch assembler API to using MCExpr instead of MCValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:58:03 +00:00
Daniel Dunbar
e00b011e6a MC: Remove unneeded context argument to MCExpr::Evaluate*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:57:52 +00:00
Daniel Dunbar
75773ff00d MC: Tweak variable assignment diagnostics, and make reassignment of non-absolute
variables and symbols invalid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:57:39 +00:00
Daniel Dunbar
fffff915d5 MC: When parsing a variable reference, substitute absolute variables immediately
since they are allowed to be redefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:34:54 +00:00
Daniel Dunbar
7c3600de94 MC: Move assembler variable values from MCContext to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:33:57 +00:00
Daniel Dunbar
e579849652 MC: Switch MCContext value table to storing MCExprs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:33:11 +00:00
Kevin Enderby
5440f6309d Fixed MCSectionMachO::ParseSectionSpecifier to allow an attribute of "none" so
that a symbol stub section with no attributes can be parsed as in:
.section __TEXT,__picsymbolstub4,symbol_stubs,none,16


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 20:57:20 +00:00
Edward O'Callaghan
aa5c1b7f93 No newline at end of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 18:43:19 +00:00
Chris Lattner
d9221d75f0 eliminate a use of strtoul.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:58:54 +00:00
Anton Korobeynikov
c6f729ed55 Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430.
This unbreaks PR4776.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 16:57:42 +00:00
Chris Lattner
8c6ed05157 Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.

To replace their functionality, add a new 
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.

The default implementation just returns the symbol.  The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub.  The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.

DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another 
horrible hack from DwarfException.cpp:

-    if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
-      O << "-" << MAI->getPCSymbol();



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:46:41 +00:00
Chris Lattner
4f3e7aa154 add a helper method for creating MCSymbol and MCSymbolRefExpr at
the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:26:31 +00:00
Chris Lattner
bfd1e50c4f remove some horrible MAI hooks which fortunately turn out to be always empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 23:11:32 +00:00
Daniel Dunbar
3228484b5f Update CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 05:22:47 +00:00
Chris Lattner
90edac0e8b Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.

llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 03:02:37 +00:00
Chris Lattner
65b0b297db add a new MCInstPrinter class, move the (trivial) MCDisassmbler ctor inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:43:38 +00:00
Chris Lattner
1b6570e527 'printMCInst' doesn't print newlines after instructions anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 22:24:34 +00:00
Chris Lattner
7c30191393 remove MAI::JumpTableSpecialLabelPrefix now that MAI
has real information about linker private linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 19:02:16 +00:00
Chris Lattner
4afcedfad1 fix MCSymbol printing on darwin to exactly match the mangler (handling of \n and " in a symbol name).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:11:09 +00:00
Chris Lattner
e19f978323 Make the MC symbol printer and llvm::Mangler exactly agree on mangling
for systems that don't support quoting (PR4966).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:04:46 +00:00
Chris Lattner
b6a2fc080f eliminate the "MBBLabel" MCOperand type, and just use a MCSymbol for
MBB labels like everything else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 20:45:03 +00:00
Ted Kremenek
4dbd074145 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 21:49:45 +00:00
Chris Lattner
2a1744f553 canonicalize namespace gymnastics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:46:42 +00:00
Sean Callanan
251ef612a8 Added an abstract superclass, MCDisassembler, for
all disassemblers.

Modified the MemoryObject to support 64-bit address
spaces, regardless of the LLVM process's address
width.

Modified the Target class to allow extraction of a
MCDisassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 22:49:13 +00:00
Chris Lattner
a8bb2490ae allow @ in symbol names without quoting the identifier. This
allows things like @PLT without quotes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 00:14:09 +00:00
Chris Lattner
d50c2b9064 parenthesize symbol names that start with $, fixing X86/dollar-name.ll with
the new asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 23:20:50 +00:00
Chris Lattner
d19ceb9b12 Print "X-42" instead of "X+-42".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:37:35 +00:00
Chris Lattner
be73e8c4e7 make formatting of expressions more closely match the existing asmprinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:34:07 +00:00
Chris Lattner
8b4ada248a tidy whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:27:48 +00:00
Chris Lattner
aadb35f809 fix MCSymbol printing to exactly match the normal mangler rules so
we can diff .s files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:57:47 +00:00
Chris Lattner
684c593d05 Thread an MCAsmInfo pointer through the various MC printing APIs,
and fix a few things using << on MCSymbols to use ->print(). No
functionality change other than unbreaking my previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:46:51 +00:00
Chris Lattner
d87eb6454d inline insertion operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:33:01 +00:00
Chris Lattner
579531c61b output alignment value in hex so that we get:
.align 3, 0x90
instead of,
  .align 3, 144

suggested by eric.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:01:10 +00:00
Daniel Dunbar
efbb5330b8 llvm-mc: Store MCSymbolData value as a pointer (to make MSVC happy).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:09:03 +00:00
Daniel Dunbar
821e3334ed llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:09:28 +00:00
Daniel Dunbar
e2ace509fc llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:09:09 +00:00
Daniel Dunbar
8c2eebe407 llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:08:38 +00:00
Daniel Dunbar
cb579b3338 llvm-mc: Make MCSymbolData symbol member const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:08:06 +00:00
Daniel Dunbar
a03a368acc llvm-mc: Add MCContext to MCAssembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:55 +00:00
Daniel Dunbar
87392fde1f llvm-mc: Add MCExpr::{dump,print}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:33 +00:00
Daniel Dunbar
9643ac5514 llvm-mc: Switch MCExpr construction to using static member functions, and taking the MCContext (which now owns all MCExprs).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:22 +00:00
Daniel Dunbar
28c251b54b llvm-mc: Move AsmExpr into MC lib (as MCExpr).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:06:59 +00:00
Daniel Dunbar
7092c7e1dc llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:17:16 +00:00
Daniel Dunbar
8c3eaf46a1 llvm-mc: .lsym is more unsupported than unimplemented, pending a use case appearing.
Also, all one of the file level flags are implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 07:08:47 +00:00
Daniel Dunbar
8f4d146c34 llvm-mc: Support .comm emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 07:08:35 +00:00