llvm-6502/include/llvm/MC
Reed Kotler 2c3a4641a7 This patch is needed to make c++ exceptions work for mips16.
Mips16 is really a processor decoding mode (ala thumb 1) and in the same
program, mips16 and mips32 functions can exist and can call each other.

If a jal type instruction encounters an address with the lower bit set, then
the processor switches to mips16 mode (if it is not already in it). If the
lower bit is not set, then it switches to mips32 mode.

The linker knows which functions are mips16 and which are mips32.
When relocation is performed on code labels, this lower order bit is
set if the code label is a mips16 code label.

In general this works just fine, however when creating exception handling
tables and dwarf, there are cases where you don't want this lower order
bit added in.

This has been traditionally distinguished in gas assembly source by using a
different syntax for the label.

lab1:      ; this will cause the lower order bit to be added
lab2=.     ; this will not cause the lower order bit to be added

In some cases, it does not matter because in dwarf and debug tables
the difference of two labels is used and in that case the lower order
bits subtract each other out.

To fix this, I have added to mcstreamer the notion of a debuglabel.
The default is for label and debug label to be the same. So calling
EmitLabel and EmitDebugLabel produce the same result.

For various reasons, there is only one set of labels that needs to be
modified for the mips exceptions to work. These are the "$eh_func_beginXXX" 
labels.

Mips overrides the debug label suffix from ":" to "=." .

This initial patch fixes exceptions. More changes most likely
will be needed to DwarfCFException to make all of this work
for actual debugging. These changes will be to emit debug labels in some
places where a simple label is emitted now.

Some historical discussion on this from gcc can be found at:
http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html
http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170279 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-16 04:00:45 +00:00
..
MCParser Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
EDInstInfo.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MachineLocation.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCAsmBackend.h Add more reset methods to make all objects that the backend may use for outputting code have a reset, some are not used but were declared for completeness 2012-12-14 18:52:11 +00:00
MCAsmInfo.h This patch is needed to make c++ exceptions work for mips16. 2012-12-16 04:00:45 +00:00
MCAsmInfoCOFF.h
MCAsmInfoDarwin.h
MCAsmLayout.h Make naming consistent, add comments and sanity asserts 2012-12-12 19:54:05 +00:00
MCAssembler.h Make the MCStreamer have a reset method and call that after finalization of the asm printer, 2012-12-12 22:59:46 +00:00
MCAtom.h
MCCodeEmitter.h Add more reset methods to make all objects that the backend may use for outputting code have a reset, some are not used but were declared for completeness 2012-12-14 18:52:11 +00:00
MCCodeGenInfo.h Fix typo in comment. 2012-02-17 16:39:47 +00:00
MCContext.h Make the MCStreamer have a reset method and call that after finalization of the asm printer, 2012-12-12 22:59:46 +00:00
MCDirectives.h Refactor data-in-code annotations. 2012-05-18 19:12:01 +00:00
MCDisassembler.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCDwarf.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCELF.h Added Mapping Symbols for ARM ELF 2012-12-07 16:50:23 +00:00
MCELFObjectWriter.h Add 'const' qualifier on member functions not changing its fields. 2012-10-25 18:35:04 +00:00
MCELFStreamer.h This patch is needed to make c++ exceptions work for mips16. 2012-12-16 04:00:45 +00:00
MCELFSymbolFlags.h
MCExpr.h This patch improves the 64-bit PowerPC InitialExec TLS support by providing 2012-12-14 17:02:38 +00:00
MCFixedLenDisassembler.h Switch the fixed-length disassembler to be table-driven. 2012-08-14 19:06:05 +00:00
MCFixup.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
MCFixupKindInfo.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCInst.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCInstBuilder.h Decouple MCInstBuilder from the streamer per Eli's request. 2012-11-26 18:05:52 +00:00
MCInstPrinter.h Try to unbreak the build on hosts that don't transitively pull in a definition for int64_t. 2012-12-05 18:31:11 +00:00
MCInstrAnalysis.h
MCInstrDesc.h Typo. 2012-09-24 23:04:25 +00:00
MCInstrInfo.h Revert r152202: "Use uint16_t to store InstrNameIndices in MCInstrInfo." 2012-03-15 18:05:57 +00:00
MCInstrItineraries.h I'm introducing a new machine model to simultaneously allow simple 2012-07-07 04:00:00 +00:00
MCLabel.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCMachObjectWriter.h Add more reset methods to make all objects that the backend may use for outputting code have a reset, some are not used but were declared for completeness 2012-12-14 18:52:11 +00:00
MCMachOSymbolFlags.h
MCModule.h
MCObjectFileInfo.h Add the rest of the experimental fission sections to MC. 2012-11-30 06:47:06 +00:00
MCObjectStreamer.h This patch is needed to make c++ exceptions work for mips16. 2012-12-16 04:00:45 +00:00
MCObjectWriter.h Add more reset methods to make all objects that the backend may use for outputting code have a reset, some are not used but were declared for completeness 2012-12-14 18:52:11 +00:00
MCRegisterInfo.h Add an MCPhysReg typedef to replace naked uint16_t. 2012-11-29 02:39:28 +00:00
MCSchedule.h misched: TargetSchedule interface for machine resources. 2012-11-06 07:10:38 +00:00
MCSection.h Add a way of printing out an arbitrary label name for a section 2012-12-13 03:00:35 +00:00
MCSectionCOFF.h Add a way of printing out an arbitrary label name for a section 2012-12-13 03:00:35 +00:00
MCSectionELF.h Remove extraneous debugging code. 2012-12-13 03:07:28 +00:00
MCSectionMachO.h Add a way of printing out an arbitrary label name for a section 2012-12-13 03:00:35 +00:00
MCStreamer.h This patch is needed to make c++ exceptions work for mips16. 2012-12-16 04:00:45 +00:00
MCSubtargetInfo.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCSymbol.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCTargetAsmLexer.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCTargetAsmParser.h [ms-inline asm] Add support for the TYPE operator. 2012-10-26 18:04:20 +00:00
MCValue.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCWin64EH.h
MCWinCOFFObjectWriter.h Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
SectionKind.h
SubtargetFeature.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00