llvm/lib
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
..
Analysis Remove obviously invalid early exit that prevented analyzing ConstantAggregateZeros. 2012-01-20 14:42:25 +00:00
Archive Support/FileSystem: Add file_magic and move a vew clients over to it. 2011-12-13 23:17:12 +00:00
AsmParser Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
Bitcode Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
CodeGen Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
DebugInfo Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
ExecutionEngine Fix MCJIT memory leak of owned TargetMachine. 2012-01-17 23:08:46 +00:00
Linker Link symbols with different visibilities according to the rules in the 2012-01-05 23:02:01 +00:00
MC Add missing breaks to switch. 2012-01-20 14:42:37 +00:00
Object Remove unused variables. 2011-12-25 01:20:19 +00:00
Support Add support for the gnueabihf environment. Patch by Sylvestre Ledru. 2012-01-18 23:35:29 +00:00
TableGen Removing unused default switch cases in switches over enums that already account for all enumeration values explicitly. 2012-01-16 23:24:27 +00:00
Target Remove a bunch of unused variable assignments. 2012-01-20 14:42:32 +00:00
Transforms Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
VMCore Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
CMakeLists.txt
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile