LLVM: lib/Analysis/Lint.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
74#include
75#include
76#include
77#include
78
79using namespace llvm;
80
81namespace {
83static const unsigned Read = 1;
84static const unsigned Write = 2;
85static const unsigned Callee = 4;
86static const unsigned Branchee = 8;
87}
88
91
93
94 void visitCallBase(CallBase &CB);
97
118
119 Value *findValue(Value *V, bool OffsetOk) const;
120 Value *findValueImpl(Value *V, bool OffsetOk,
122
123public:
131
132 std::string Messages;
134
137 : Mod(Mod), TT(Mod->getTargetTriple()), DL(DL), AA(AA), AC(AC), DT(DT),
138 TLI(TLI), MessagesStr(Messages) {}
139
141 for (const Value *V : Vs) {
142 if (!V)
143 continue;
145 MessagesStr << *V << '\n';
146 } else {
147 V->printAsOperand(MessagesStr, true, Mod);
148 MessagesStr << '\n';
149 }
150 }
151 }
152
153
154
155
156
157 void CheckFailed(const Twine &Message) { MessagesStr << Message << '\n'; }
158
159
160
161
162
163 template <typename T1, typename... Ts>
164 void CheckFailed(const Twine &Message, const T1 &V1, const Ts &... Vs) {
165 CheckFailed(Message);
166 WriteValues({V1, Vs...});
167 }
168};
169}
170
171
172#define Check(C, ...) \
173 do { \
174 if (!(C)) { \
175 CheckFailed(__VA_ARGS__); \
176 return; \
177 } \
178 } while (false)
179
180void Lint::visitFunction(Function &F) {
181
182
183 Check(F.hasName() || F.hasLocalLinkage(),
184 "Unusual: Unnamed function with non-local linkage", &F);
185
186
187}
188
189void Lint::visitCallBase(CallBase &I) {
191
193 nullptr, MemRef::Callee);
194
196 false))) {
197 Check(I.getCallingConv() == F->getCallingConv(),
198 "Undefined behavior: Caller and callee calling convention differ",
199 &I);
200
201 FunctionType *FT = F->getFunctionType();
202 unsigned NumActualArgs = I.arg_size();
203
204 Check(FT->isVarArg() ? FT->getNumParams() <= NumActualArgs
205 : FT->getNumParams() == NumActualArgs,
206 "Undefined behavior: Call argument count mismatches callee "
207 "argument count",
208 &I);
209
210 Check(FT->getReturnType() == I.getType(),
211 "Undefined behavior: Call return type mismatches "
212 "callee return type",
213 &I);
214
215
216
218 auto AI = I.arg_begin(), AE = I.arg_end();
219 for (; AI != AE; ++AI) {
220 Value *Actual = *AI;
221 if (PI != PE) {
224 "Undefined behavior: Call argument type mismatches "
225 "callee parameter type",
226 &I);
227
228
229
230
232 AttributeList PAL = I.getAttributes();
233 unsigned ArgNo = 0;
234 for (auto *BI = I.arg_begin(); BI != AE; ++BI, ++ArgNo) {
235
236
237 if (PAL.hasParamAttr(ArgNo, Attribute::ByVal))
238 continue;
239
241 continue;
242
243
244 if (I.doesNotAccessMemory(ArgNo))
245 continue;
246 if (AI != BI && (*BI)->getType()->isPointerTy() &&
248 AliasResult Result = AA->alias(*AI, *BI);
251 "Unusual: noalias argument aliases another argument", &I);
252 }
253 }
254 }
255
256
259 MemoryLocation Loc(
261 visitMemoryReference(I, Loc, DL->getABITypeAlign(Ty), Ty,
262 MemRef::Read | MemRef::Write);
263 }
264
265
266 unsigned ArgNo = AI->getOperandNo();
267 Attribute::AttrKind ABIAttributes[] = {
268 Attribute::ZExt, Attribute::SExt, Attribute::InReg,
269 Attribute::ByVal, Attribute::ByRef, Attribute::InAlloca,
270 Attribute::Preallocated, Attribute::StructRet};
271 AttributeList CallAttrs = I.getAttributes();
272 for (Attribute::AttrKind Attr : ABIAttributes) {
273 Attribute CallAttr = CallAttrs.getParamAttr(ArgNo, Attr);
276 Twine("Undefined behavior: ABI attribute ") +
277 Attribute::getNameFromAttrKind(Attr) +
278 " not present on both function and call-site",
279 &I);
282 Twine("Undefined behavior: ABI attribute ") +
283 Attribute::getNameFromAttrKind(Attr) +
284 " does not have same argument for function and call-site",
285 &I);
286 }
287 }
288 }
289 }
290 }
291
293 if (CI->isTailCall()) {
294 const AttributeList &PAL = CI->getAttributes();
295 unsigned ArgNo = 0;
296 for (Value *Arg : I.args()) {
297
298
299 if (PAL.hasParamAttr(ArgNo++, Attribute::ByVal))
300 continue;
301 Value *Obj = findValue(Arg, true);
303 "Undefined behavior: Call with \"tail\" keyword references "
304 "alloca",
305 &I);
306 }
307 }
308 }
309
311 switch (II->getIntrinsicID()) {
312 default:
313 break;
314
315
316
317 case Intrinsic::memcpy:
318 case Intrinsic::memcpy_inline: {
321 MCI->getDestAlign(), nullptr, MemRef::Write);
324
325
326
327
329 if (const ConstantInt *Len =
331 false)))
332 if (Len->getValue().isIntN(32))
336 "Undefined behavior: memcpy source and destination overlap", &I);
337 break;
338 }
339 case Intrinsic::memmove: {
342 MMI->getDestAlign(), nullptr, MemRef::Write);
345 break;
346 }
347 case Intrinsic::memset:
348 case Intrinsic::memset_inline: {
351 MSI->getDestAlign(), nullptr, MemRef::Write);
352 break;
353 }
354 case Intrinsic::vastart:
355
357 std::nullopt, nullptr, MemRef::Read | MemRef::Write);
358 break;
359 case Intrinsic::vacopy:
361 std::nullopt, nullptr, MemRef::Write);
363 std::nullopt, nullptr, MemRef::Read);
364 break;
365 case Intrinsic::vaend:
367 std::nullopt, nullptr, MemRef::Read | MemRef::Write);
368 break;
369
370 case Intrinsic::stackrestore:
371
372
373
375 std::nullopt, nullptr, MemRef::Read | MemRef::Write);
376 break;
377 }
378}
379
380void Lint::visitReturnInst(ReturnInst &I) {
381 Function *F = I.getParent()->getParent();
382 Check(->doesNotReturn(),
383 "Unusual: Return statement in function with noreturn attribute", &I);
384
385 if (Value *V = I.getReturnValue()) {
386 Value *Obj = findValue(V, true);
388 }
389}
390
391
392
393void Lint::visitMemoryReference(Instruction &I, const MemoryLocation &Loc,
394 MaybeAlign Align, Type *Ty, unsigned Flags) {
395
396
398 return;
399
401 Value *UnderlyingObject = findValue(Ptr, true);
403 "Undefined behavior: Null pointer dereference", &I);
405 "Undefined behavior: Undef pointer dereference", &I);
408 "Unusual: All-ones pointer dereference", &I);
411 "Unusual: Address one pointer dereference", &I);
412
413 if (Flags & MemRef::Write) {
414 if (TT.isAMDGPU())
417 "Undefined behavior: Write to memory in const addrspace", &I);
418
420 Check(!GV->isConstant(), "Undefined behavior: Write to read-only memory",
421 &I);
424 "Undefined behavior: Write to text section", &I);
425 }
426 if (Flags & MemRef::Read) {
427 Check((UnderlyingObject), "Unusual: Load from function body",
428 &I);
430 "Undefined behavior: Load from block address", &I);
431 }
432 if (Flags & MemRef::Callee) {
434 "Undefined behavior: Call to block address", &I);
435 }
436 if (Flags & MemRef::Branchee) {
439 "Undefined behavior: Branch to non-blockaddress", &I);
440 }
441
442
443
444
447
448
449
451 MaybeAlign BaseAlign;
452
454 Type *ATy = AI->getAllocatedType();
456 BaseSize = DL->getTypeAllocSize(ATy).getFixedValue();
457 BaseAlign = AI->getAlign();
459
460
461 if (GV->hasDefinitiveInitializer()) {
462 Type *GTy = GV->getValueType();
464 BaseSize = DL->getTypeAllocSize(GTy);
465 BaseAlign = GV->getAlign();
466 if (!BaseAlign && GTy->isSized())
467 BaseAlign = DL->getABITypeAlign(GTy);
468 }
469 }
470
471
472
476 "Undefined behavior: Buffer overflow", &I);
477
478
479
480 if (!Align && Ty && Ty->isSized())
481 Align = DL->getABITypeAlign(Ty);
482 if (BaseAlign && Align)
484 "Undefined behavior: Memory reference address is misaligned", &I);
485 }
486}
487
488void Lint::visitLoadInst(LoadInst &I) {
490 MemRef::Read);
491}
492
493void Lint::visitStoreInst(StoreInst &I) {
495 I.getOperand(0)->getType(), MemRef::Write);
496}
497
498void Lint::visitAtomicCmpXchgInst(AtomicCmpXchgInst &I) {
500 I.getOperand(0)->getType(), MemRef::Write);
501}
502
503void Lint::visitAtomicRMWInst(AtomicRMWInst &I) {
505 I.getOperand(0)->getType(), MemRef::Write);
506}
507
508void Lint::visitXor(BinaryOperator &I) {
510 "Undefined result: xor(undef, undef)", &I);
511}
512
513void Lint::visitSub(BinaryOperator &I) {
515 "Undefined result: sub(undef, undef)", &I);
516}
517
518void Lint::visitLShr(BinaryOperator &I) {
520 false)))
522 "Undefined result: Shift count out of range", &I);
523}
524
525void Lint::visitAShr(BinaryOperator &I) {
526 if (ConstantInt *CI =
529 "Undefined result: Shift count out of range", &I);
530}
531
532void Lint::visitShl(BinaryOperator &I) {
533 if (ConstantInt *CI =
536 "Undefined result: Shift count out of range", &I);
537}
538
541
543 return true;
544
546 if (!VecTy) {
548 return Known.isZero();
549 }
550
551
553 if ()
554 return false;
555
556 if (C->isZeroValue())
557 return true;
558
559
560
563 Constant *Elem = C->getAggregateElement(I);
565 return true;
566
569 return true;
570 }
571
572 return false;
573}
574
575void Lint::visitSDiv(BinaryOperator &I) {
576 Check((I.getOperand(1), I.getDataLayout(), DT, AC),
577 "Undefined behavior: Division by zero", &I);
578}
579
580void Lint::visitUDiv(BinaryOperator &I) {
581 Check((I.getOperand(1), I.getDataLayout(), DT, AC),
582 "Undefined behavior: Division by zero", &I);
583}
584
585void Lint::visitSRem(BinaryOperator &I) {
586 Check((I.getOperand(1), I.getDataLayout(), DT, AC),
587 "Undefined behavior: Division by zero", &I);
588}
589
590void Lint::visitURem(BinaryOperator &I) {
591 Check((I.getOperand(1), I.getDataLayout(), DT, AC),
592 "Undefined behavior: Division by zero", &I);
593}
594
595void Lint::visitAllocaInst(AllocaInst &I) {
597
598 Check(&I.getParent()->getParent()->getEntryBlock() == I.getParent(),
599 "Pessimization: Static alloca outside of entry block", &I);
600
601
602}
603
604void Lint::visitVAArgInst(VAArgInst &I) {
606 MemRef::Read | MemRef::Write);
607}
608
609void Lint::visitIndirectBrInst(IndirectBrInst &I) {
611 std::nullopt, nullptr, MemRef::Branchee);
612
613 Check(I.getNumDestinations() != 0,
614 "Undefined behavior: indirectbr with no destinations", &I);
615}
616
617void Lint::visitExtractElementInst(ExtractElementInst &I) {
619 false))) {
620 ElementCount EC = I.getVectorOperandType()->getElementCount();
621 Check(EC.isScalable() || CI->getValue().ult(EC.getFixedValue()),
622 "Undefined result: extractelement index out of range", &I);
623 }
624}
625
626void Lint::visitInsertElementInst(InsertElementInst &I) {
628 false))) {
629 ElementCount EC = I.getType()->getElementCount();
630 Check(EC.isScalable() || CI->getValue().ult(EC.getFixedValue()),
631 "Undefined result: insertelement index out of range", &I);
632 }
633}
634
635void Lint::visitUnreachableInst(UnreachableInst &I) {
636
637 Check(&I == &I.getParent()->front() ||
638 std::prev(I.getIterator())->mayHaveSideEffects(),
639 "Unusual: unreachable immediately preceded by instruction without "
640 "side effects",
641 &I);
642}
643
644
645
646
647
648
649
650
651Value *Lint::findValue(Value *V, bool OffsetOk) const {
652 SmallPtrSet<Value *, 4> Visited;
653 return findValueImpl(V, OffsetOk, Visited);
654}
655
656
657Value *Lint::findValueImpl(Value *V, bool OffsetOk,
658 SmallPtrSetImpl<Value *> &Visited) const {
659
660 if (!Visited.insert(V).second)
662
663
664
665
666
667
673 BatchAAResults BatchAA(*AA);
674 for (;;) {
676 break;
679 return findValueImpl(U, OffsetOk, Visited);
680 if (BBI != BB->begin())
681 break;
683 if (!BB)
684 break;
685 BBI = BB->end();
686 }
688 if (Value *W = PN->hasConstantValue())
689 return findValueImpl(W, OffsetOk, Visited);
691 if (CI->isNoopCast(*DL))
692 return findValueImpl(CI->getOperand(0), OffsetOk, Visited);
696 if (W != V)
697 return findValueImpl(W, OffsetOk, Visited);
699
702 CE->getOperand(0)->getType(), CE->getType(),
703 *DL))
704 return findValueImpl(CE->getOperand(0), OffsetOk, Visited);
705 }
706 }
707
708
711 return findValueImpl(W, OffsetOk, Visited);
714 if (W != V)
715 return findValueImpl(W, OffsetOk, Visited);
716 }
717
718 return V;
719}
720
722 auto *Mod = F.getParent();
723 auto *DL = &F.getDataLayout();
728 Lint L(Mod, DL, AA, AC, DT, TLI);
729 L.visit(F);
730 dbgs() << L.MessagesStr.str();
731 if (AbortOnError && !L.MessagesStr.str().empty())
733 "linter found errors, aborting. (enabled by abort-on-error)", false);
735}
736
740 if (AbortOnError)
741 OS << "";
742}
743
744
745
746
747
748
749
752 assert(.isDeclaration() && "Cannot lint external functions");
753
758 FAM.registerPass([&] {
760 AA.registerFunctionAnalysis<BasicAA>();
763 return AA;
764 });
766}
767
768
769
772 if (.isDeclaration())
774 }
775}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AMDGPU address space definition.
This file implements a class to represent arbitrary precision integral constant values and operations...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This is the interface for LLVM's primary stateless and local alias analysis.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
SmallPtrSet< const BasicBlock *, 8 > VisitedBlocks
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
static bool isZero(Value *V, const DataLayout &DL, DominatorTree *DT, AssumptionCache *AC)
Definition Lint.cpp:539
This file provides utility analysis objects describing memory locations.
uint64_t IntrinsicInst * II
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
FunctionAnalysisManager FAM
static unsigned getNumElements(Type *Ty)
This is the interface for a metadata-based scoped no-alias analysis.
This file defines the SmallPtrSet class.
This is the interface for a metadata-based TBAA.
A manager for alias analyses.
LLVM_ABI AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
The main low level interface to the alias analysis implementation.
@ PartialAlias
The two locations alias, but only due to a partial overlap.
@ MustAlias
The two locations precisely alias each other.
an instruction to allocate memory on the stack
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
LLVM_ABI bool hasNoAliasAttr() const
Return true if this argument has the noalias attribute.
LLVM_ABI bool onlyReadsMemory() const
Return true if this argument has the readonly or readnone attribute.
LLVM_ABI Type * getParamStructRetType() const
If this is an sret argument, return its type.
LLVM_ABI bool hasStructRetAttr() const
Return true if this argument has the sret attribute.
A function analysis which provides an AssumptionCache.
A cache of @llvm.assume calls within a function.
An instruction that atomically checks whether a specified value is in a memory location,...
an instruction that atomically reads a memory location, combines it with another value,...
bool isValid() const
Return true if the attribute is any kind of attribute.
Analysis pass providing a never-invalidated alias analysis result.
iterator begin()
Instruction iterator methods.
LLVM_ABI const BasicBlock * getUniquePredecessor() const
Return the predecessor of this block if it has a unique predecessor block.
InstListType::iterator iterator
Instruction iterators...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
static LLVM_ABI bool isNoopCast(Instruction::CastOps Opcode, Type *SrcTy, Type *DstTy, const DataLayout &DL)
A no-op cast is one that can be effected without changing any bits.
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
Analysis pass which computes a DominatorTree.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Indirect Branch Instruction.
This instruction inserts a single (scalar) element into a VectorType value.
Base class for instruction visitors.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition Lint.cpp:721
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
Definition Lint.cpp:737
An instruction for reading from memory.
static LocationSize precise(uint64_t Value)
TypeSize getValue() const
static constexpr LocationSize afterPointer()
Any location after the base pointer (but still within the underlying object).
Value * getLength() const
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions (including addrspacecast) that ...
MaybeAlign getDestAlign() const
MaybeAlign getSourceAlign() const
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it,...
Representation for a specific memory location.
static LLVM_ABI MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
static LLVM_ABI MemoryLocation getForSource(const MemTransferInst *MTI)
Return a location representing the source of a memory transfer.
LocationSize Size
The maximum size of the location, in address-units, or UnknownSize if the size is not known.
static MemoryLocation getAfter(const Value *Ptr, const AAMDNodes &AATags=AAMDNodes())
Return a location that may access any location after Ptr, while remaining within the underlying objec...
const Value * Ptr
The address of the start of the location.
static LLVM_ABI MemoryLocation getForDest(const MemIntrinsic *MI)
Return a location representing the destination of a memory set or transfer.
static LLVM_ABI MemoryLocation getForArgument(const CallBase *Call, unsigned ArgIdx, const TargetLibraryInfo *TLI)
Return a location representing a particular argument of a call.
A Module instance is used to store all the information related to an LLVM module.
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Return a value (possibly void), from a function.
Analysis pass providing a never-invalidated alias analysis result.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
An instruction for storing to memory.
StringRef - Represent a constant reference to a string, i.e.
Analysis pass providing the TargetLibraryInfo.
Provides information about what library functions are available for the current target.
Triple - Helper class for working with autoconf configuration names.
Analysis pass providing a never-invalidated alias analysis result.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM_ABI bool isScalableTy(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this is a type whose size is a known multiple of vscale.
bool isPointerTy() const
True if this is an instance of PointerType.
LLVM_ABI unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
This function has undefined behavior.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
Abstract Attribute helper functions.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
bool isConstantAddressSpace(unsigned AS)
@ C
The default llvm calling convention, compatible with C.
@ BasicBlock
Various leaf nodes.
@ CE
Windows NT (Windows on ARM)
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
Value * GetPointerBaseWithConstantOffset(Value *Ptr, int64_t &Offset, const DataLayout &DL, bool AllowNonInbounds=true)
Analyze the specified pointer to see if it can be expressed as a base pointer plus a constant offset.
LLVM_ABI Value * FindAvailableLoadedValue(LoadInst *Load, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan=DefMaxInstsToScan, BatchAAResults *AA=nullptr, bool *IsLoadCSE=nullptr, unsigned *NumScanedInst=nullptr)
Scan backwards to see if we have the value of the given load available locally within a small number ...
LLVM_ABI Value * simplifyInstruction(Instruction *I, const SimplifyQuery &Q)
See if we can compute a simplified version of this instruction.
LLVM_ABI Constant * ConstantFoldConstant(const Constant *C, const DataLayout &DL, const TargetLibraryInfo *TLI=nullptr)
ConstantFoldConstant - Fold the constant using the specified DataLayout.
LLVM_ABI void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true, unsigned Depth=0)
Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOn...
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
void lintModule(const Module &M, bool AbortOnError=false)
Lint a module.
Definition Lint.cpp:770
LLVM_ABI cl::opt< unsigned > DefMaxInstsToScan
The default number of maximum instructions to scan in the block, used by FindAvailableLoadedValue().
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
@ Mod
The access may modify the value stored in memory.
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
Align commonAlignment(Align A, uint64_t Offset)
Returns the alignment that satisfies both alignments.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
LLVM_ABI Value * FindInsertedValue(Value *V, ArrayRef< unsigned > idx_range, std::optional< BasicBlock::iterator > InsertBefore=std::nullopt)
Given an aggregate and an sequence of indices, see if the scalar value indexed is already around as a...
LLVM_ABI const Value * getUnderlyingObject(const Value *V, unsigned MaxLookup=MaxLookupSearchDepth)
This method strips off any GEP address adjustments, pointer casts or llvm.threadlocal....
AAResults AliasAnalysis
Temporary typedef for legacy code that uses a generic AliasAnalysis pointer or reference.
void lintFunction(const Function &F, bool AbortOnError=false)
lintFunction - Check a function for errors, printing messages on stderr.
Definition Lint.cpp:750
bool isZero() const
Returns true if value is all zero.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)