1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/include/llvm/MC
Reed Kotler 7ee48929d5 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 

llvm-svn: 170279
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
MachineLocation.h
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
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
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
MCFixup.h
MCFixupKindInfo.h
MCInst.h
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
MCInstrInfo.h
MCInstrItineraries.h
MCLabel.h
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
MCTargetAsmLexer.h
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