llvm-6502/lib/Transforms/Scalar
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
..
ADCE.cpp The landingpad instruction isn't dead simply because it's value isn't used. 2011-08-19 21:52:06 +00:00
BasicBlockPlacement.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
CMakeLists.txt build/CMake: Finish removal of add_llvm_library_dependencies. 2011-11-29 19:25:30 +00:00
CodeGenPrepare.cpp Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
ConstantProp.cpp Last bit of TargetLibraryInfo propagation. Also fixed a case for TargetData 2011-12-01 21:29:16 +00:00
CorrelatedValuePropagation.cpp Don't include Operator.h from InstrTypes.h. 2011-04-11 09:35:34 +00:00
DCE.cpp Remove unused STL header includes. 2011-04-23 19:53:52 +00:00
DeadStoreElimination.cpp Fix infinite loop in DSE when deleting a free in a reachable loop that's also 2011-12-08 22:36:35 +00:00
EarlyCSE.cpp Propagate TargetLibraryInfo throughout ConstantFolding.cpp and 2011-12-01 03:08:23 +00:00
GlobalMerge.cpp Make GlobalMerge honor the preferred alignment on globals without an explicitly specified alignment. 2011-11-30 21:54:15 +00:00
GVN.cpp Propagate TargetLibraryInfo throughout ConstantFolding.cpp and 2011-12-01 03:08:23 +00:00
IndVarSimplify.cpp SCEVExpander fixes. Affects LSR and indvars. 2012-01-20 07:41:13 +00:00
JumpThreading.cpp SplitBlockPredecessors uses ArrayRef instead of Data and Size. 2011-12-09 21:19:53 +00:00
LICM.cpp Move Instruction::isSafeToSpeculativelyExecute out of VMCore and 2011-12-14 23:49:11 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
LoopDeletion.cpp Don't use PN->replaceUsesOfWith() to change a PHINode's incoming blocks, 2011-06-21 10:02:43 +00:00
LoopIdiomRecognize.cpp Correct grammar. 2011-09-13 00:44:16 +00:00
LoopInstSimplify.cpp Propagate TargetLibraryInfo throughout ConstantFolding.cpp and 2011-12-01 03:08:23 +00:00
LoopRotation.cpp Make better use of the PHINode API. 2011-06-20 14:18:48 +00:00
LoopStrengthReduce.cpp SCEVExpander fixes. Affects LSR and indvars. 2012-01-20 07:41:13 +00:00
LoopUnrollPass.cpp Add -unroll-runtime for unrolling loops with run-time trip counts. 2011-12-09 06:19:40 +00:00
LoopUnswitch.cpp Fixed comment in loop-unswitch. 2012-01-16 20:48:04 +00:00
LowerAtomic.cpp Remove the old atomic instrinsics. autoupgrade functionality is included with this patch. 2011-10-06 23:20:49 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00
MemCpyOptimizer.cpp Update comment. 2011-12-05 22:53:09 +00:00
ObjCARC.cpp Set the "tail" flag on pattern-matched objc_storeStrong calls. 2012-01-19 19:14:36 +00:00
Reassociate.cpp Silence a bunch (but not all) "variable written but not read" warnings 2011-08-12 14:54:45 +00:00
Reg2Mem.cpp Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
Scalar.cpp Add a new ObjC ARC optimization pass to eliminate unneeded 2012-01-17 20:52:24 +00:00
ScalarReplAggregates.cpp Fix warning. 2011-12-26 23:12:42 +00:00
SCCP.cpp Remove trailing spaces and unneeded includes. 2012-01-18 21:16:33 +00:00
SimplifyCFGPass.cpp Convert CallInst and InvokeInst APIs to use ArrayRef. 2011-07-15 08:37:34 +00:00
SimplifyLibCalls.cpp Turn cos(-x) into cos(x). Patch by Alexander Malyshev! 2011-12-27 18:25:50 +00:00
Sink.cpp Move Instruction::isSafeToSpeculativelyExecute out of VMCore and 2011-12-14 23:49:11 +00:00
TailRecursionElimination.cpp Correct over-zealous removal of hack. 2011-10-17 18:43:40 +00:00