LLVM 20.0.0git
|
#include "llvm/MC/MCExpr.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
Go to the source code of this file.
Namespaces | |
namespace | stats |
Macros | |
#define | DEBUG_TYPE "mcexpr" |
Functions | |
static void | AttemptToFoldSymbolOffsetDifference (const MCAssembler *Asm, const SectionAddrMap *Addrs, bool InSet, const MCSymbolRefExpr *&A, const MCSymbolRefExpr *&B, int64_t &Addend) |
Helper method for. | |
static bool | evaluateSymbolicAdd (const MCAssembler *Asm, const SectionAddrMap *Addrs, bool InSet, const MCValue &LHS, const MCValue &RHS, MCValue &Res) |
Evaluate the result of an add between (conceptually) two MCValues. | |
static bool | canExpand (const MCSymbol &Sym, bool InSet) |
#define DEBUG_TYPE "mcexpr" |
Definition at line 30 of file MCExpr.cpp.
|
static |
Helper method for.
Definition at line 589 of file MCExpr.cpp.
References A, B, DF, llvm::MCSymbol::getFragment(), llvm::MCFragment::getLayoutOrder(), llvm::MCFragment::getNext(), llvm::MCSymbol::getOffset(), llvm::MCFragment::getParent(), llvm::MCSection::hasInstructions(), llvm::MCSymbol::isUndefined(), llvm::MCSymbol::isVariable(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), llvm::Reverse, and std::swap().
Referenced by evaluateSymbolicAdd().
Definition at line 797 of file MCExpr.cpp.
References Sym, and llvm::MCSymbolRefExpr::VK_WEAKREF.
Referenced by llvm::MCExpr::evaluateAsRelocatableImpl().
|
static |
Evaluate the result of an add between (conceptually) two MCValues.
This routine conceptually attempts to construct an MCValue: Result = (Result_A - Result_B + Result_Cst) from two MCValue's LHS and RHS where Result = LHS + RHS and Result = (LHS_A - LHS_B + LHS_Cst) + (RHS_A - RHS_B + RHS_Cst).
This routine attempts to aggressively fold the operands such that the result is representable in an MCValue, but may not always succeed.
Definition at line 733 of file MCExpr.cpp.
References A, AttemptToFoldSymbolOffsetDifference(), B, llvm::MCValue::get(), LHS, and RHS.
Referenced by llvm::MCExpr::evaluateAsRelocatableImpl().