LLVM backend for 6502
Go to file
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
autoconf Makefile: add missing files to FilesToConfig 2012-01-17 02:56:49 +00:00
bindings
cmake Don't use -fvisibility-inlines-hidden on mingw to try to avoid a lot of 2012-01-20 13:10:10 +00:00
docs Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
examples
include Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
lib Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
projects revert r147542 after comments from Joerg Sonnenberger 2012-01-05 18:28:46 +00:00
runtime
test Fix CountCodeReductionForAlloca to more accurately represent what SROA can and 2012-01-20 08:35:20 +00:00
tools Add a TargetOption for disabling tail calls. 2012-01-19 00:34:10 +00:00
unittests Add portable bit mask operations to BitVector. 2012-01-17 01:24:32 +00:00
utils Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
.gitignore
CMakeLists.txt
configure revert r147542 after comments from Joerg Sonnenberger 2012-01-05 18:28:46 +00:00
CREDITS.TXT
LICENSE.TXT Happy new year 2012! 2012-01-01 08:16:56 +00:00
llvm.spec.in
LLVMBuild.txt
Makefile Makefile: add missing files to FilesToConfig 2012-01-17 02:56:49 +00:00
Makefile.common
Makefile.config.in
Makefile.rules
README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.