llvm-6502/include/llvm
Kostya Serebryany 164b86b439 Extend Attributes to 64 bits
Problem: LLVM needs more function attributes than currently available (32 bits).
One such proposed attribute is "address_safety", which shows that a function is being checked for address safety (by AddressSanitizer, SAFECode, etc).

Solution:
- extend the Attributes from 32 bits to 64-bits
- wrap the object into a class so that unsigned is never erroneously used instead
- change "unsigned" to "Attributes" throughout the code, including one place in clang.
- the class has no "operator uint64 ()", but it has "uint64_t Raw() " to support packing/unpacking.
- the class has "safe operator bool()" to support the common idiom:  if (Attributes attr = getAttrs()) useAttrs(attr);
- The CTOR from uint64_t is marked explicit, so I had to add a few explicit CTOR calls
- Add the new attribute "address_safety". Doing it in the same commit to check that attributes beyond first 32 bits actually work.
- Some of the functions from the Attribute namespace are worth moving inside the class, but I'd prefer to have it as a separate commit.

Tested:
"make check" on Linux (32-bit and 64-bit) and Mac (10.6)
built/run spec CPU 2006 on Linux with clang -O2.


This change will break clang build in lib/CodeGen/CGCall.cpp.
The following patch will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148553 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 17:56:17 +00:00
..
ADT Protect SmallVectorImpl's constructor and a few other methods that aren't meant to be public. 2012-01-20 16:39:46 +00:00
Analysis SCEVExpander fixes. Affects LSR and indvars. 2012-01-20 07:41:13 +00:00
Assembly Make headers standalone. 2011-11-14 17:45:03 +00:00
Bitcode Add 'llvm_unreachable' to passify GCC's understanding of the constraints 2012-01-10 18:08:01 +00:00
CodeGen More bundle related API additions. 2012-01-19 07:47:03 +00:00
Config revert r147542 after comments from Joerg Sonnenberger 2012-01-05 18:28:46 +00:00
DebugInfo DebugInfo: Add equality operators and default constructor to DILineInfo. 2011-09-21 01:13:16 +00:00
ExecutionEngine ExecutionEngine interface to re-map addresses for engines that support it. 2012-01-16 23:50:55 +00:00
MC Add a new form of MCOperand, for representing sub-instructions. This is intended for supporting bundles through the MC layer, rather than lowering them pre-MC as we currently do for Thumb2 IT blocks. Since these sub-instruction operands hold pointers to the sub-instructions, it is the responsibility of the target's AsmPrinter to provide storage for them for the duration of the EmitInstruction() call. 2012-01-19 19:24:37 +00:00
Object Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Support Removes template magic to build up containers. 2012-01-17 09:34:07 +00:00
TableGen Delete CodeInit and CodeRecTy from TableGen. 2012-01-13 03:38:34 +00:00
Target Add a TargetOption for disabling tail calls. 2012-01-19 00:34:10 +00:00
Transforms Add a new ObjC ARC optimization pass to eliminate unneeded 2012-01-17 20:52:24 +00:00
Argument.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Attributes.h Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
AutoUpgrade.h remove autoupgrade support for really old-style debug info intrinsics. 2011-11-27 06:18:33 +00:00
BasicBlock.h Remove useless code. 2011-10-20 04:33:44 +00:00
CallGraphSCCPass.h
CallingConv.h Use X86_thiscall calling convention for Win64 as well. 2011-03-03 07:49:07 +00:00
CMakeLists.txt build/cmake: Use tblgen macro directly instead of llvm_tablegen, which just 2011-11-04 19:04:23 +00:00
Constant.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Constants.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
DebugInfoProbe.h Introduce DebugInfoProbe. This is used to monitor how llvm optimizer is treating debugging information. 2011-03-10 00:21:25 +00:00
DefaultPasses.h Add a couple missing includes; found while analyzing LLVM headers. 2011-11-04 18:19:43 +00:00
DerivedTypes.h Add support for vectors of pointers. 2011-12-05 06:29:09 +00:00
Function.h Refactor code from inlining and globalopt that checks whether a function definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180. 2011-10-20 05:23:42 +00:00
GlobalAlias.h Remove DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS, folding its 2011-08-22 09:37:03 +00:00
GlobalValue.h Re-fix the issue Bill fixed in r147899 in a slightly different way, which doesn't abuse the semantics of linker_private. We don't really want to merge any string constant with a weak_odr global. 2012-01-11 22:06:46 +00:00
GlobalVariable.h land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
GVMaterializer.h
InitializePasses.h More bundle related API additions. 2012-01-19 07:47:03 +00:00
InlineAsm.h Encode register class constreaints in inline asm instructions. 2011-10-12 23:37:29 +00:00
InstrTypes.h Add some missing anchors. 2011-12-01 08:00:17 +00:00
Instruction.def Initial commit of the 'landingpad' instruction. 2011-08-12 20:24:12 +00:00
Instruction.h Move Instruction::isSafeToSpeculativelyExecute out of VMCore and 2011-12-14 23:49:11 +00:00
Instructions.h Add support for vectors of pointers. 2011-12-05 06:29:09 +00:00
IntrinsicInst.h land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
Intrinsics.h land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
Intrinsics.td Hexagon backend support 2011-12-12 21:14:40 +00:00
IntrinsicsARM.td Add support for ARM ldrexd/strexd intrinsics. They both use i32 register pairs 2011-05-28 04:07:29 +00:00
IntrinsicsCellSPU.td
IntrinsicsHexagon.td Hexagon backend support 2011-12-12 21:14:40 +00:00
IntrinsicsPowerPC.td
IntrinsicsPTX.td PTX: Add intrinsics to list of built-in intrinsics, which allows them to be 2011-04-20 15:37:17 +00:00
IntrinsicsX86.td Add XOP Intrinsics and tests 2012-01-11 15:20:20 +00:00
IntrinsicsXCore.td Update IntrinsicsXCore.td with the normal LLVM notice at the top of the file. 2011-10-13 21:08:11 +00:00
LinkAllPasses.h Add a new ObjC ARC optimization pass to eliminate unneeded 2012-01-17 20:52:24 +00:00
LinkAllVMCore.h Missed a spot removing Alarm. 2010-12-07 18:50:33 +00:00
Linker.h Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before. 2011-10-11 00:24:54 +00:00
LLVMContext.h generalize LLVMContext::emitError to take a twine instead of a StringRef. 2012-01-03 23:47:05 +00:00
Metadata.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Module.h Remove the last improper use of getGlobalContext() from LLVM. 2011-08-13 01:04:44 +00:00
OperandTraits.h Remove DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS, folding its 2011-08-22 09:37:03 +00:00
Operator.h Add support for vectors of pointers. 2011-12-05 06:29:09 +00:00
Pass.h Devirtualize Pass::getPassID, overriding it isn't useful and it gets called a lot. 2011-11-24 21:14:11 +00:00
PassAnalysisSupport.h Add a couple missing includes; found while analyzing LLVM headers. 2011-11-04 18:19:43 +00:00
PassManager.h
PassManagers.h Reapply r138695. Fix PassManager stack depths. 2011-08-29 17:07:00 +00:00
PassRegistry.h
PassSupport.h Add Tsan annotations to the pass system. 2011-12-08 00:15:41 +00:00
SymbolTableListTraits.h
Type.h Fix for PR11652: assertion failures when Type.cpp is compiled with -Os 2012-01-03 20:04:35 +00:00
Use.h Reinstate r133513 (reverted in r133700) with an additional fix for a 2011-06-23 09:09:15 +00:00
User.h Add some missing anchors. 2011-12-01 08:00:17 +00:00
Value.h Remove unneeded include. 2012-01-17 23:53:08 +00:00
ValueSymbolTable.h Merge System into Support. 2010-11-29 18:16:10 +00:00