llvm-6502/include/llvm/IR
JF Bastien 8c253f7e88 Use common parse routine to read alignment values from bitcode
While fuzzing LLVM bitcode files, I discovered that (1) the bitcode reader doesn't check that alignments are no larger than 2**29; (2) downstream code doesn't check the range; and (3) for values out of range, corresponding large memory requests (based on alignment size) will fail. This code fixes the bitcode reader to check for valid alignments, fixing this problem.

This CL fixes alignment value on global variables, functions, and instructions: alloca, load, load atomic, store, store atomic.

Patch by Karl Schimpf (kschimpf@google.com).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 19:32:03 +00:00
..
Argument.h Provide convenient access to the zext/sext attributes of function arguments. NFC. 2014-08-05 05:43:41 +00:00
AssemblyAnnotationWriter.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
Attributes.h InstCombine: propagate deref via new addDereferenceableAttr 2015-02-14 19:37:54 +00:00
AutoUpgrade.h Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
BasicBlock.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
CallingConv.h X86: Implement the vectorcall calling convention 2014-10-28 01:29:26 +00:00
CallSite.h Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:00:20 +00:00
CFG.h Add range adapters predecessors() and successors() for BBs 2015-02-04 19:14:57 +00:00
CMakeLists.txt [CMake] intrinsics_gen: Use add_public_tablegen_target(). 2014-02-20 13:42:16 +00:00
Comdat.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Constant.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
ConstantFolder.h Add CreatePointerBitCastOrAddrSpaceCast to IRBuilder and co. 2014-07-14 17:24:35 +00:00
ConstantRange.h fix typos; remove names from comments; NFC 2015-01-09 17:11:51 +00:00
Constants.h Avoid conversion to float when creating ConstantDataArray/ConstantDataVector. 2015-02-19 16:08:20 +00:00
DataLayout.h Add a FIXME about preferred alignment to DataLayout. 2015-01-26 19:19:04 +00:00
DebugInfo.h IR: Add helper to split debug info flags bitfield 2015-02-21 00:45:26 +00:00
DebugInfoFlags.def IR: Move DebugInfo Flag* definitions to .def file, NFC 2015-02-21 00:37:53 +00:00
DebugInfoMetadata.h IR: Change MDFile to directly store the filename/directory 2015-02-20 20:35:17 +00:00
DebugLoc.h [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
DerivedTypes.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
DiagnosticInfo.h Use the DiagnosticHandler to print diagnostics when reading bitcode. 2015-01-10 00:07:30 +00:00
DiagnosticPrinter.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
DIBuilder.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Dominators.h [PM] Port domtree to the new pass manager (at last). 2015-01-14 10:19:28 +00:00
Function.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
GetElementPtrTypeIterator.h [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-09 06:08:46 +00:00
GlobalAlias.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
GlobalObject.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
GlobalValue.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
GlobalVariable.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
GVMaterializer.h Ask the module for its the identified types. 2014-12-03 07:18:23 +00:00
InlineAsm.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
InstIterator.h Introduce print-memderefs to test isDereferenceablePointer 2015-02-06 01:46:42 +00:00
InstrTypes.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Instruction.def Add addrspacecast instruction. 2013-11-15 01:34:59 +00:00
Instruction.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Instructions.h Remove some unnecessary unreachables in favor of (sometimes implicit) assertions 2015-02-20 23:44:24 +00:00
InstVisitor.h [Layering] Move InstVisitor.h into the IR library as it is pretty 2014-03-06 03:23:41 +00:00
IntrinsicInst.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Intrinsics.h Masked Gather and Scatter Intrinsics. 2015-02-08 08:27:19 +00:00
Intrinsics.td Introduce bitset metadata format and bitset lowering pass. 2015-02-20 20:30:47 +00:00
IntrinsicsAArch64.td Port memory barriers intrinsics to AArch64 2014-07-17 10:50:20 +00:00
IntrinsicsARM.td ARM: add @llvm.arm.space intrinsic for testing ConstantIslands. 2014-11-13 17:58:48 +00:00
IntrinsicsBPF.td BPF backend 2015-01-24 17:51:26 +00:00
IntrinsicsHexagon.td [Hexagon] Converting XTYPE/SHIFT intrinsics. Cleaning out old intrinsic patterns and updating tests. 2015-02-03 20:40:52 +00:00
IntrinsicsMips.td [mips][msa] Add DLSA instruction. 2014-02-10 12:05:17 +00:00
IntrinsicsNVVM.td [NVPTX] Make the alignment an explicit argument to ldu/ldg 2014-08-29 15:30:20 +00:00
IntrinsicsPowerPC.td [PowerPC] Add VSX builtins for vec_div 2014-11-14 12:10:40 +00:00
IntrinsicsR600.td R600/SI: Add class intrinsic 2015-01-06 23:00:37 +00:00
IntrinsicsX86.td Revert "AVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics." 2015-02-20 00:45:28 +00:00
IntrinsicsXCore.td [XCore] Add intrinsic for CLRPT (clear port time) instruction. 2014-02-25 17:31:15 +00:00
IRBuilder.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
IRPrintingPasses.h [PM] Switch the new pass manager to use a reference-based API for IR 2015-01-05 02:47:05 +00:00
LegacyPassManager.h Document that PassManager::add() may delete the pass right away. 2014-12-12 01:27:01 +00:00
LegacyPassManagers.h [LPM] A targeted but somewhat horrible fix to the legacy pass manager's 2015-01-28 09:47:21 +00:00
LegacyPassNameParser.h Refactoring cl::parser construction and initialization. 2015-01-22 21:01:12 +00:00
LLVMContext.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Mangler.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
MDBuilder.h IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
Metadata.def AsmParser: Add stubs for specialized MDNodes, NFC 2015-02-10 01:08:16 +00:00
Metadata.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
MetadataTracking.h IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
Module.h [llvm link] Destroy ConstantArrays in LLVMContext if they are not used. 2015-01-20 19:24:59 +00:00
NoFolder.h [Modules] Move the NoFolder into the IR library as it creates 2014-03-04 12:05:47 +00:00
OperandTraits.h
Operator.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
PassManager.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
PassManagerInternal.h [PM] Remove the 'AnalysisManagerT' type parameter from numerous layers 2015-01-13 11:31:43 +00:00
PatternMatch.h InstSimplify: Optimize away pointless comparisons 2014-12-20 03:04:38 +00:00
PredIteratorCache.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
Statepoint.h Generalize statepoint lowering to use ImmutableStatepoint. Move statepoint lowering into a separate function 'LowerStatepoint' which uses ImmutableStatepoint instead of a CallInst. Also related utility functions are changed to receive ImmutableCallSite. 2015-02-20 15:28:35 +00:00
SymbolTableListTraits.h [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-09 06:08:46 +00:00
TrackingMDRef.h Add a C++ marker to this header file. 2014-12-22 19:07:45 +00:00
Type.h Add and use Type::subtypes. NFC. 2014-11-24 20:44:36 +00:00
TypeBuilder.h #include <climits> instead of <limits.h> in C++ header file. 2013-06-13 23:49:09 +00:00
TypeFinder.h IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
Use.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
UseListOrder.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
User.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Value.h Use common parse routine to read alignment values from bitcode 2015-02-22 19:32:03 +00:00
ValueHandle.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
ValueMap.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
ValueSymbolTable.h
Verifier.h [PM] Switch the new pass manager to use a reference-based API for IR 2015-01-05 02:47:05 +00:00