llvm-6502/include/llvm
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
..
ADT Mark ImmutableMap::remove/add() const. 2012-12-07 19:44:12 +00:00
Analysis Rename isPowerOfTwo to isKnownToBeAPowerOfTwo. 2012-12-13 03:37:24 +00:00
Assembly Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
Bitcode Have the bitcode reader/writer just use FPMathOperator's fast math enum directly 2012-12-09 20:23:16 +00:00
CodeGen fix comment. 2012-12-13 22:34:43 +00:00
Config [CMake] Move libxml2 stuff from clang to llvm/cmake. 2012-12-14 18:30:20 +00:00
DebugInfo Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
ExecutionEngine JITEventListener.h: Use llvm-config.h instead of config.h. 2012-12-13 15:03:38 +00:00
MC This patch is needed to make c++ exceptions work for mips16. 2012-12-16 04:00:45 +00:00
Object Revert "Add a funciton to get the segment name of a section." 2012-12-13 06:36:18 +00:00
Option Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00
Support This patch improves the 64-bit PowerPC InitialExec TLS support by providing 2012-12-14 17:02:38 +00:00
TableGen Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Target Change TargetLowering::getLoadExtAction to take an MVT, instead of 2012-12-14 09:05:13 +00:00
Transforms LoopVectorizer: Use the "optsize" attribute to decide if we are allowed to increase the function size. 2012-12-12 19:29:45 +00:00
AddressingMode.h Use DataTypes.h 2012-10-08 23:14:28 +00:00
Argument.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Attributes.h s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future. 2012-12-07 23:16:57 +00:00
AutoUpgrade.h
BasicBlock.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
CallGraphSCCPass.h moves doInitialization and doFinalization to the Pass class and removes some unreachable code in MachineModuleInfo 2012-12-03 21:56:57 +00:00
CallingConv.h Add the Erlang/HiPE calling convention, patch by Yiannis Tsiouris. 2012-11-16 12:36:39 +00:00
CMakeLists.txt llvm/include/llvm/CMakeLists.txt: Cut dependency to intrinsics_gen. 2012-07-06 15:55:39 +00:00
Constant.h Make GlobalOpt be conservative with TLS variables (PR14309) 2012-11-15 11:40:00 +00:00
Constants.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
DataLayout.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
DebugInfo.h Improve debug info generated with enabled AddressSanitizer. 2012-12-12 14:31:53 +00:00
DefaultPasses.h Fix a couple include directives that used angle brackets for llvm files. 2012-09-15 18:41:37 +00:00
DerivedTypes.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
DIBuilder.h Use the 'count' attribute to calculate the upper bound of an array. 2012-12-04 21:34:03 +00:00
Function.h s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future. 2012-12-07 23:16:57 +00:00
GlobalAlias.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
GlobalValue.h Remove unnecessary classof()'s 2012-10-11 23:30:49 +00:00
GlobalVariable.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
GVMaterializer.h
InitializePasses.h Initial commit of MemorySanitizer. 2012-11-29 09:57:20 +00:00
InlineAsm.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
InstrTypes.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Instruction.def [unwind removal] Remove all of the code for the dead 'unwind' instruction. There 2012-02-06 21:44:22 +00:00
Instruction.h Reorganize FastMathFlags to be a wrapper around unsigned, and streamline some interfaces. 2012-12-09 21:12:04 +00:00
Instructions.h Hoist the GEP constant address offset computation to a common home on 2012-12-11 10:29:10 +00:00
InstVisitor.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
IntrinsicInst.h va_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support. 2012-10-29 09:39:03 +00:00
Intrinsics.h s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future. 2012-12-07 23:16:57 +00:00
Intrinsics.td Add R600 backend 2012-12-11 21:25:42 +00:00
IntrinsicsARM.td ARM: Use a dedicated intrinsic for vector bitwise select. 2012-09-21 00:18:20 +00:00
IntrinsicsHexagon.td Test commit. 2012-08-17 06:36:26 +00:00
IntrinsicsMips.td Support MIPS DSP Rev2 intrinsics. 2012-08-27 12:29:01 +00:00
IntrinsicsNVVM.td Remove the PTX back-end and all of its artifacts (triple, etc.) 2012-05-24 21:38:21 +00:00
IntrinsicsPowerPC.td
IntrinsicsR600.td Add R600 backend 2012-12-11 21:25:42 +00:00
IntrinsicsX86.td Add support of RTM from TSX extension 2012-11-08 07:28:54 +00:00
IntrinsicsXCore.td
IRBuilder.h Fix comment typo. 2012-12-04 16:36:05 +00:00
LinkAllPasses.h LoopVectorizer: Use the "optsize" attribute to decide if we are allowed to increase the function size. 2012-12-12 19:29:45 +00:00
LinkAllVMCore.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Linker.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
LLVMContext.h Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. 2012-09-17 07:16:40 +00:00
MDBuilder.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Metadata.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Module.h s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future. 2012-12-07 23:16:57 +00:00
OperandTraits.h
Operator.h Holding my nose and moving the accumulation routine to GEPOperator 2012-12-11 11:05:15 +00:00
Pass.h moves doInitialization and doFinalization to the Pass class and removes some unreachable code in MachineModuleInfo 2012-12-03 21:56:57 +00:00
PassAnalysisSupport.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
PassManager.h One more step towards making doInitialization and doFinalization useful for 2012-11-29 17:47:05 +00:00
PassManagers.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
PassRegistry.h
PassSupport.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
SymbolTableListTraits.h Remove unused typedefs gcc4.8 warns about. 2012-09-05 17:55:46 +00:00
TargetTransformInfo.h Replace TargetLowering::isIntImmLegal() with 2012-12-11 23:26:14 +00:00
Type.h Teach Type::getPointerAddressSpace to look through pointer vectors 2012-11-01 09:37:49 +00:00
TypeBuilder.h Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completes 2012-07-15 23:45:24 +00:00
TypeFinder.h Move the "findUsedStructTypes" functionality outside of the Module class. 2012-08-03 00:30:35 +00:00
Use.h Add includes of Compiler.h to fix build bot failures. 2012-09-16 21:50:09 +00:00
User.h Remove unnecessary classof()'s 2012-10-11 23:30:49 +00:00
Value.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
ValueSymbolTable.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00