llvm/llvm/lib/IR/Instruction.cpp

//===-- Instruction.cpp - Implement the Instruction class -----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the Instruction class for the IR library.
//
//===----------------------------------------------------------------------===//

#include "llvm/IR/Instruction.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/IR/AttributeMask.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/MemoryModelRelaxationAnnotations.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/ProfDataUtils.h"
#include "llvm/IR/Type.h"
usingnamespacellvm;

InsertPosition::InsertPosition(Instruction *InsertBefore)
    :{}
InsertPosition::InsertPosition(BasicBlock *InsertAtEnd)
    :{}

Instruction::Instruction(Type *ty, unsigned it, AllocInfo AllocInfo,
                         InsertPosition InsertBefore)
    :{}

Instruction::~Instruction() {}

const Module *Instruction::getModule() const {}

const Function *Instruction::getFunction() const {}

const DataLayout &Instruction::getDataLayout() const {}

void Instruction::removeFromParent() {}

void Instruction::handleMarkerRemoval() {}

BasicBlock::iterator Instruction::eraseFromParent() {}

void Instruction::insertBefore(Instruction *InsertPos) {}

/// Insert an unlinked instruction into a basic block immediately before the
/// specified instruction.
void Instruction::insertBefore(BasicBlock::iterator InsertPos) {}

/// Insert an unlinked instruction into a basic block immediately after the
/// specified instruction.
void Instruction::insertAfter(Instruction *InsertPos) {}

BasicBlock::iterator Instruction::insertInto(BasicBlock *ParentBB,
                                             BasicBlock::iterator It) {}

extern cl::opt<bool> UseNewDbgInfoFormat;

void Instruction::insertBefore(BasicBlock &BB,
                               InstListType::iterator InsertPos) {}

/// Unlink this instruction from its current basic block and insert it into the
/// basic block that MovePos lives in, right before MovePos.
void Instruction::moveBefore(Instruction *MovePos) {}

void Instruction::moveBeforePreserving(Instruction *MovePos) {}

void Instruction::moveAfter(Instruction *MovePos) {}

void Instruction::moveAfterPreserving(Instruction *MovePos) {}

void Instruction::moveBefore(BasicBlock &BB, InstListType::iterator I) {}

void Instruction::moveBeforePreserving(BasicBlock &BB,
                                       InstListType::iterator I) {}

void Instruction::moveBeforeImpl(BasicBlock &BB, InstListType::iterator I,
                              bool Preserve) {}

iterator_range<DbgRecord::self_iterator> Instruction::cloneDebugInfoFrom(
    const Instruction *From, std::optional<DbgRecord::self_iterator> FromHere,
    bool InsertAtHead) {}

std::optional<DbgRecord::self_iterator>
Instruction::getDbgReinsertionPosition() {}

bool Instruction::hasDbgRecords() const {}

void Instruction::adoptDbgRecords(BasicBlock *BB, BasicBlock::iterator It,
                                  bool InsertAtHead) {}

void Instruction::dropDbgRecords() {}

void Instruction::dropOneDbgRecord(DbgRecord *DVR) {}

bool Instruction::comesBefore(const Instruction *Other) const {}

std::optional<BasicBlock::iterator> Instruction::getInsertionPointAfterDef() {}

bool Instruction::isOnlyUserOfAnyOperand() {}

void Instruction::setHasNoUnsignedWrap(bool b) {}

void Instruction::setHasNoSignedWrap(bool b) {}

void Instruction::setIsExact(bool b) {}

void Instruction::setNonNeg(bool b) {}

bool Instruction::hasNoUnsignedWrap() const {}

bool Instruction::hasNoSignedWrap() const {}

bool Instruction::hasNonNeg() const {}

bool Instruction::hasPoisonGeneratingFlags() const {}

void Instruction::dropPoisonGeneratingFlags() {}

bool Instruction::hasPoisonGeneratingMetadata() const {}

void Instruction::dropPoisonGeneratingMetadata() {}

bool Instruction::hasPoisonGeneratingReturnAttributes() const {}

void Instruction::dropPoisonGeneratingReturnAttributes() {}

