|
LLVM
10.0.0
|
This struct is a compact representation of a valid (non-zero power of two) alignment. More...
#include "llvm/Support/Alignment.h"
Public Member Functions | |
| constexpr | Align ()=default |
| Default is byte-aligned. More... | |
| constexpr | Align (const Align &Other)=default |
Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other. More... | |
| constexpr | Align (Align &&Other)=default |
| Align & | operator= (const Align &Other)=default |
| Align & | operator= (Align &&Other)=default |
| Align (uint64_t Value) | |
| uint64_t | value () const |
| This is a hole in the type system and should not be abused. More... | |
| constexpr | Align (LogValue CA) |
| Constexpr constructor from LogValue type. More... | |
Static Public Member Functions | |
| static constexpr const Align | None () |
| Returns a default constructed Align which corresponds to no alignment. More... | |
| template<size_t kValue> | |
| static constexpr LogValue | Constant () |
| Allow constructions of constexpr Align. More... | |
| template<typename T > | |
| static constexpr LogValue | Of () |
| Allow constructions of constexpr Align from types. More... | |
Friends | |
| struct | MaybeAlign |
| The log2 of the required alignment. More... | |
| unsigned | Log2 (Align) |
| Returns the log2 of the alignment. More... | |
| bool | operator== (Align Lhs, Align Rhs) |
| Comparisons operators between Align. More... | |
| bool | operator!= (Align Lhs, Align Rhs) |
| bool | operator<= (Align Lhs, Align Rhs) |
| bool | operator>= (Align Lhs, Align Rhs) |
| bool | operator< (Align Lhs, Align Rhs) |
| bool | operator> (Align Lhs, Align Rhs) |
| unsigned | encode (struct MaybeAlign A) |
| Returns a representation of the alignment that encodes undefined as 0. More... | |
| struct MaybeAlign | decodeMaybeAlign (unsigned Value) |
| Dual operation of the encode function above. More... | |
This struct is a compact representation of a valid (non-zero power of two) alignment.
It is suitable for use as static global constants.
Definition at line 40 of file Alignment.h.
|
default |
Default is byte-aligned.
Referenced by llvm::assumeAligned(), llvm::commonAlignment(), None(), llvm::operator/(), and llvm::MaybeAlign::valueOrOne().
Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other.
|
default |
|
inlineexplicit |
Definition at line 77 of file Alignment.h.
References assert(), llvm::isPowerOf2_64(), and llvm::Log2_64().
|
inline |
Constexpr constructor from LogValue type.
Definition at line 107 of file Alignment.h.
|
inlinestatic |
Allow constructions of constexpr Align.
Definition at line 96 of file Alignment.h.
Returns a default constructed Align which corresponds to no alignment.
This is useful to test for unalignment as it conveys clear semantic. if (A != Align::None()) would be better than if (A > Align(1))
Definition at line 93 of file Alignment.h.
References Align().
Referenced by annotateNonNullAndDereferenceable(), canTransformToMemCmp(), CompareMBBNumbers(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::MachineFrameInfo::CreateFixedObject(), llvm::MachineFrameInfo::CreateFixedSpillStackObject(), llvm::IRBuilderBase::CreateGlobalString(), llvm::createPrivateGlobalForString(), llvm::orc::IRSpeculationLayer::emit(), llvm::AsmPrinter::EmitAlignment(), llvm::AsmPrinter::EmitBasicBlockStart(), llvm::AsmPrinter::emitDwarfAbbrevs(), getAllocaSizeInBytes(), llvm::AMDGPUSubtarget::getExplicitKernArgSize(), llvm::DataLayout::getIndexTypeSizeInBits(), llvm::PPCTargetLowering::getTgtMemIntrinsic(), llvm::X86TargetLowering::getTgtMemIntrinsic(), getUnconditionalBrDisp(), llvm::CallLowering::handleAssignments(), HandleByValArgumentInit(), hasVariantSymbol(), INITIALIZE_PASS(), instrumentMaskedLoadOrStore(), llvm::MachinePointerInfo::isDereferenceable(), llvm::isDereferenceablePointer(), isHardwareLoop(), isReportingError(), llvm::LibCallSimplifier::LibCallSimplifier(), needsRuntimeRegistrationOfSectionRange(), optimizeMemCmpConstantSize(), llvm::BasicBlockInfo::postOffset(), llvm::MIPrinter::print(), llvm::MachineBasicBlock::print(), tryToElideArgumentCopy(), and TypeSizeToSizeIndex().
|
inlinestatic |
Allow constructions of constexpr Align from types.
Compile time equivalent to Align(alignof(T)).
Definition at line 102 of file Alignment.h.
|
inline |
This is a hole in the type system and should not be abused.
Needed to interact with C for instance.
Definition at line 86 of file Alignment.h.
Referenced by AdjustStackOffset(), llvm::alignAddr(), llvm::alignTo(), AssignProtectedObjSet(), canReuseBoundaryAlignFragment(), CC_ARM_AAPCS_Custom_Aggregate(), clampStackAlignment(), llvm::commonAlignment(), llvm::AsmPrinter::EmitAlignment(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::CCState::ensureMaxAlignment(), llvm::DataLayout::getABITypeAlignment(), llvm::MCSection::getAlignment(), llvm::MachineJumpTableInfo::getEntryAlignment(), GetInitialOffset(), llvm::MachineFrameInfo::getMaxAlignment(), llvm::AMDGPUMachineFunction::getMaxKernArgAlign(), llvm::HexagonTTIImpl::getMemoryOpCost(), getOpenCLAlignment(), llvm::DataLayout::getPrefTypeAlignment(), llvm::TargetFrameLowering::getStackAlignment(), llvm::TargetFrameLowering::getTransientStackAlignment(), getTypePartition(), getUnconditionalBrDisp(), llvm::Attribute::getWithAlignment(), llvm::Attribute::getWithStackAlignment(), INITIALIZE_PASS(), isAgainstBoundary(), isAligned(), llvm::isAligned(), llvm::isDereferenceableAndAlignedInLoop(), isDereferenceableAndAlignedPointer(), moveUp(), llvm::operator!=(), llvm::operator/(), llvm::operator<(), llvm::operator<=(), llvm::operator==(), llvm::operator>(), llvm::operator>=(), llvm::MIRPrinter::print(), llvm::MIPrinter::print(), llvm::ISD::ArgFlagsTy::setByValAlign(), llvm::ISD::ArgFlagsTy::setOrigAlign(), TypeSizeToSizeIndex(), llvm::UnknownPadding(), llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(), and llvm::sroa::AllocaSliceRewriter::visit().
|
friend |
Dual operation of the encode function above.
Definition at line 239 of file Alignment.h.
|
friend |
Returns a representation of the alignment that encodes undefined as 0.
Definition at line 236 of file Alignment.h.
Referenced by llvm::encode().
Returns the log2 of the alignment.
Definition at line 204 of file Alignment.h.
Referenced by llvm::Log2().
|
friend |
The log2 of the required alignment.
ShiftValue is less than 64 by construction.
Definition at line 45 of file Alignment.h.
Referenced by llvm::commonAlignment(), llvm::decodeMaybeAlign(), llvm::encode(), and llvm::operator/().
Definition at line 309 of file Alignment.h.
Definition at line 318 of file Alignment.h.
Definition at line 312 of file Alignment.h.
Comparisons operators between Align.
Definition at line 306 of file Alignment.h.
Definition at line 321 of file Alignment.h.
Definition at line 315 of file Alignment.h.
1.8.13