void Instruction::dropUBImplyingAttrsAndUnknownMetadata(
    ArrayRef<unsigned> KnownIDs) {}

void Instruction::dropUBImplyingAttrsAndMetadata() {}

bool Instruction::isExact() const {}

void Instruction::setFast(bool B) {}

void Instruction::setHasAllowReassoc(bool B) {}

void Instruction::setHasNoNaNs(bool B) {}

void Instruction::setHasNoInfs(bool B) {}

void Instruction::setHasNoSignedZeros(bool B) {}

void Instruction::setHasAllowReciprocal(bool B) {}

void Instruction::setHasAllowContract(bool B) {}

void Instruction::setHasApproxFunc(bool B) {}

void Instruction::setFastMathFlags(FastMathFlags FMF) {}

void Instruction::copyFastMathFlags(FastMathFlags FMF) {}

bool Instruction::isFast() const {}

bool Instruction::hasAllowReassoc() const {}

bool Instruction::hasNoNaNs() const {}

bool Instruction::hasNoInfs() const {}

bool Instruction::hasNoSignedZeros() const {}

bool Instruction::hasAllowReciprocal() const {}

bool Instruction::hasAllowContract() const {}

bool Instruction::hasApproxFunc() const {}

FastMathFlags Instruction::getFastMathFlags() const {}

void Instruction::copyFastMathFlags(const Instruction *I) {}

void Instruction::copyIRFlags(const Value *V, bool IncludeWrapFlags) {}

void Instruction::andIRFlags(const Value *V) {}

const char *Instruction::getOpcodeName(unsigned OpCode) {}

/// This must be kept in sync with FunctionComparator::cmpOperations in
/// lib/Transforms/IPO/MergeFunctions.cpp.
bool Instruction::hasSameSpecialState(const Instruction *I2,
                                      bool IgnoreAlignment,
                                      bool IntersectAttrs) const {}

bool Instruction::isIdenticalTo(const Instruction *I) const {}

bool Instruction::isIdenticalToWhenDefined(const Instruction *I,
                                           bool IntersectAttrs) const {}

// Keep this in sync with FunctionComparator::cmpOperations in
// lib/Transforms/IPO/MergeFunctions.cpp.
bool Instruction::isSameOperationAs(const Instruction *I,
                                    unsigned flags) const {}

bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const {}

bool Instruction::mayReadFromMemory() const {}

bool Instruction::mayWriteToMemory() const {}

bool Instruction::isAtomic() const {}

bool Instruction::hasAtomicLoad() const {}

bool Instruction::hasAtomicStore() const {}

bool Instruction::isVolatile() const {}

Type *Instruction::getAccessType() const {}

static bool canUnwindPastLandingPad(const LandingPadInst *LP,
                                    bool IncludePhaseOneUnwind) {}

bool Instruction::mayThrow(bool IncludePhaseOneUnwind) const {}

bool Instruction::mayHaveSideEffects() const {}

bool Instruction::isSafeToRemove() const {}

bool Instruction::willReturn() const {}

bool Instruction::isLifetimeStartOrEnd() const {}

bool Instruction::isLaunderOrStripInvariantGroup() const {}

bool Instruction::isDebugOrPseudoInst() const {}

const Instruction *
Instruction::getNextNonDebugInstruction(bool SkipPseudoOp) const {}

const Instruction *
Instruction::getPrevNonDebugInstruction(bool SkipPseudoOp) const {}

const DebugLoc &Instruction::getStableDebugLoc() const {}

bool Instruction::isAssociative() const {}

bool Instruction::isCommutative() const {}

unsigned Instruction::getNumSuccessors() const {}

BasicBlock *Instruction::getSuccessor(unsigned idx) const {}

void Instruction::setSuccessor(unsigned idx, BasicBlock *B) {}

void Instruction::replaceSuccessorWith(BasicBlock *OldBB, BasicBlock *NewBB) {}

Instruction *Instruction::cloneImpl() const {}

void Instruction::swapProfMetadata() {}

void Instruction::copyMetadata(const Instruction &SrcInst,
                               ArrayRef<unsigned> WL) {}

Instruction *Instruction::clone() const {}