diff options
Diffstat (limited to 'gnu')
456 files changed, 0 insertions, 51225 deletions
diff --git a/gnu/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h b/gnu/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h deleted file mode 100644 index b455a6527bf..00000000000 --- a/gnu/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h +++ /dev/null @@ -1,104 +0,0 @@ -//===- OptimizationDiagnosticInfo.h - Optimization Diagnostic ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Optimization diagnostic interfaces. It's packaged as an analysis pass so -// that by using this service passes become dependent on BFI as well. BFI is -// used to compute the "hotness" of the diagnostic message. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_IR_OPTIMIZATIONDIAGNOSTICINFO_H -#define LLVM_IR_OPTIMIZATIONDIAGNOSTICINFO_H - -#include "llvm/ADT/Optional.h" -#include "llvm/IR/PassManager.h" -#include "llvm/Pass.h" - -namespace llvm { -class BlockFrequencyInfo; -class DebugLoc; -class Function; -class LLVMContext; -class Loop; -class Pass; -class Twine; -class Value; - -class OptimizationRemarkEmitter { -public: - OptimizationRemarkEmitter(Function *F, BlockFrequencyInfo *BFI) - : F(F), BFI(BFI) {} - - OptimizationRemarkEmitter(OptimizationRemarkEmitter &&Arg) - : F(Arg.F), BFI(Arg.BFI) {} - - OptimizationRemarkEmitter &operator=(OptimizationRemarkEmitter &&RHS) { - F = RHS.F; - BFI = RHS.BFI; - return *this; - } - - /// Emit an optimization-missed message. - /// - /// \p PassName is the name of the pass emitting the message. If - /// -Rpass-missed= is given and the name matches the regular expression in - /// -Rpass, then the remark will be emitted. \p Fn is the function triggering - /// the remark, \p DLoc is the debug location where the diagnostic is - /// generated. \p V is the IR Value that identifies the code region. \p Msg is - /// the message string to use. - void emitOptimizationRemarkMissed(const char *PassName, const DebugLoc &DLoc, - Value *V, const Twine &Msg); - - /// \brief Same as above but derives the IR Value for the code region and the - /// debug location from the Loop parameter \p L. - void emitOptimizationRemarkMissed(const char *PassName, Loop *L, - const Twine &Msg); - -private: - Function *F; - - BlockFrequencyInfo *BFI; - - Optional<uint64_t> computeHotness(Value *V); - - OptimizationRemarkEmitter(const OptimizationRemarkEmitter &) = delete; - void operator=(const OptimizationRemarkEmitter &) = delete; -}; - -class OptimizationRemarkEmitterWrapperPass : public FunctionPass { - std::unique_ptr<OptimizationRemarkEmitter> ORE; - -public: - OptimizationRemarkEmitterWrapperPass(); - - bool runOnFunction(Function &F) override; - - void getAnalysisUsage(AnalysisUsage &AU) const override; - - OptimizationRemarkEmitter &getORE() { - assert(ORE && "pass not run yet"); - return *ORE; - } - - static char ID; -}; - -class OptimizationRemarkEmitterAnalysis - : public AnalysisInfoMixin<OptimizationRemarkEmitterAnalysis> { - friend AnalysisInfoMixin<OptimizationRemarkEmitterAnalysis>; - static char PassID; - -public: - /// \brief Provide the result typedef for this analysis pass. - typedef OptimizationRemarkEmitter Result; - - /// \brief Run the analysis pass over a function and produce BFI. - Result run(Function &F, AnalysisManager<Function> &AM); -}; -} -#endif // LLVM_IR_OPTIMIZATIONDIAGNOSTICINFO_H diff --git a/gnu/llvm/include/llvm/BinaryFormat/WasmRelocs/WebAssembly.def b/gnu/llvm/include/llvm/BinaryFormat/WasmRelocs/WebAssembly.def deleted file mode 100644 index da64e025478..00000000000 --- a/gnu/llvm/include/llvm/BinaryFormat/WasmRelocs/WebAssembly.def +++ /dev/null @@ -1,13 +0,0 @@ - -#ifndef WASM_RELOC -#error "WASM_RELOC must be defined" -#endif - -WASM_RELOC(R_WEBASSEMBLY_FUNCTION_INDEX_LEB, 0) -WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_SLEB, 1) -WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_I32, 2) -WASM_RELOC(R_WEBASSEMBLY_GLOBAL_ADDR_LEB, 3) -WASM_RELOC(R_WEBASSEMBLY_GLOBAL_ADDR_SLEB, 4) -WASM_RELOC(R_WEBASSEMBLY_GLOBAL_ADDR_I32, 5) -WASM_RELOC(R_WEBASSEMBLY_TYPE_INDEX_LEB, 6) -WASM_RELOC(R_WEBASSEMBLY_GLOBAL_INDEX_LEB, 7) diff --git a/gnu/llvm/include/llvm/CodeGen/CommandFlags.h b/gnu/llvm/include/llvm/CodeGen/CommandFlags.h deleted file mode 100644 index 0d37dc00422..00000000000 --- a/gnu/llvm/include/llvm/CodeGen/CommandFlags.h +++ /dev/null @@ -1,380 +0,0 @@ -//===-- CommandFlags.h - Command Line Flags Interface -----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains codegen-specific flags that are shared between different -// command line tools. The tools "llc" and "opt" both use this file to prevent -// flag duplication. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CODEGEN_COMMANDFLAGS_H -#define LLVM_CODEGEN_COMMANDFLAGS_H - -#include "llvm/ADT/StringExtras.h" -#include "llvm/IR/Instructions.h" -#include "llvm/IR/Intrinsics.h" -#include "llvm/IR/Module.h" -#include "llvm/MC/MCTargetOptionsCommandFlags.h" -#include "llvm/MC/SubtargetFeature.h" -#include "llvm/Support/CodeGen.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Host.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetOptions.h" -#include "llvm/Target/TargetRecip.h" -#include <string> -using namespace llvm; - -cl::opt<std::string> -MArch("march", cl::desc("Architecture to generate code for (see --version)")); - -cl::opt<std::string> -MCPU("mcpu", - cl::desc("Target a specific cpu type (-mcpu=help for details)"), - cl::value_desc("cpu-name"), - cl::init("")); - -cl::list<std::string> -MAttrs("mattr", - cl::CommaSeparated, - cl::desc("Target specific attributes (-mattr=help for details)"), - cl::value_desc("a1,+a2,-a3,...")); - -cl::opt<Reloc::Model> -RelocModel("relocation-model", - cl::desc("Choose relocation model"), - cl::init(Reloc::Default), - cl::values( - clEnumValN(Reloc::Default, "default", - "Target default relocation model"), - clEnumValN(Reloc::Static, "static", - "Non-relocatable code"), - clEnumValN(Reloc::PIC_, "pic", - "Fully relocatable, position independent code"), - clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic", - "Relocatable external references, non-relocatable code"), - clEnumValEnd)); - -cl::opt<ThreadModel::Model> -TMModel("thread-model", - cl::desc("Choose threading model"), - cl::init(ThreadModel::POSIX), - cl::values(clEnumValN(ThreadModel::POSIX, "posix", - "POSIX thread model"), - clEnumValN(ThreadModel::Single, "single", - "Single thread model"), - clEnumValEnd)); - -cl::opt<llvm::CodeModel::Model> -CMModel("code-model", - cl::desc("Choose code model"), - cl::init(CodeModel::Default), - cl::values(clEnumValN(CodeModel::Default, "default", - "Target default code model"), - clEnumValN(CodeModel::Small, "small", - "Small code model"), - clEnumValN(CodeModel::Kernel, "kernel", - "Kernel code model"), - clEnumValN(CodeModel::Medium, "medium", - "Medium code model"), - clEnumValN(CodeModel::Large, "large", - "Large code model"), - clEnumValEnd)); - -cl::opt<TargetMachine::CodeGenFileType> -FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), - cl::desc("Choose a file type (not all types are supported by all targets):"), - cl::values( - clEnumValN(TargetMachine::CGFT_AssemblyFile, "asm", - "Emit an assembly ('.s') file"), - clEnumValN(TargetMachine::CGFT_ObjectFile, "obj", - "Emit a native object ('.o') file"), - clEnumValN(TargetMachine::CGFT_Null, "null", - "Emit nothing, for performance testing"), - clEnumValEnd)); - -cl::opt<bool> -EnableFPMAD("enable-fp-mad", - cl::desc("Enable less precise MAD instructions to be generated"), - cl::init(false)); - -cl::opt<bool> -DisableFPElim("disable-fp-elim", - cl::desc("Disable frame pointer elimination optimization"), - cl::init(false)); - -cl::opt<bool> -EnableUnsafeFPMath("enable-unsafe-fp-math", - cl::desc("Enable optimizations that may decrease FP precision"), - cl::init(false)); - -cl::opt<bool> -EnableNoInfsFPMath("enable-no-infs-fp-math", - cl::desc("Enable FP math optimizations that assume no +-Infs"), - cl::init(false)); - -cl::opt<bool> -EnableNoNaNsFPMath("enable-no-nans-fp-math", - cl::desc("Enable FP math optimizations that assume no NaNs"), - cl::init(false)); - -cl::opt<bool> -EnableHonorSignDependentRoundingFPMath("enable-sign-dependent-rounding-fp-math", - cl::Hidden, - cl::desc("Force codegen to assume rounding mode can change dynamically"), - cl::init(false)); - -cl::opt<llvm::FloatABI::ABIType> -FloatABIForCalls("float-abi", - cl::desc("Choose float ABI type"), - cl::init(FloatABI::Default), - cl::values( - clEnumValN(FloatABI::Default, "default", - "Target default float ABI type"), - clEnumValN(FloatABI::Soft, "soft", - "Soft float ABI (implied by -soft-float)"), - clEnumValN(FloatABI::Hard, "hard", - "Hard float ABI (uses FP registers)"), - clEnumValEnd)); - -cl::opt<llvm::FPOpFusion::FPOpFusionMode> -FuseFPOps("fp-contract", - cl::desc("Enable aggressive formation of fused FP ops"), - cl::init(FPOpFusion::Standard), - cl::values( - clEnumValN(FPOpFusion::Fast, "fast", - "Fuse FP ops whenever profitable"), - clEnumValN(FPOpFusion::Standard, "on", - "Only fuse 'blessed' FP ops."), - clEnumValN(FPOpFusion::Strict, "off", - "Only fuse FP ops when the result won't be affected."), - clEnumValEnd)); - -cl::list<std::string> -ReciprocalOps("recip", - cl::CommaSeparated, - cl::desc("Choose reciprocal operation types and parameters."), - cl::value_desc("all,none,default,divf,!vec-sqrtd,vec-divd:0,sqrt:9...")); - -cl::opt<bool> -DontPlaceZerosInBSS("nozero-initialized-in-bss", - cl::desc("Don't place zero-initialized symbols into bss section"), - cl::init(false)); - -cl::opt<bool> -EnableGuaranteedTailCallOpt("tailcallopt", - cl::desc("Turn fastcc calls into tail calls by (potentially) changing ABI."), - cl::init(false)); - -cl::opt<bool> -DisableTailCalls("disable-tail-calls", - cl::desc("Never emit tail calls"), - cl::init(false)); - -cl::opt<unsigned> -OverrideStackAlignment("stack-alignment", - cl::desc("Override default stack alignment"), - cl::init(0)); - -cl::opt<bool> -StackRealign("stackrealign", - cl::desc("Force align the stack to the minimum alignment"), - cl::init(false)); - -cl::opt<std::string> -TrapFuncName("trap-func", cl::Hidden, - cl::desc("Emit a call to trap function rather than a trap instruction"), - cl::init("")); - -cl::opt<bool> -EnablePIE("enable-pie", - cl::desc("Assume the creation of a position independent executable."), - cl::init(false)); - -cl::opt<bool> -UseCtors("use-ctors", - cl::desc("Use .ctors instead of .init_array."), - cl::init(false)); - -cl::opt<std::string> StopAfter("stop-after", - cl::desc("Stop compilation after a specific pass"), - cl::value_desc("pass-name"), - cl::init("")); -cl::opt<std::string> StartAfter("start-after", - cl::desc("Resume compilation after a specific pass"), - cl::value_desc("pass-name"), - cl::init("")); - -cl::opt<std::string> - RunPass("run-pass", cl::desc("Run compiler only for one specific pass"), - cl::value_desc("pass-name"), cl::init("")); - -cl::opt<bool> DataSections("data-sections", - cl::desc("Emit data into separate sections"), - cl::init(false)); - -cl::opt<bool> -FunctionSections("function-sections", - cl::desc("Emit functions into separate sections"), - cl::init(false)); - -cl::opt<bool> EmulatedTLS("emulated-tls", - cl::desc("Use emulated TLS model"), - cl::init(false)); - -cl::opt<bool> UniqueSectionNames("unique-section-names", - cl::desc("Give unique names to every section"), - cl::init(true)); - -cl::opt<llvm::JumpTable::JumpTableType> -JTableType("jump-table-type", - cl::desc("Choose the type of Jump-Instruction Table for jumptable."), - cl::init(JumpTable::Single), - cl::values( - clEnumValN(JumpTable::Single, "single", - "Create a single table for all jumptable functions"), - clEnumValN(JumpTable::Arity, "arity", - "Create one table per number of parameters."), - clEnumValN(JumpTable::Simplified, "simplified", - "Create one table per simplified function type."), - clEnumValN(JumpTable::Full, "full", - "Create one table per unique function type."), - clEnumValEnd)); - -cl::opt<llvm::EABI> EABIVersion( - "meabi", cl::desc("Set EABI type (default depends on triple):"), - cl::init(EABI::Default), - cl::values(clEnumValN(EABI::Default, "default", - "Triple default EABI version"), - clEnumValN(EABI::EABI4, "4", "EABI version 4"), - clEnumValN(EABI::EABI5, "5", "EABI version 5"), - clEnumValN(EABI::GNU, "gnu", "EABI GNU"), clEnumValEnd)); - -cl::opt<DebuggerKind> -DebuggerTuningOpt("debugger-tune", - cl::desc("Tune debug info for a particular debugger"), - cl::init(DebuggerKind::Default), - cl::values( - clEnumValN(DebuggerKind::GDB, "gdb", "gdb"), - clEnumValN(DebuggerKind::LLDB, "lldb", "lldb"), - clEnumValN(DebuggerKind::SCE, "sce", - "SCE targets (e.g. PS4)"), - clEnumValEnd)); - -// Common utility function tightly tied to the options listed here. Initializes -// a TargetOptions object with CodeGen flags and returns it. -static inline TargetOptions InitTargetOptionsFromCodeGenFlags() { - TargetOptions Options; - Options.LessPreciseFPMADOption = EnableFPMAD; - Options.AllowFPOpFusion = FuseFPOps; - Options.Reciprocals = TargetRecip(ReciprocalOps); - Options.UnsafeFPMath = EnableUnsafeFPMath; - Options.NoInfsFPMath = EnableNoInfsFPMath; - Options.NoNaNsFPMath = EnableNoNaNsFPMath; - Options.HonorSignDependentRoundingFPMathOption = - EnableHonorSignDependentRoundingFPMath; - if (FloatABIForCalls != FloatABI::Default) - Options.FloatABIType = FloatABIForCalls; - Options.NoZerosInBSS = DontPlaceZerosInBSS; - Options.GuaranteedTailCallOpt = EnableGuaranteedTailCallOpt; - Options.StackAlignmentOverride = OverrideStackAlignment; - Options.PositionIndependentExecutable = EnablePIE; - Options.UseInitArray = !UseCtors; - Options.DataSections = DataSections; - Options.FunctionSections = FunctionSections; - Options.UniqueSectionNames = UniqueSectionNames; - Options.EmulatedTLS = EmulatedTLS; - - Options.MCOptions = InitMCTargetOptionsFromFlags(); - Options.JTType = JTableType; - - Options.ThreadModel = TMModel; - Options.EABIVersion = EABIVersion; - Options.DebuggerTuning = DebuggerTuningOpt; - - return Options; -} - -static inline std::string getCPUStr() { - // If user asked for the 'native' CPU, autodetect here. If autodection fails, - // this will set the CPU to an empty string which tells the target to - // pick a basic default. - if (MCPU == "native") - return sys::getHostCPUName(); - - return MCPU; -} - -static inline std::string getFeaturesStr() { - SubtargetFeatures Features; - - // If user asked for the 'native' CPU, we need to autodetect features. - // This is necessary for x86 where the CPU might not support all the - // features the autodetected CPU name lists in the target. For example, - // not all Sandybridge processors support AVX. - if (MCPU == "native") { - StringMap<bool> HostFeatures; - if (sys::getHostCPUFeatures(HostFeatures)) - for (auto &F : HostFeatures) - Features.AddFeature(F.first(), F.second); - } - - for (unsigned i = 0; i != MAttrs.size(); ++i) - Features.AddFeature(MAttrs[i]); - - return Features.getString(); -} - -/// \brief Set function attributes of functions in Module M based on CPU, -/// Features, and command line flags. -static inline void setFunctionAttributes(StringRef CPU, StringRef Features, - Module &M) { - for (auto &F : M) { - auto &Ctx = F.getContext(); - AttributeSet Attrs = F.getAttributes(), NewAttrs; - - if (!CPU.empty()) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "target-cpu", CPU); - - if (!Features.empty()) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "target-features", Features); - - if (DisableFPElim.getNumOccurrences() > 0) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "no-frame-pointer-elim", - DisableFPElim ? "true" : "false"); - - if (DisableTailCalls.getNumOccurrences() > 0) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "disable-tail-calls", - toStringRef(DisableTailCalls)); - - if (StackRealign) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "stackrealign"); - - if (TrapFuncName.getNumOccurrences() > 0) - for (auto &B : F) - for (auto &I : B) - if (auto *Call = dyn_cast<CallInst>(&I)) - if (const auto *F = Call->getCalledFunction()) - if (F->getIntrinsicID() == Intrinsic::debugtrap || - F->getIntrinsicID() == Intrinsic::trap) - Call->addAttribute(llvm::AttributeSet::FunctionIndex, - "trap-func-name", TrapFuncName); - - // Let NewAttrs override Attrs. - NewAttrs = Attrs.addAttributes(Ctx, AttributeSet::FunctionIndex, NewAttrs); - F.setAttributes(NewAttrs); - } -} - -#endif diff --git a/gnu/llvm/include/llvm/CodeGen/GlobalISel/GISelAccessor.h b/gnu/llvm/include/llvm/CodeGen/GlobalISel/GISelAccessor.h deleted file mode 100644 index 7c5ec9f3adc..00000000000 --- a/gnu/llvm/include/llvm/CodeGen/GlobalISel/GISelAccessor.h +++ /dev/null @@ -1,33 +0,0 @@ -//===-- GISelAccessor.h - GISel Accessor ------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -/// This file declares the API to access the various APIs related -/// to GlobalISel. -// -//===----------------------------------------------------------------------===/ - -#ifndef LLVM_CODEGEN_GLOBALISEL_GISELACCESSOR_H -#define LLVM_CODEGEN_GLOBALISEL_GISELACCESSOR_H - -namespace llvm { -class CallLowering; -class RegisterBankInfo; - -/// The goal of this helper class is to gather the accessor to all -/// the APIs related to GlobalISel. -/// It should be derived to feature an actual accessor to the GISel APIs. -/// The reason why this is not simply done into the subtarget is to avoid -/// spreading ifdefs around. -struct GISelAccessor { - virtual ~GISelAccessor() {} - virtual const CallLowering *getCallLowering() const { return nullptr;} - virtual const RegisterBankInfo *getRegBankInfo() const { return nullptr;} -}; -} // End namespace llvm; -#endif diff --git a/gnu/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h b/gnu/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h deleted file mode 100644 index 87421e2f83b..00000000000 --- a/gnu/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ /dev/null @@ -1,449 +0,0 @@ -//===-- LiveIntervalAnalysis.h - Live Interval Analysis ---------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the LiveInterval analysis pass. Given some numbering of -// each the machine instructions (in this implemention depth-first order) an -// interval [i, j) is said to be a live interval for register v if there is no -// instruction with number j' > j such that v is live at j' and there is no -// instruction with number i' < i such that v is live at i'. In this -// implementation intervals can have holes, i.e. an interval might look like -// [1,20), [50,65), [1000,1001). -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CODEGEN_LIVEINTERVALANALYSIS_H -#define LLVM_CODEGEN_LIVEINTERVALANALYSIS_H - -#include "llvm/ADT/IndexedMap.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/CodeGen/LiveInterval.h" -#include "llvm/CodeGen/MachineBasicBlock.h" -#include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/CodeGen/SlotIndexes.h" -#include "llvm/Support/Allocator.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Target/TargetRegisterInfo.h" -#include <cmath> -#include <iterator> - -namespace llvm { - -extern cl::opt<bool> UseSegmentSetForPhysRegs; - - class BitVector; - class BlockFrequency; - class LiveRangeCalc; - class LiveVariables; - class MachineDominatorTree; - class MachineLoopInfo; - class TargetRegisterInfo; - class MachineRegisterInfo; - class TargetInstrInfo; - class TargetRegisterClass; - class VirtRegMap; - class MachineBlockFrequencyInfo; - - class LiveIntervals : public MachineFunctionPass { - MachineFunction* MF; - MachineRegisterInfo* MRI; - const TargetRegisterInfo* TRI; - const TargetInstrInfo* TII; - AliasAnalysis *AA; - SlotIndexes* Indexes; - MachineDominatorTree *DomTree; - LiveRangeCalc *LRCalc; - - /// Special pool allocator for VNInfo's (LiveInterval val#). - /// - VNInfo::Allocator VNInfoAllocator; - - /// Live interval pointers for all the virtual registers. - IndexedMap<LiveInterval*, VirtReg2IndexFunctor> VirtRegIntervals; - - /// RegMaskSlots - Sorted list of instructions with register mask operands. - /// Always use the 'r' slot, RegMasks are normal clobbers, not early - /// clobbers. - SmallVector<SlotIndex, 8> RegMaskSlots; - - /// RegMaskBits - This vector is parallel to RegMaskSlots, it holds a - /// pointer to the corresponding register mask. This pointer can be - /// recomputed as: - /// - /// MI = Indexes->getInstructionFromIndex(RegMaskSlot[N]); - /// unsigned OpNum = findRegMaskOperand(MI); - /// RegMaskBits[N] = MI->getOperand(OpNum).getRegMask(); - /// - /// This is kept in a separate vector partly because some standard - /// libraries don't support lower_bound() with mixed objects, partly to - /// improve locality when searching in RegMaskSlots. - /// Also see the comment in LiveInterval::find(). - SmallVector<const uint32_t*, 8> RegMaskBits; - - /// For each basic block number, keep (begin, size) pairs indexing into the - /// RegMaskSlots and RegMaskBits arrays. - /// Note that basic block numbers may not be layout contiguous, that's why - /// we can't just keep track of the first register mask in each basic - /// block. - SmallVector<std::pair<unsigned, unsigned>, 8> RegMaskBlocks; - - /// Keeps a live range set for each register unit to track fixed physreg - /// interference. - SmallVector<LiveRange*, 0> RegUnitRanges; - - public: - static char ID; // Pass identification, replacement for typeid - LiveIntervals(); - ~LiveIntervals() override; - - // Calculate the spill weight to assign to a single instruction. - static float getSpillWeight(bool isDef, bool isUse, - const MachineBlockFrequencyInfo *MBFI, - const MachineInstr *Instr); - - LiveInterval &getInterval(unsigned Reg) { - if (hasInterval(Reg)) - return *VirtRegIntervals[Reg]; - else - return createAndComputeVirtRegInterval(Reg); - } - - const LiveInterval &getInterval(unsigned Reg) const { - return const_cast<LiveIntervals*>(this)->getInterval(Reg); - } - - bool hasInterval(unsigned Reg) const { - return VirtRegIntervals.inBounds(Reg) && VirtRegIntervals[Reg]; - } - - // Interval creation. - LiveInterval &createEmptyInterval(unsigned Reg) { - assert(!hasInterval(Reg) && "Interval already exists!"); - VirtRegIntervals.grow(Reg); - VirtRegIntervals[Reg] = createInterval(Reg); - return *VirtRegIntervals[Reg]; - } - - LiveInterval &createAndComputeVirtRegInterval(unsigned Reg) { - LiveInterval &LI = createEmptyInterval(Reg); - computeVirtRegInterval(LI); - return LI; - } - - // Interval removal. - void removeInterval(unsigned Reg) { - delete VirtRegIntervals[Reg]; - VirtRegIntervals[Reg] = nullptr; - } - - /// Given a register and an instruction, adds a live segment from that - /// instruction to the end of its MBB. - LiveInterval::Segment addSegmentToEndOfBlock(unsigned reg, - MachineInstr* startInst); - - /// After removing some uses of a register, shrink its live range to just - /// the remaining uses. This method does not compute reaching defs for new - /// uses, and it doesn't remove dead defs. - /// Dead PHIDef values are marked as unused. New dead machine instructions - /// are added to the dead vector. Returns true if the interval may have been - /// separated into multiple connected components. - bool shrinkToUses(LiveInterval *li, - SmallVectorImpl<MachineInstr*> *dead = nullptr); - - /// Specialized version of - /// shrinkToUses(LiveInterval *li, SmallVectorImpl<MachineInstr*> *dead) - /// that works on a subregister live range and only looks at uses matching - /// the lane mask of the subregister range. - /// This may leave the subrange empty which needs to be cleaned up with - /// LiveInterval::removeEmptySubranges() afterwards. - void shrinkToUses(LiveInterval::SubRange &SR, unsigned Reg); - - /// extendToIndices - Extend the live range of LI to reach all points in - /// Indices. The points in the Indices array must be jointly dominated by - /// existing defs in LI. PHI-defs are added as needed to maintain SSA form. - /// - /// If a SlotIndex in Indices is the end index of a basic block, LI will be - /// extended to be live out of the basic block. - /// - /// See also LiveRangeCalc::extend(). - void extendToIndices(LiveRange &LR, ArrayRef<SlotIndex> Indices); - - - /// If @p LR has a live value at @p Kill, prune its live range by removing - /// any liveness reachable from Kill. Add live range end points to - /// EndPoints such that extendToIndices(LI, EndPoints) will reconstruct the - /// value's live range. - /// - /// Calling pruneValue() and extendToIndices() can be used to reconstruct - /// SSA form after adding defs to a virtual register. - void pruneValue(LiveRange &LR, SlotIndex Kill, - SmallVectorImpl<SlotIndex> *EndPoints); - - SlotIndexes *getSlotIndexes() const { - return Indexes; - } - - AliasAnalysis *getAliasAnalysis() const { - return AA; - } - - /// isNotInMIMap - returns true if the specified machine instr has been - /// removed or was never entered in the map. - bool isNotInMIMap(const MachineInstr* Instr) const { - return !Indexes->hasIndex(Instr); - } - - /// Returns the base index of the given instruction. - SlotIndex getInstructionIndex(const MachineInstr *instr) const { - return Indexes->getInstructionIndex(instr); - } - - /// Returns the instruction associated with the given index. - MachineInstr* getInstructionFromIndex(SlotIndex index) const { - return Indexes->getInstructionFromIndex(index); - } - - /// Return the first index in the given basic block. - SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const { - return Indexes->getMBBStartIdx(mbb); - } - - /// Return the last index in the given basic block. - SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const { - return Indexes->getMBBEndIdx(mbb); - } - - bool isLiveInToMBB(const LiveRange &LR, - const MachineBasicBlock *mbb) const { - return LR.liveAt(getMBBStartIdx(mbb)); - } - - bool isLiveOutOfMBB(const LiveRange &LR, - const MachineBasicBlock *mbb) const { - return LR.liveAt(getMBBEndIdx(mbb).getPrevSlot()); - } - - MachineBasicBlock* getMBBFromIndex(SlotIndex index) const { - return Indexes->getMBBFromIndex(index); - } - - void insertMBBInMaps(MachineBasicBlock *MBB) { - Indexes->insertMBBInMaps(MBB); - assert(unsigned(MBB->getNumber()) == RegMaskBlocks.size() && - "Blocks must be added in order."); - RegMaskBlocks.push_back(std::make_pair(RegMaskSlots.size(), 0)); - } - - SlotIndex InsertMachineInstrInMaps(MachineInstr *MI) { - return Indexes->insertMachineInstrInMaps(MI); - } - - void InsertMachineInstrRangeInMaps(MachineBasicBlock::iterator B, - MachineBasicBlock::iterator E) { - for (MachineBasicBlock::iterator I = B; I != E; ++I) - Indexes->insertMachineInstrInMaps(I); - } - - void RemoveMachineInstrFromMaps(MachineInstr *MI) { - Indexes->removeMachineInstrFromMaps(MI); - } - - void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) { - Indexes->replaceMachineInstrInMaps(MI, NewMI); - } - - VNInfo::Allocator& getVNInfoAllocator() { return VNInfoAllocator; } - - void getAnalysisUsage(AnalysisUsage &AU) const override; - void releaseMemory() override; - - /// runOnMachineFunction - pass entry point - bool runOnMachineFunction(MachineFunction&) override; - - /// print - Implement the dump method. - void print(raw_ostream &O, const Module* = nullptr) const override; - - /// intervalIsInOneMBB - If LI is confined to a single basic block, return - /// a pointer to that block. If LI is live in to or out of any block, - /// return NULL. - MachineBasicBlock *intervalIsInOneMBB(const LiveInterval &LI) const; - - /// Returns true if VNI is killed by any PHI-def values in LI. - /// This may conservatively return true to avoid expensive computations. - bool hasPHIKill(const LiveInterval &LI, const VNInfo *VNI) const; - - /// addKillFlags - Add kill flags to any instruction that kills a virtual - /// register. - void addKillFlags(const VirtRegMap*); - - /// handleMove - call this method to notify LiveIntervals that - /// instruction 'mi' has been moved within a basic block. This will update - /// the live intervals for all operands of mi. Moves between basic blocks - /// are not supported. - /// - /// \param UpdateFlags Update live intervals for nonallocatable physregs. - void handleMove(MachineInstr* MI, bool UpdateFlags = false); - - /// moveIntoBundle - Update intervals for operands of MI so that they - /// begin/end on the SlotIndex for BundleStart. - /// - /// \param UpdateFlags Update live intervals for nonallocatable physregs. - /// - /// Requires MI and BundleStart to have SlotIndexes, and assumes - /// existing liveness is accurate. BundleStart should be the first - /// instruction in the Bundle. - void handleMoveIntoBundle(MachineInstr* MI, MachineInstr* BundleStart, - bool UpdateFlags = false); - - /// repairIntervalsInRange - Update live intervals for instructions in a - /// range of iterators. It is intended for use after target hooks that may - /// insert or remove instructions, and is only efficient for a small number - /// of instructions. - /// - /// OrigRegs is a vector of registers that were originally used by the - /// instructions in the range between the two iterators. - /// - /// Currently, the only only changes that are supported are simple removal - /// and addition of uses. - void repairIntervalsInRange(MachineBasicBlock *MBB, - MachineBasicBlock::iterator Begin, - MachineBasicBlock::iterator End, - ArrayRef<unsigned> OrigRegs); - - // Register mask functions. - // - // Machine instructions may use a register mask operand to indicate that a - // large number of registers are clobbered by the instruction. This is - // typically used for calls. - // - // For compile time performance reasons, these clobbers are not recorded in - // the live intervals for individual physical registers. Instead, - // LiveIntervalAnalysis maintains a sorted list of instructions with - // register mask operands. - - /// getRegMaskSlots - Returns a sorted array of slot indices of all - /// instructions with register mask operands. - ArrayRef<SlotIndex> getRegMaskSlots() const { return RegMaskSlots; } - - /// getRegMaskSlotsInBlock - Returns a sorted array of slot indices of all - /// instructions with register mask operands in the basic block numbered - /// MBBNum. - ArrayRef<SlotIndex> getRegMaskSlotsInBlock(unsigned MBBNum) const { - std::pair<unsigned, unsigned> P = RegMaskBlocks[MBBNum]; - return getRegMaskSlots().slice(P.first, P.second); - } - - /// getRegMaskBits() - Returns an array of register mask pointers - /// corresponding to getRegMaskSlots(). - ArrayRef<const uint32_t*> getRegMaskBits() const { return RegMaskBits; } - - /// getRegMaskBitsInBlock - Returns an array of mask pointers corresponding - /// to getRegMaskSlotsInBlock(MBBNum). - ArrayRef<const uint32_t*> getRegMaskBitsInBlock(unsigned MBBNum) const { - std::pair<unsigned, unsigned> P = RegMaskBlocks[MBBNum]; - return getRegMaskBits().slice(P.first, P.second); - } - - /// checkRegMaskInterference - Test if LI is live across any register mask - /// instructions, and compute a bit mask of physical registers that are not - /// clobbered by any of them. - /// - /// Returns false if LI doesn't cross any register mask instructions. In - /// that case, the bit vector is not filled in. - bool checkRegMaskInterference(LiveInterval &LI, - BitVector &UsableRegs); - - // Register unit functions. - // - // Fixed interference occurs when MachineInstrs use physregs directly - // instead of virtual registers. This typically happens when passing - // arguments to a function call, or when instructions require operands in - // fixed registers. - // - // Each physreg has one or more register units, see MCRegisterInfo. We - // track liveness per register unit to handle aliasing registers more - // efficiently. - - /// getRegUnit - Return the live range for Unit. - /// It will be computed if it doesn't exist. - LiveRange &getRegUnit(unsigned Unit) { - LiveRange *LR = RegUnitRanges[Unit]; - if (!LR) { - // Compute missing ranges on demand. - // Use segment set to speed-up initial computation of the live range. - RegUnitRanges[Unit] = LR = new LiveRange(UseSegmentSetForPhysRegs); - computeRegUnitRange(*LR, Unit); - } - return *LR; - } - - /// getCachedRegUnit - Return the live range for Unit if it has already - /// been computed, or NULL if it hasn't been computed yet. - LiveRange *getCachedRegUnit(unsigned Unit) { - return RegUnitRanges[Unit]; - } - - const LiveRange *getCachedRegUnit(unsigned Unit) const { - return RegUnitRanges[Unit]; - } - - /// Remove value numbers and related live segments starting at position - /// @p Pos that are part of any liverange of physical register @p Reg or one - /// of its subregisters. - void removePhysRegDefAt(unsigned Reg, SlotIndex Pos); - - /// Remove value number and related live segments of @p LI and its subranges - /// that start at position @p Pos. - void removeVRegDefAt(LiveInterval &LI, SlotIndex Pos); - - /// Split separate components in LiveInterval \p LI into separate intervals. - void splitSeparateComponents(LiveInterval &LI, - SmallVectorImpl<LiveInterval*> &SplitLIs); - - private: - /// Compute live intervals for all virtual registers. - void computeVirtRegs(); - - /// Compute RegMaskSlots and RegMaskBits. - void computeRegMasks(); - - /// Walk the values in @p LI and check for dead values: - /// - Dead PHIDef values are marked as unused. - /// - Dead operands are marked as such. - /// - Completely dead machine instructions are added to the @p dead vector - /// if it is not nullptr. - /// Returns true if any PHI value numbers have been removed which may - /// have separated the interval into multiple connected components. - bool computeDeadValues(LiveInterval &LI, - SmallVectorImpl<MachineInstr*> *dead); - - static LiveInterval* createInterval(unsigned Reg); - - void printInstrs(raw_ostream &O) const; - void dumpInstrs() const; - - void computeLiveInRegUnits(); - void computeRegUnitRange(LiveRange&, unsigned Unit); - void computeVirtRegInterval(LiveInterval&); - - - /// Helper function for repairIntervalsInRange(), walks backwards and - /// creates/modifies live segments in @p LR to match the operands found. - /// Only full operands or operands with subregisters matching @p LaneMask - /// are considered. - void repairOldRegInRange(MachineBasicBlock::iterator Begin, - MachineBasicBlock::iterator End, - const SlotIndex endIdx, LiveRange &LR, - unsigned Reg, LaneBitmask LaneMask = ~0u); - - class HMEditor; - }; -} // End llvm namespace - -#endif diff --git a/gnu/llvm/include/llvm/CodeGen/LiveStackAnalysis.h b/gnu/llvm/include/llvm/CodeGen/LiveStackAnalysis.h deleted file mode 100644 index 3ffbe3d775b..00000000000 --- a/gnu/llvm/include/llvm/CodeGen/LiveStackAnalysis.h +++ /dev/null @@ -1,98 +0,0 @@ -//===-- LiveStackAnalysis.h - Live Stack Slot Analysis ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the live stack slot analysis pass. It is analogous to -// live interval analysis except it's analyzing liveness of stack slots rather -// than registers. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CODEGEN_LIVESTACKANALYSIS_H -#define LLVM_CODEGEN_LIVESTACKANALYSIS_H - -#include "llvm/CodeGen/LiveInterval.h" -#include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/Support/Allocator.h" -#include "llvm/Target/TargetRegisterInfo.h" -#include <map> -#include <unordered_map> - -namespace llvm { - -class LiveStacks : public MachineFunctionPass { - const TargetRegisterInfo *TRI; - - /// Special pool allocator for VNInfo's (LiveInterval val#). - /// - VNInfo::Allocator VNInfoAllocator; - - /// S2IMap - Stack slot indices to live interval mapping. - /// - typedef std::unordered_map<int, LiveInterval> SS2IntervalMap; - SS2IntervalMap S2IMap; - - /// S2RCMap - Stack slot indices to register class mapping. - std::map<int, const TargetRegisterClass *> S2RCMap; - -public: - static char ID; // Pass identification, replacement for typeid - LiveStacks() : MachineFunctionPass(ID) { - initializeLiveStacksPass(*PassRegistry::getPassRegistry()); - } - - typedef SS2IntervalMap::iterator iterator; - typedef SS2IntervalMap::const_iterator const_iterator; - const_iterator begin() const { return S2IMap.begin(); } - const_iterator end() const { return S2IMap.end(); } - iterator begin() { return S2IMap.begin(); } - iterator end() { return S2IMap.end(); } - - unsigned getNumIntervals() const { return (unsigned)S2IMap.size(); } - - LiveInterval &getOrCreateInterval(int Slot, const TargetRegisterClass *RC); - - LiveInterval &getInterval(int Slot) { - assert(Slot >= 0 && "Spill slot indice must be >= 0"); - SS2IntervalMap::iterator I = S2IMap.find(Slot); - assert(I != S2IMap.end() && "Interval does not exist for stack slot"); - return I->second; - } - - const LiveInterval &getInterval(int Slot) const { - assert(Slot >= 0 && "Spill slot indice must be >= 0"); - SS2IntervalMap::const_iterator I = S2IMap.find(Slot); - assert(I != S2IMap.end() && "Interval does not exist for stack slot"); - return I->second; - } - - bool hasInterval(int Slot) const { return S2IMap.count(Slot); } - - const TargetRegisterClass *getIntervalRegClass(int Slot) const { - assert(Slot >= 0 && "Spill slot indice must be >= 0"); - std::map<int, const TargetRegisterClass *>::const_iterator I = - S2RCMap.find(Slot); - assert(I != S2RCMap.end() && - "Register class info does not exist for stack slot"); - return I->second; - } - - VNInfo::Allocator &getVNInfoAllocator() { return VNInfoAllocator; } - - void getAnalysisUsage(AnalysisUsage &AU) const override; - void releaseMemory() override; - - /// runOnMachineFunction - pass entry point - bool runOnMachineFunction(MachineFunction &) override; - - /// print - Implement the dump method. - void print(raw_ostream &O, const Module * = nullptr) const override; -}; -} - -#endif /* LLVM_CODEGEN_LIVESTACK_ANALYSIS_H */ diff --git a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeName.h b/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeName.h deleted file mode 100644 index a987b4afd28..00000000000 --- a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeName.h +++ /dev/null @@ -1,22 +0,0 @@ -//===- TypeName.h --------------------------------------------- *- C++ --*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPENAME_H -#define LLVM_DEBUGINFO_CODEVIEW_TYPENAME_H - -#include "llvm/DebugInfo/CodeView/TypeCollection.h" -#include "llvm/DebugInfo/CodeView/TypeIndex.h" - -namespace llvm { -namespace codeview { -std::string computeTypeName(TypeCollection &Types, TypeIndex Index); -} -} // namespace llvm - -#endif diff --git a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeRecordBuilder.h b/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeRecordBuilder.h deleted file mode 100644 index 1f48cf70666..00000000000 --- a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeRecordBuilder.h +++ /dev/null @@ -1,57 +0,0 @@ -//===- TypeRecordBuilder.h --------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPERECORDBUILDER_H -#define LLVM_DEBUGINFO_CODEVIEW_TYPERECORDBUILDER_H - -#include "llvm/DebugInfo/CodeView/CodeView.h" -#include "llvm/DebugInfo/CodeView/TypeIndex.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/EndianStream.h" -#include "llvm/Support/raw_ostream.h" - -namespace llvm { -namespace codeview { - -class TypeRecordBuilder { -private: - TypeRecordBuilder(const TypeRecordBuilder &) = delete; - TypeRecordBuilder &operator=(const TypeRecordBuilder &) = delete; - -public: - explicit TypeRecordBuilder(TypeRecordKind Kind); - - void writeUInt8(uint8_t Value); - void writeInt16(int16_t Value); - void writeUInt16(uint16_t Value); - void writeInt32(int32_t Value); - void writeUInt32(uint32_t Value); - void writeInt64(int64_t Value); - void writeUInt64(uint64_t Value); - void writeTypeIndex(TypeIndex TypeInd); - void writeTypeRecordKind(TypeRecordKind Kind); - void writeEncodedInteger(int64_t Value); - void writeEncodedSignedInteger(int64_t Value); - void writeEncodedUnsignedInteger(uint64_t Value); - void writeNullTerminatedString(const char *Value); - void writeNullTerminatedString(StringRef Value); - - llvm::StringRef str(); - - uint64_t size() const { return Stream.tell(); } - -private: - llvm::SmallVector<char, 256> Buffer; - llvm::raw_svector_ostream Stream; - llvm::support::endian::Writer<llvm::support::endianness::little> Writer; -}; -} -} - -#endif diff --git a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeSerializer.h b/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeSerializer.h deleted file mode 100644 index e0592219463..00000000000 --- a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeSerializer.h +++ /dev/null @@ -1,140 +0,0 @@ -//===- TypeSerializer.h -----------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPESERIALIZER_H -#define LLVM_DEBUGINFO_CODEVIEW_TYPESERIALIZER_H - -#include "llvm/DebugInfo/CodeView/TypeRecordMapping.h" -#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" - -#include "llvm/ADT/Optional.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Allocator.h" -#include "llvm/Support/Error.h" - -namespace llvm { - -namespace codeview { - -class TypeSerializer : public TypeVisitorCallbacks { - struct SubRecord { - SubRecord(TypeLeafKind K, uint32_t S) : Kind(K), Size(S) {} - - TypeLeafKind Kind; - uint32_t Size = 0; - }; - struct RecordSegment { - SmallVector<SubRecord, 16> SubRecords; - - uint32_t length() const { - uint32_t L = sizeof(RecordPrefix); - for (const auto &R : SubRecords) { - L += R.Size; - } - return L; - } - }; - - typedef SmallVector<MutableArrayRef<uint8_t>, 2> RecordList; - - static constexpr uint8_t ContinuationLength = 8; - BumpPtrAllocator &RecordStorage; - RecordSegment CurrentSegment; - RecordList FieldListSegments; - - TypeIndex LastTypeIndex; - Optional<TypeLeafKind> TypeKind; - Optional<TypeLeafKind> MemberKind; - std::vector<uint8_t> RecordBuffer; - msf::MutableByteStream Stream; - msf::StreamWriter Writer; - TypeRecordMapping Mapping; - - RecordList SeenRecords; - StringMap<TypeIndex> HashedRecords; - - bool isInFieldList() const; - TypeIndex calcNextTypeIndex() const; - TypeIndex incrementTypeIndex(); - MutableArrayRef<uint8_t> getCurrentSubRecordData(); - MutableArrayRef<uint8_t> getCurrentRecordData(); - Error writeRecordPrefix(TypeLeafKind Kind); - TypeIndex insertRecordBytesPrivate(MutableArrayRef<uint8_t> Record); - - Expected<MutableArrayRef<uint8_t>> - addPadding(MutableArrayRef<uint8_t> Record); - -public: - explicit TypeSerializer(BumpPtrAllocator &Storage); - - ArrayRef<MutableArrayRef<uint8_t>> records() const; - TypeIndex getLastTypeIndex() const; - TypeIndex insertRecordBytes(MutableArrayRef<uint8_t> Record); - Expected<TypeIndex> visitTypeEndGetIndex(CVType &Record); - - Error visitTypeBegin(CVType &Record) override; - Error visitTypeEnd(CVType &Record) override; - Error visitMemberBegin(CVMemberRecord &Record) override; - Error visitMemberEnd(CVMemberRecord &Record) override; - -#define TYPE_RECORD(EnumName, EnumVal, Name) \ - virtual Error visitKnownRecord(CVType &CVR, Name##Record &Record) override { \ - return visitKnownRecordImpl(CVR, Record); \ - } -#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) -#define MEMBER_RECORD(EnumName, EnumVal, Name) \ - Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override { \ - return visitKnownMemberImpl<Name##Record>(CVR, Record); \ - } -#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) -#include "llvm/DebugInfo/CodeView/TypeRecords.def" - -private: - template <typename RecordKind> - Error visitKnownRecordImpl(CVType &CVR, RecordKind &Record) { - return Mapping.visitKnownRecord(CVR, Record); - } - - template <typename RecordType> - Error visitKnownMemberImpl(CVMemberRecord &CVR, RecordType &Record) { - assert(CVR.Kind == static_cast<TypeLeafKind>(Record.getKind())); - - if (auto EC = Writer.writeEnum(CVR.Kind)) - return EC; - - if (auto EC = Mapping.visitKnownMember(CVR, Record)) - return EC; - - // Get all the data that was just written and is yet to be committed to - // the current segment. Then pad it to 4 bytes. - MutableArrayRef<uint8_t> ThisRecord = getCurrentSubRecordData(); - auto ExpectedRecord = addPadding(ThisRecord); - if (!ExpectedRecord) - return ExpectedRecord.takeError(); - ThisRecord = *ExpectedRecord; - - CurrentSegment.SubRecords.emplace_back(CVR.Kind, ThisRecord.size()); - CVR.Data = ThisRecord; - - // Both the last subrecord and the total length of this segment should be - // multiples of 4. - assert(ThisRecord.size() % 4 == 0); - assert(CurrentSegment.length() % 4 == 0); - - return Error::success(); - } -}; -} -} - -#endif diff --git a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h b/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h deleted file mode 100644 index 2c950e8af79..00000000000 --- a/gnu/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h +++ /dev/null @@ -1,60 +0,0 @@ -//===- TypeTableBuilder.h ---------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H -#define LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H - -#include "llvm/ADT/StringRef.h" -#include "llvm/DebugInfo/CodeView/CodeView.h" -#include "llvm/DebugInfo/CodeView/TypeIndex.h" -#include "llvm/DebugInfo/CodeView/TypeRecord.h" -#include "llvm/Support/Compiler.h" - -namespace llvm { -namespace codeview { - -class FieldListRecordBuilder; -class MethodListRecordBuilder; -class TypeRecordBuilder; - -class TypeTableBuilder { -private: - TypeTableBuilder(const TypeTableBuilder &) = delete; - TypeTableBuilder &operator=(const TypeTableBuilder &) = delete; - -protected: - TypeTableBuilder(); - -public: - virtual ~TypeTableBuilder(); - -public: - TypeIndex writeModifier(const ModifierRecord &Record); - TypeIndex writeProcedure(const ProcedureRecord &Record); - TypeIndex writeMemberFunction(const MemberFunctionRecord &Record); - TypeIndex writeArgumentList(const ArgumentListRecord &Record); - TypeIndex writeRecord(TypeRecordBuilder &builder); - TypeIndex writePointer(const PointerRecord &Record); - TypeIndex writePointerToMember(const PointerToMemberRecord &Record); - TypeIndex writeArray(const ArrayRecord &Record); - TypeIndex writeAggregate(const AggregateRecord &Record); - TypeIndex writeEnum(const EnumRecord &Record); - TypeIndex writeBitField(const BitFieldRecord &Record); - TypeIndex writeVirtualTableShape(const VirtualTableShapeRecord &Record); - - TypeIndex writeFieldList(FieldListRecordBuilder &FieldList); - TypeIndex writeMethodList(MethodListRecordBuilder &MethodList); - -private: - virtual TypeIndex writeRecord(llvm::StringRef record) = 0; -}; -} -} - -#endif diff --git a/gnu/llvm/include/llvm/DebugInfo/MSF/MSFStreamLayout.h b/gnu/llvm/include/llvm/DebugInfo/MSF/MSFStreamLayout.h deleted file mode 100644 index bdde98f5266..00000000000 --- a/gnu/llvm/include/llvm/DebugInfo/MSF/MSFStreamLayout.h +++ /dev/null @@ -1,35 +0,0 @@ -//===- MSFStreamLayout.h - Describes the layout of a stream -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DEBUGINFO_MSF_MSFSTREAMLAYOUT_H -#define LLVM_DEBUGINFO_MSF_MSFSTREAMLAYOUT_H - -#include "llvm/Support/Endian.h" - -#include <cstdint> -#include <vector> - -namespace llvm { -namespace msf { - -/// \brief Describes the layout of a stream in an MSF layout. A "stream" here -/// is defined as any logical unit of data which may be arranged inside the MSF -/// file as a sequence of (possibly discontiguous) blocks. When we want to read -/// from a particular MSF Stream, we fill out a stream layout structure and the -/// reader uses it to determine which blocks in the underlying MSF file contain -/// the data, so that it can be pieced together in the right order. -class MSFStreamLayout { -public: - uint32_t Length; - std::vector<support::ulittle32_t> Blocks; -}; -} // namespace msf -} // namespace llvm - -#endif // LLVM_DEBUGINFO_MSF_MSFSTREAMLAYOUT_H diff --git a/gnu/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.h b/gnu/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.h deleted file mode 100644 index 5ab57ebef53..00000000000 --- a/gnu/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.h +++ /dev/null @@ -1,54 +0,0 @@ -//===- PublicsStreamBuilder.h - PDB Publics Stream Creation -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBPUBLICSTREAMBUILDER_H -#define LLVM_DEBUGINFO_PDB_RAW_PDBPUBLICSTREAMBUILDER_H - -#include "llvm/DebugInfo/PDB/Native/RawConstants.h" -#include "llvm/DebugInfo/PDB/Native/RawTypes.h" -#include "llvm/Support/BinaryByteStream.h" -#include "llvm/Support/BinaryStreamRef.h" -#include "llvm/Support/BinaryStreamWriter.h" -#include "llvm/Support/Endian.h" -#include "llvm/Support/Error.h" - -namespace llvm { -namespace msf { -class MSFBuilder; -} -namespace pdb { -class PublicsStream; -struct PublicsStreamHeader; - -class PublicsStreamBuilder { -public: - explicit PublicsStreamBuilder(msf::MSFBuilder &Msf); - ~PublicsStreamBuilder(); - - PublicsStreamBuilder(const PublicsStreamBuilder &) = delete; - PublicsStreamBuilder &operator=(const PublicsStreamBuilder &) = delete; - - Error finalizeMsfLayout(); - uint32_t calculateSerializedLength() const; - - Error commit(BinaryStreamWriter &PublicsWriter); - - uint32_t getStreamIndex() const { return StreamIdx; } - uint32_t getRecordStreamIdx() const { return RecordStreamIdx; } - -private: - uint32_t StreamIdx = kInvalidStreamIndex; - uint32_t RecordStreamIdx = kInvalidStreamIndex; - std::vector<PSHashRecord> HashRecords; - msf::MSFBuilder &Msf; -}; -} // namespace pdb -} // namespace llvm - -#endif diff --git a/gnu/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h b/gnu/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h deleted file mode 100644 index 5180208d33b..00000000000 --- a/gnu/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h +++ /dev/null @@ -1,74 +0,0 @@ -//===-- MCTargetOptionsCommandFlags.h --------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains machine code-specific flags that are shared between -// different command line tools. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H -#define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H - -#include "llvm/MC/MCTargetOptions.h" -#include "llvm/Support/CommandLine.h" -using namespace llvm; - -cl::opt<MCTargetOptions::AsmInstrumentation> AsmInstrumentation( - "asm-instrumentation", cl::desc("Instrumentation of inline assembly and " - "assembly source files"), - cl::init(MCTargetOptions::AsmInstrumentationNone), - cl::values(clEnumValN(MCTargetOptions::AsmInstrumentationNone, "none", - "no instrumentation at all"), - clEnumValN(MCTargetOptions::AsmInstrumentationAddress, "address", - "instrument instructions with memory arguments"), - clEnumValEnd)); - -cl::opt<bool> RelaxAll("mc-relax-all", - cl::desc("When used with filetype=obj, " - "relax all fixups in the emitted object file")); - -cl::opt<bool> IncrementalLinkerCompatible( - "incremental-linker-compatible", - cl::desc( - "When used with filetype=obj, " - "emit an object file which can be used with an incremental linker")); - -cl::opt<int> DwarfVersion("dwarf-version", cl::desc("Dwarf version"), - cl::init(0)); - -cl::opt<bool> ShowMCInst("asm-show-inst", - cl::desc("Emit internal instruction representation to " - "assembly file")); - -cl::opt<bool> FatalWarnings("fatal-warnings", - cl::desc("Treat warnings as errors")); - -cl::opt<bool> NoWarn("no-warn", cl::desc("Suppress all warnings")); -cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn)); - -cl::opt<std::string> -ABIName("target-abi", cl::Hidden, - cl::desc("The name of the ABI to be targeted from the backend."), - cl::init("")); - -static inline MCTargetOptions InitMCTargetOptionsFromFlags() { - MCTargetOptions Options; - Options.SanitizeAddress = - (AsmInstrumentation == MCTargetOptions::AsmInstrumentationAddress); - Options.MCRelaxAll = RelaxAll; - Options.MCIncrementalLinkerCompatible = IncrementalLinkerCompatible; - Options.DwarfVersion = DwarfVersion; - Options.ShowMCInst = ShowMCInst; - Options.ABIName = ABIName; - Options.MCFatalWarnings = FatalWarnings; - Options.MCNoWarn = NoWarn; - return Options; -} - -#endif diff --git a/gnu/llvm/include/llvm/Support/AMDGPUCodeObjectMetadata.h b/gnu/llvm/include/llvm/Support/AMDGPUCodeObjectMetadata.h deleted file mode 100644 index d274c5ee918..00000000000 --- a/gnu/llvm/include/llvm/Support/AMDGPUCodeObjectMetadata.h +++ /dev/null @@ -1,422 +0,0 @@ -//===--- AMDGPUCodeObjectMetadata.h -----------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -/// \file -/// \brief AMDGPU Code Object Metadata definitions and in-memory -/// representations. -/// -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_AMDGPUCODEOBJECTMETADATA_H -#define LLVM_SUPPORT_AMDGPUCODEOBJECTMETADATA_H - -#include <cstdint> -#include <string> -#include <system_error> -#include <vector> - -namespace llvm { -namespace AMDGPU { - -//===----------------------------------------------------------------------===// -// Code Object Metadata. -//===----------------------------------------------------------------------===// -namespace CodeObject { - -/// \brief Code object metadata major version. -constexpr uint32_t MetadataVersionMajor = 1; -/// \brief Code object metadata minor version. -constexpr uint32_t MetadataVersionMinor = 0; - -/// \brief Code object metadata beginning assembler directive. -constexpr char MetadataAssemblerDirectiveBegin[] = - ".amdgpu_code_object_metadata"; -/// \brief Code object metadata ending assembler directive. -constexpr char MetadataAssemblerDirectiveEnd[] = - ".end_amdgpu_code_object_metadata"; - -/// \brief Access qualifiers. -enum class AccessQualifier : uint8_t { - Default = 0, - ReadOnly = 1, - WriteOnly = 2, - ReadWrite = 3, - Unknown = 0xff -}; - -/// \brief Address space qualifiers. -enum class AddressSpaceQualifier : uint8_t { - Private = 0, - Global = 1, - Constant = 2, - Local = 3, - Generic = 4, - Region = 5, - Unknown = 0xff -}; - -/// \brief Value kinds. -enum class ValueKind : uint8_t { - ByValue = 0, - GlobalBuffer = 1, - DynamicSharedPointer = 2, - Sampler = 3, - Image = 4, - Pipe = 5, - Queue = 6, - HiddenGlobalOffsetX = 7, - HiddenGlobalOffsetY = 8, - HiddenGlobalOffsetZ = 9, - HiddenNone = 10, - HiddenPrintfBuffer = 11, - HiddenDefaultQueue = 12, - HiddenCompletionAction = 13, - Unknown = 0xff -}; - -/// \brief Value types. -enum class ValueType : uint8_t { - Struct = 0, - I8 = 1, - U8 = 2, - I16 = 3, - U16 = 4, - F16 = 5, - I32 = 6, - U32 = 7, - F32 = 8, - I64 = 9, - U64 = 10, - F64 = 11, - Unknown = 0xff -}; - -//===----------------------------------------------------------------------===// -// Kernel Metadata. -//===----------------------------------------------------------------------===// -namespace Kernel { - -//===----------------------------------------------------------------------===// -// Kernel Attributes Metadata. -//===----------------------------------------------------------------------===// -namespace Attrs { - -namespace Key { -/// \brief Key for Kernel::Attr::Metadata::mReqdWorkGroupSize. -constexpr char ReqdWorkGroupSize[] = "ReqdWorkGroupSize"; -/// \brief Key for Kernel::Attr::Metadata::mWorkGroupSizeHint. -constexpr char WorkGroupSizeHint[] = "WorkGroupSizeHint"; -/// \brief Key for Kernel::Attr::Metadata::mVecTypeHint. -constexpr char VecTypeHint[] = "VecTypeHint"; -} // end namespace Key - -/// \brief In-memory representation of kernel attributes metadata. -struct Metadata final { - /// \brief 'reqd_work_group_size' attribute. Optional. - std::vector<uint32_t> mReqdWorkGroupSize = std::vector<uint32_t>(); - /// \brief 'work_group_size_hint' attribute. Optional. - std::vector<uint32_t> mWorkGroupSizeHint = std::vector<uint32_t>(); - /// \brief 'vec_type_hint' attribute. Optional. - std::string mVecTypeHint = std::string(); - - /// \brief Default constructor. - Metadata() = default; - - /// \returns True if kernel attributes metadata is empty, false otherwise. - bool empty() const { - return mReqdWorkGroupSize.empty() && - mWorkGroupSizeHint.empty() && - mVecTypeHint.empty(); - } - - /// \returns True if kernel attributes metadata is not empty, false otherwise. - bool notEmpty() const { - return !empty(); - } -}; - -} // end namespace Attrs - -//===----------------------------------------------------------------------===// -// Kernel Argument Metadata. -//===----------------------------------------------------------------------===// -namespace Arg { - -namespace Key { -/// \brief Key for Kernel::Arg::Metadata::mSize. -constexpr char Size[] = "Size"; -/// \brief Key for Kernel::Arg::Metadata::mAlign. -constexpr char Align[] = "Align"; -/// \brief Key for Kernel::Arg::Metadata::mValueKind. -constexpr char ValueKind[] = "ValueKind"; -/// \brief Key for Kernel::Arg::Metadata::mValueType. -constexpr char ValueType[] = "ValueType"; -/// \brief Key for Kernel::Arg::Metadata::mPointeeAlign. -constexpr char PointeeAlign[] = "PointeeAlign"; -/// \brief Key for Kernel::Arg::Metadata::mAccQual. -constexpr char AccQual[] = "AccQual"; -/// \brief Key for Kernel::Arg::Metadata::mAddrSpaceQual. -constexpr char AddrSpaceQual[] = "AddrSpaceQual"; -/// \brief Key for Kernel::Arg::Metadata::mIsConst. -constexpr char IsConst[] = "IsConst"; -/// \brief Key for Kernel::Arg::Metadata::mIsPipe. -constexpr char IsPipe[] = "IsPipe"; -/// \brief Key for Kernel::Arg::Metadata::mIsRestrict. -constexpr char IsRestrict[] = "IsRestrict"; -/// \brief Key for Kernel::Arg::Metadata::mIsVolatile. -constexpr char IsVolatile[] = "IsVolatile"; -/// \brief Key for Kernel::Arg::Metadata::mName. -constexpr char Name[] = "Name"; -/// \brief Key for Kernel::Arg::Metadata::mTypeName. -constexpr char TypeName[] = "TypeName"; -} // end namespace Key - -/// \brief In-memory representation of kernel argument metadata. -struct Metadata final { - /// \brief Size in bytes. Required. - uint32_t mSize = 0; - /// \brief Alignment in bytes. Required. - uint32_t mAlign = 0; - /// \brief Value kind. Required. - ValueKind mValueKind = ValueKind::Unknown; - /// \brief Value type. Required. - ValueType mValueType = ValueType::Unknown; - /// \brief Pointee alignment in bytes. Optional. - uint32_t mPointeeAlign = 0; - /// \brief Access qualifier. Optional. - AccessQualifier mAccQual = AccessQualifier::Unknown; - /// \brief Address space qualifier. Optional. - AddressSpaceQualifier mAddrSpaceQual = AddressSpaceQualifier::Unknown; - /// \brief True if 'const' qualifier is specified. Optional. - bool mIsConst = false; - /// \brief True if 'pipe' qualifier is specified. Optional. - bool mIsPipe = false; - /// \brief True if 'restrict' qualifier is specified. Optional. - bool mIsRestrict = false; - /// \brief True if 'volatile' qualifier is specified. Optional. - bool mIsVolatile = false; - /// \brief Name. Optional. - std::string mName = std::string(); - /// \brief Type name. Optional. - std::string mTypeName = std::string(); - - /// \brief Default constructor. - Metadata() = default; -}; - -} // end namespace Arg - -//===----------------------------------------------------------------------===// -// Kernel Code Properties Metadata. -//===----------------------------------------------------------------------===// -namespace CodeProps { - -namespace Key { -/// \brief Key for Kernel::CodeProps::Metadata::mKernargSegmentSize. -constexpr char KernargSegmentSize[] = "KernargSegmentSize"; -/// \brief Key for Kernel::CodeProps::Metadata::mWorkgroupGroupSegmentSize. -constexpr char WorkgroupGroupSegmentSize[] = "WorkgroupGroupSegmentSize"; -/// \brief Key for Kernel::CodeProps::Metadata::mWorkitemPrivateSegmentSize. -constexpr char WorkitemPrivateSegmentSize[] = "WorkitemPrivateSegmentSize"; -/// \brief Key for Kernel::CodeProps::Metadata::mWavefrontNumSGPRs. -constexpr char WavefrontNumSGPRs[] = "WavefrontNumSGPRs"; -/// \brief Key for Kernel::CodeProps::Metadata::mWorkitemNumVGPRs. -constexpr char WorkitemNumVGPRs[] = "WorkitemNumVGPRs"; -/// \brief Key for Kernel::CodeProps::Metadata::mKernargSegmentAlign. -constexpr char KernargSegmentAlign[] = "KernargSegmentAlign"; -/// \brief Key for Kernel::CodeProps::Metadata::mGroupSegmentAlign. -constexpr char GroupSegmentAlign[] = "GroupSegmentAlign"; -/// \brief Key for Kernel::CodeProps::Metadata::mPrivateSegmentAlign. -constexpr char PrivateSegmentAlign[] = "PrivateSegmentAlign"; -/// \brief Key for Kernel::CodeProps::Metadata::mWavefrontSize. -constexpr char WavefrontSize[] = "WavefrontSize"; -} // end namespace Key - -/// \brief In-memory representation of kernel code properties metadata. -struct Metadata final { - /// \brief Size in bytes of the kernarg segment memory. Kernarg segment memory - /// holds the values of the arguments to the kernel. Optional. - uint64_t mKernargSegmentSize = 0; - /// \brief Size in bytes of the group segment memory required by a workgroup. - /// This value does not include any dynamically allocated group segment memory - /// that may be added when the kernel is dispatched. Optional. - uint32_t mWorkgroupGroupSegmentSize = 0; - /// \brief Size in bytes of the private segment memory required by a workitem. - /// Private segment memory includes arg, spill and private segments. Optional. - uint32_t mWorkitemPrivateSegmentSize = 0; - /// \brief Total number of SGPRs used by a wavefront. Optional. - uint16_t mWavefrontNumSGPRs = 0; - /// \brief Total number of VGPRs used by a workitem. Optional. - uint16_t mWorkitemNumVGPRs = 0; - /// \brief Maximum byte alignment of variables used by the kernel in the - /// kernarg memory segment. Expressed as a power of two. Optional. - uint8_t mKernargSegmentAlign = 0; - /// \brief Maximum byte alignment of variables used by the kernel in the - /// group memory segment. Expressed as a power of two. Optional. - uint8_t mGroupSegmentAlign = 0; - /// \brief Maximum byte alignment of variables used by the kernel in the - /// private memory segment. Expressed as a power of two. Optional. - uint8_t mPrivateSegmentAlign = 0; - /// \brief Wavefront size. Expressed as a power of two. Optional. - uint8_t mWavefrontSize = 0; - - /// \brief Default constructor. - Metadata() = default; - - /// \returns True if kernel code properties metadata is empty, false - /// otherwise. - bool empty() const { - return !notEmpty(); - } - - /// \returns True if kernel code properties metadata is not empty, false - /// otherwise. - bool notEmpty() const { - return mKernargSegmentSize || mWorkgroupGroupSegmentSize || - mWorkitemPrivateSegmentSize || mWavefrontNumSGPRs || - mWorkitemNumVGPRs || mKernargSegmentAlign || mGroupSegmentAlign || - mPrivateSegmentAlign || mWavefrontSize; - } -}; - -} // end namespace CodeProps - -//===----------------------------------------------------------------------===// -// Kernel Debug Properties Metadata. -//===----------------------------------------------------------------------===// -namespace DebugProps { - -namespace Key { -/// \brief Key for Kernel::DebugProps::Metadata::mDebuggerABIVersion. -constexpr char DebuggerABIVersion[] = "DebuggerABIVersion"; -/// \brief Key for Kernel::DebugProps::Metadata::mReservedNumVGPRs. -constexpr char ReservedNumVGPRs[] = "ReservedNumVGPRs"; -/// \brief Key for Kernel::DebugProps::Metadata::mReservedFirstVGPR. -constexpr char ReservedFirstVGPR[] = "ReservedFirstVGPR"; -/// \brief Key for Kernel::DebugProps::Metadata::mPrivateSegmentBufferSGPR. -constexpr char PrivateSegmentBufferSGPR[] = "PrivateSegmentBufferSGPR"; -/// \brief Key for -/// Kernel::DebugProps::Metadata::mWavefrontPrivateSegmentOffsetSGPR. -constexpr char WavefrontPrivateSegmentOffsetSGPR[] = - "WavefrontPrivateSegmentOffsetSGPR"; -} // end namespace Key - -/// \brief In-memory representation of kernel debug properties metadata. -struct Metadata final { - /// \brief Debugger ABI version. Optional. - std::vector<uint32_t> mDebuggerABIVersion = std::vector<uint32_t>(); - /// \brief Consecutive number of VGPRs reserved for debugger use. Must be 0 if - /// mDebuggerABIVersion is not set. Optional. - uint16_t mReservedNumVGPRs = 0; - /// \brief First fixed VGPR reserved. Must be uint16_t(-1) if - /// mDebuggerABIVersion is not set or mReservedFirstVGPR is 0. Optional. - uint16_t mReservedFirstVGPR = uint16_t(-1); - /// \brief Fixed SGPR of the first of 4 SGPRs used to hold the scratch V# used - /// for the entire kernel execution. Must be uint16_t(-1) if - /// mDebuggerABIVersion is not set or SGPR not used or not known. Optional. - uint16_t mPrivateSegmentBufferSGPR = uint16_t(-1); - /// \brief Fixed SGPR used to hold the wave scratch offset for the entire - /// kernel execution. Must be uint16_t(-1) if mDebuggerABIVersion is not set - /// or SGPR is not used or not known. Optional. - uint16_t mWavefrontPrivateSegmentOffsetSGPR = uint16_t(-1); - - /// \brief Default constructor. - Metadata() = default; - - /// \returns True if kernel debug properties metadata is empty, false - /// otherwise. - bool empty() const { - return !notEmpty(); - } - - /// \returns True if kernel debug properties metadata is not empty, false - /// otherwise. - bool notEmpty() const { - return !mDebuggerABIVersion.empty(); - } -}; - -} // end namespace DebugProps - -namespace Key { -/// \brief Key for Kernel::Metadata::mName. -constexpr char Name[] = "Name"; -/// \brief Key for Kernel::Metadata::mLanguage. -constexpr char Language[] = "Language"; -/// \brief Key for Kernel::Metadata::mLanguageVersion. -constexpr char LanguageVersion[] = "LanguageVersion"; -/// \brief Key for Kernel::Metadata::mAttrs. -constexpr char Attrs[] = "Attrs"; -/// \brief Key for Kernel::Metadata::mArgs. -constexpr char Args[] = "Args"; -/// \brief Key for Kernel::Metadata::mCodeProps. -constexpr char CodeProps[] = "CodeProps"; -/// \brief Key for Kernel::Metadata::mDebugProps. -constexpr char DebugProps[] = "DebugProps"; -} // end namespace Key - -/// \brief In-memory representation of kernel metadata. -struct Metadata final { - /// \brief Name. Required. - std::string mName = std::string(); - /// \brief Language. Optional. - std::string mLanguage = std::string(); - /// \brief Language version. Optional. - std::vector<uint32_t> mLanguageVersion = std::vector<uint32_t>(); - /// \brief Attributes metadata. Optional. - Attrs::Metadata mAttrs = Attrs::Metadata(); - /// \brief Arguments metadata. Optional. - std::vector<Arg::Metadata> mArgs = std::vector<Arg::Metadata>(); - /// \brief Code properties metadata. Optional. - CodeProps::Metadata mCodeProps = CodeProps::Metadata(); - /// \brief Debug properties metadata. Optional. - DebugProps::Metadata mDebugProps = DebugProps::Metadata(); - - /// \brief Default constructor. - Metadata() = default; -}; - -} // end namespace Kernel - -namespace Key { -/// \brief Key for CodeObject::Metadata::mVersion. -constexpr char Version[] = "Version"; -/// \brief Key for CodeObject::Metadata::mPrintf. -constexpr char Printf[] = "Printf"; -/// \brief Key for CodeObject::Metadata::mKernels. -constexpr char Kernels[] = "Kernels"; -} // end namespace Key - -/// \brief In-memory representation of code object metadata. -struct Metadata final { - /// \brief Code object metadata version. Required. - std::vector<uint32_t> mVersion = std::vector<uint32_t>(); - /// \brief Printf metadata. Optional. - std::vector<std::string> mPrintf = std::vector<std::string>(); - /// \brief Kernels metadata. Optional. - std::vector<Kernel::Metadata> mKernels = std::vector<Kernel::Metadata>(); - - /// \brief Default constructor. - Metadata() = default; - - /// \brief Converts \p YamlString to \p CodeObjectMetadata. - static std::error_code fromYamlString(std::string YamlString, - Metadata &CodeObjectMetadata); - - /// \brief Converts \p CodeObjectMetadata to \p YamlString. - static std::error_code toYamlString(Metadata CodeObjectMetadata, - std::string &YamlString); -}; - -} // end namespace CodeObject -} // end namespace AMDGPU -} // end namespace llvm - -#endif // LLVM_SUPPORT_AMDGPUCODEOBJECTMETADATA_H diff --git a/gnu/llvm/include/llvm/Support/GCOV.h b/gnu/llvm/include/llvm/Support/GCOV.h deleted file mode 100644 index 544434f036a..00000000000 --- a/gnu/llvm/include/llvm/Support/GCOV.h +++ /dev/null @@ -1,445 +0,0 @@ -//===- GCOV.h - LLVM coverage tool ----------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This header provides the interface to read and write coverage files that -// use 'gcov' format. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_GCOV_H -#define LLVM_SUPPORT_GCOV_H - -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/MapVector.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/ADT/iterator.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/raw_ostream.h" - -namespace llvm { - -class GCOVFunction; -class GCOVBlock; -class FileInfo; - -namespace GCOV { -enum GCOVVersion { V402, V404, V704 }; - -/// \brief A struct for passing gcov options between functions. -struct Options { - Options(bool A, bool B, bool C, bool F, bool P, bool U, bool L, bool N) - : AllBlocks(A), BranchInfo(B), BranchCount(C), FuncCoverage(F), - PreservePaths(P), UncondBranch(U), LongFileNames(L), NoOutput(N) {} - - bool AllBlocks; - bool BranchInfo; - bool BranchCount; - bool FuncCoverage; - bool PreservePaths; - bool UncondBranch; - bool LongFileNames; - bool NoOutput; -}; -} // end GCOV namespace - -/// GCOVBuffer - A wrapper around MemoryBuffer to provide GCOV specific -/// read operations. -class GCOVBuffer { -public: - GCOVBuffer(MemoryBuffer *B) : Buffer(B), Cursor(0) {} - - /// readGCNOFormat - Check GCNO signature is valid at the beginning of buffer. - bool readGCNOFormat() { - StringRef File = Buffer->getBuffer().slice(0, 4); - if (File != "oncg") { - errs() << "Unexpected file type: " << File << ".\n"; - return false; - } - Cursor = 4; - return true; - } - - /// readGCDAFormat - Check GCDA signature is valid at the beginning of buffer. - bool readGCDAFormat() { - StringRef File = Buffer->getBuffer().slice(0, 4); - if (File != "adcg") { - errs() << "Unexpected file type: " << File << ".\n"; - return false; - } - Cursor = 4; - return true; - } - - /// readGCOVVersion - Read GCOV version. - bool readGCOVVersion(GCOV::GCOVVersion &Version) { - StringRef VersionStr = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (VersionStr == "*204") { - Cursor += 4; - Version = GCOV::V402; - return true; - } - if (VersionStr == "*404") { - Cursor += 4; - Version = GCOV::V404; - return true; - } - if (VersionStr == "*704") { - Cursor += 4; - Version = GCOV::V704; - return true; - } - errs() << "Unexpected version: " << VersionStr << ".\n"; - return false; - } - - /// readFunctionTag - If cursor points to a function tag then increment the - /// cursor and return true otherwise return false. - bool readFunctionTag() { - StringRef Tag = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (Tag.empty() || Tag[0] != '\0' || Tag[1] != '\0' || Tag[2] != '\0' || - Tag[3] != '\1') { - return false; - } - Cursor += 4; - return true; - } - - /// readBlockTag - If cursor points to a block tag then increment the - /// cursor and return true otherwise return false. - bool readBlockTag() { - StringRef Tag = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (Tag.empty() || Tag[0] != '\0' || Tag[1] != '\0' || Tag[2] != '\x41' || - Tag[3] != '\x01') { - return false; - } - Cursor += 4; - return true; - } - - /// readEdgeTag - If cursor points to an edge tag then increment the - /// cursor and return true otherwise return false. - bool readEdgeTag() { - StringRef Tag = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (Tag.empty() || Tag[0] != '\0' || Tag[1] != '\0' || Tag[2] != '\x43' || - Tag[3] != '\x01') { - return false; - } - Cursor += 4; - return true; - } - - /// readLineTag - If cursor points to a line tag then increment the - /// cursor and return true otherwise return false. - bool readLineTag() { - StringRef Tag = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (Tag.empty() || Tag[0] != '\0' || Tag[1] != '\0' || Tag[2] != '\x45' || - Tag[3] != '\x01') { - return false; - } - Cursor += 4; - return true; - } - - /// readArcTag - If cursor points to an gcda arc tag then increment the - /// cursor and return true otherwise return false. - bool readArcTag() { - StringRef Tag = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (Tag.empty() || Tag[0] != '\0' || Tag[1] != '\0' || Tag[2] != '\xa1' || - Tag[3] != '\1') { - return false; - } - Cursor += 4; - return true; - } - - /// readObjectTag - If cursor points to an object summary tag then increment - /// the cursor and return true otherwise return false. - bool readObjectTag() { - StringRef Tag = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (Tag.empty() || Tag[0] != '\0' || Tag[1] != '\0' || Tag[2] != '\0' || - Tag[3] != '\xa1') { - return false; - } - Cursor += 4; - return true; - } - - /// readProgramTag - If cursor points to a program summary tag then increment - /// the cursor and return true otherwise return false. - bool readProgramTag() { - StringRef Tag = Buffer->getBuffer().slice(Cursor, Cursor + 4); - if (Tag.empty() || Tag[0] != '\0' || Tag[1] != '\0' || Tag[2] != '\0' || - Tag[3] != '\xa3') { - return false; - } - Cursor += 4; - return true; - } - - bool readInt(uint32_t &Val) { - if (Buffer->getBuffer().size() < Cursor + 4) { - errs() << "Unexpected end of memory buffer: " << Cursor + 4 << ".\n"; - return false; - } - StringRef Str = Buffer->getBuffer().slice(Cursor, Cursor + 4); - Cursor += 4; - Val = *(const uint32_t *)(Str.data()); - return true; - } - - bool readInt64(uint64_t &Val) { - uint32_t Lo, Hi; - if (!readInt(Lo) || !readInt(Hi)) - return false; - Val = ((uint64_t)Hi << 32) | Lo; - return true; - } - - bool readString(StringRef &Str) { - uint32_t Len = 0; - // Keep reading until we find a non-zero length. This emulates gcov's - // behaviour, which appears to do the same. - while (Len == 0) - if (!readInt(Len)) - return false; - Len *= 4; - if (Buffer->getBuffer().size() < Cursor + Len) { - errs() << "Unexpected end of memory buffer: " << Cursor + Len << ".\n"; - return false; - } - Str = Buffer->getBuffer().slice(Cursor, Cursor + Len).split('\0').first; - Cursor += Len; - return true; - } - - uint64_t getCursor() const { return Cursor; } - void advanceCursor(uint32_t n) { Cursor += n * 4; } - -private: - MemoryBuffer *Buffer; - uint64_t Cursor; -}; - -/// GCOVFile - Collects coverage information for one pair of coverage file -/// (.gcno and .gcda). -class GCOVFile { -public: - GCOVFile() - : GCNOInitialized(false), Checksum(0), Functions(), RunCount(0), - ProgramCount(0) {} - bool readGCNO(GCOVBuffer &Buffer); - bool readGCDA(GCOVBuffer &Buffer); - uint32_t getChecksum() const { return Checksum; } - void dump() const; - void collectLineCounts(FileInfo &FI); - -private: - bool GCNOInitialized; - GCOV::GCOVVersion Version; - uint32_t Checksum; - SmallVector<std::unique_ptr<GCOVFunction>, 16> Functions; - uint32_t RunCount; - uint32_t ProgramCount; -}; - -/// GCOVEdge - Collects edge information. -struct GCOVEdge { - GCOVEdge(GCOVBlock &S, GCOVBlock &D) : Src(S), Dst(D), Count(0) {} - - GCOVBlock &Src; - GCOVBlock &Dst; - uint64_t Count; -}; - -/// GCOVFunction - Collects function information. -class GCOVFunction { -public: - typedef pointee_iterator<SmallVectorImpl< - std::unique_ptr<GCOVBlock>>::const_iterator> BlockIterator; - - GCOVFunction(GCOVFile &P) : Parent(P), Ident(0), LineNumber(0) {} - bool readGCNO(GCOVBuffer &Buffer, GCOV::GCOVVersion Version); - bool readGCDA(GCOVBuffer &Buffer, GCOV::GCOVVersion Version); - StringRef getName() const { return Name; } - StringRef getFilename() const { return Filename; } - size_t getNumBlocks() const { return Blocks.size(); } - uint64_t getEntryCount() const; - uint64_t getExitCount() const; - - BlockIterator block_begin() const { return Blocks.begin(); } - BlockIterator block_end() const { return Blocks.end(); } - iterator_range<BlockIterator> blocks() const { - return make_range(block_begin(), block_end()); - } - - void dump() const; - void collectLineCounts(FileInfo &FI); - -private: - GCOVFile &Parent; - uint32_t Ident; - uint32_t Checksum; - uint32_t LineNumber; - StringRef Name; - StringRef Filename; - SmallVector<std::unique_ptr<GCOVBlock>, 16> Blocks; - SmallVector<std::unique_ptr<GCOVEdge>, 16> Edges; -}; - -/// GCOVBlock - Collects block information. -class GCOVBlock { - struct EdgeWeight { - EdgeWeight(GCOVBlock *D) : Dst(D), Count(0) {} - - GCOVBlock *Dst; - uint64_t Count; - }; - - struct SortDstEdgesFunctor { - bool operator()(const GCOVEdge *E1, const GCOVEdge *E2) { - return E1->Dst.Number < E2->Dst.Number; - } - }; - -public: - typedef SmallVectorImpl<GCOVEdge *>::const_iterator EdgeIterator; - - GCOVBlock(GCOVFunction &P, uint32_t N) - : Parent(P), Number(N), Counter(0), DstEdgesAreSorted(true), SrcEdges(), - DstEdges(), Lines() {} - ~GCOVBlock(); - const GCOVFunction &getParent() const { return Parent; } - void addLine(uint32_t N) { Lines.push_back(N); } - uint32_t getLastLine() const { return Lines.back(); } - void addCount(size_t DstEdgeNo, uint64_t N); - uint64_t getCount() const { return Counter; } - - void addSrcEdge(GCOVEdge *Edge) { - assert(&Edge->Dst == this); // up to caller to ensure edge is valid - SrcEdges.push_back(Edge); - } - void addDstEdge(GCOVEdge *Edge) { - assert(&Edge->Src == this); // up to caller to ensure edge is valid - // Check if adding this edge causes list to become unsorted. - if (DstEdges.size() && DstEdges.back()->Dst.Number > Edge->Dst.Number) - DstEdgesAreSorted = false; - DstEdges.push_back(Edge); - } - size_t getNumSrcEdges() const { return SrcEdges.size(); } - size_t getNumDstEdges() const { return DstEdges.size(); } - void sortDstEdges(); - - EdgeIterator src_begin() const { return SrcEdges.begin(); } - EdgeIterator src_end() const { return SrcEdges.end(); } - iterator_range<EdgeIterator> srcs() const { - return make_range(src_begin(), src_end()); - } - - EdgeIterator dst_begin() const { return DstEdges.begin(); } - EdgeIterator dst_end() const { return DstEdges.end(); } - iterator_range<EdgeIterator> dsts() const { - return make_range(dst_begin(), dst_end()); - } - - void dump() const; - void collectLineCounts(FileInfo &FI); - -private: - GCOVFunction &Parent; - uint32_t Number; - uint64_t Counter; - bool DstEdgesAreSorted; - SmallVector<GCOVEdge *, 16> SrcEdges; - SmallVector<GCOVEdge *, 16> DstEdges; - SmallVector<uint32_t, 16> Lines; -}; - -class FileInfo { - // It is unlikely--but possible--for multiple functions to be on the same - // line. - // Therefore this typedef allows LineData.Functions to store multiple - // functions - // per instance. This is rare, however, so optimize for the common case. - typedef SmallVector<const GCOVFunction *, 1> FunctionVector; - typedef DenseMap<uint32_t, FunctionVector> FunctionLines; - typedef SmallVector<const GCOVBlock *, 4> BlockVector; - typedef DenseMap<uint32_t, BlockVector> BlockLines; - - struct LineData { - LineData() : LastLine(0) {} - BlockLines Blocks; - FunctionLines Functions; - uint32_t LastLine; - }; - - struct GCOVCoverage { - GCOVCoverage(StringRef Name) - : Name(Name), LogicalLines(0), LinesExec(0), Branches(0), - BranchesExec(0), BranchesTaken(0) {} - - StringRef Name; - - uint32_t LogicalLines; - uint32_t LinesExec; - - uint32_t Branches; - uint32_t BranchesExec; - uint32_t BranchesTaken; - }; - -public: - FileInfo(const GCOV::Options &Options) - : Options(Options), LineInfo(), RunCount(0), ProgramCount(0) {} - - void addBlockLine(StringRef Filename, uint32_t Line, const GCOVBlock *Block) { - if (Line > LineInfo[Filename].LastLine) - LineInfo[Filename].LastLine = Line; - LineInfo[Filename].Blocks[Line - 1].push_back(Block); - } - void addFunctionLine(StringRef Filename, uint32_t Line, - const GCOVFunction *Function) { - if (Line > LineInfo[Filename].LastLine) - LineInfo[Filename].LastLine = Line; - LineInfo[Filename].Functions[Line - 1].push_back(Function); - } - void setRunCount(uint32_t Runs) { RunCount = Runs; } - void setProgramCount(uint32_t Programs) { ProgramCount = Programs; } - void print(raw_ostream &OS, StringRef MainFilename, StringRef GCNOFile, - StringRef GCDAFile); - -private: - std::string getCoveragePath(StringRef Filename, StringRef MainFilename); - std::unique_ptr<raw_ostream> openCoveragePath(StringRef CoveragePath); - void printFunctionSummary(raw_ostream &OS, const FunctionVector &Funcs) const; - void printBlockInfo(raw_ostream &OS, const GCOVBlock &Block, - uint32_t LineIndex, uint32_t &BlockNo) const; - void printBranchInfo(raw_ostream &OS, const GCOVBlock &Block, - GCOVCoverage &Coverage, uint32_t &EdgeNo); - void printUncondBranchInfo(raw_ostream &OS, uint32_t &EdgeNo, - uint64_t Count) const; - - void printCoverage(raw_ostream &OS, const GCOVCoverage &Coverage) const; - void printFuncCoverage(raw_ostream &OS) const; - void printFileCoverage(raw_ostream &OS) const; - - const GCOV::Options &Options; - StringMap<LineData> LineInfo; - uint32_t RunCount; - uint32_t ProgramCount; - - typedef SmallVector<std::pair<std::string, GCOVCoverage>, 4> FileCoverageList; - typedef MapVector<const GCOVFunction *, GCOVCoverage> FuncCoverageMap; - - FileCoverageList FileCoverages; - FuncCoverageMap FuncCoverages; -}; -} - -#endif diff --git a/gnu/llvm/include/llvm/Target/CostTable.h b/gnu/llvm/include/llvm/Target/CostTable.h deleted file mode 100644 index 2499f5c3189..00000000000 --- a/gnu/llvm/include/llvm/Target/CostTable.h +++ /dev/null @@ -1,71 +0,0 @@ -//===-- CostTable.h - Instruction Cost Table handling -----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Cost tables and simple lookup functions -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_COSTTABLE_H_ -#define LLVM_TARGET_COSTTABLE_H_ - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/CodeGen/MachineValueType.h" - -namespace llvm { - -/// Cost Table Entry -struct CostTblEntry { - int ISD; - MVT::SimpleValueType Type; - unsigned Cost; -}; - -/// Find in cost table, TypeTy must be comparable to CompareTy by == -inline const CostTblEntry *CostTableLookup(ArrayRef<CostTblEntry> Tbl, - int ISD, MVT Ty) { - auto I = std::find_if(Tbl.begin(), Tbl.end(), - [=](const CostTblEntry &Entry) { - return ISD == Entry.ISD && Ty == Entry.Type; }); - if (I != Tbl.end()) - return I; - - // Could not find an entry. - return nullptr; -} - -/// Type Conversion Cost Table -struct TypeConversionCostTblEntry { - int ISD; - MVT::SimpleValueType Dst; - MVT::SimpleValueType Src; - unsigned Cost; -}; - -/// Find in type conversion cost table, TypeTy must be comparable to CompareTy -/// by == -inline const TypeConversionCostTblEntry * -ConvertCostTableLookup(ArrayRef<TypeConversionCostTblEntry> Tbl, - int ISD, MVT Dst, MVT Src) { - auto I = std::find_if(Tbl.begin(), Tbl.end(), - [=](const TypeConversionCostTblEntry &Entry) { - return ISD == Entry.ISD && Src == Entry.Src && - Dst == Entry.Dst; - }); - if (I != Tbl.end()) - return I; - - // Could not find an entry. - return nullptr; -} - -} // namespace llvm - - -#endif /* LLVM_TARGET_COSTTABLE_H_ */ diff --git a/gnu/llvm/include/llvm/Target/TargetCallingConv.h b/gnu/llvm/include/llvm/Target/TargetCallingConv.h deleted file mode 100644 index 0c6c1f1468c..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetCallingConv.h +++ /dev/null @@ -1,202 +0,0 @@ -//===-- llvm/Target/TargetCallingConv.h - Calling Convention ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines types for working with calling-convention information. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETCALLINGCONV_H -#define LLVM_TARGET_TARGETCALLINGCONV_H - -#include "llvm/CodeGen/ValueTypes.h" -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/MathExtras.h" -#include <string> -#include <limits.h> - -namespace llvm { - -namespace ISD { - struct ArgFlagsTy { - private: - static const uint64_t NoFlagSet = 0ULL; - static const uint64_t ZExt = 1ULL<<0; ///< Zero extended - static const uint64_t ZExtOffs = 0; - static const uint64_t SExt = 1ULL<<1; ///< Sign extended - static const uint64_t SExtOffs = 1; - static const uint64_t InReg = 1ULL<<2; ///< Passed in register - static const uint64_t InRegOffs = 2; - static const uint64_t SRet = 1ULL<<3; ///< Hidden struct-ret ptr - static const uint64_t SRetOffs = 3; - static const uint64_t ByVal = 1ULL<<4; ///< Struct passed by value - static const uint64_t ByValOffs = 4; - static const uint64_t Nest = 1ULL<<5; ///< Nested fn static chain - static const uint64_t NestOffs = 5; - static const uint64_t Returned = 1ULL<<6; ///< Always returned - static const uint64_t ReturnedOffs = 6; - static const uint64_t ByValAlign = 0xFULL<<7; ///< Struct alignment - static const uint64_t ByValAlignOffs = 7; - static const uint64_t Split = 1ULL<<11; - static const uint64_t SplitOffs = 11; - static const uint64_t InAlloca = 1ULL<<12; ///< Passed with inalloca - static const uint64_t InAllocaOffs = 12; - static const uint64_t SplitEnd = 1ULL<<13; ///< Last part of a split - static const uint64_t SplitEndOffs = 13; - static const uint64_t OrigAlign = 0x1FULL<<27; - static const uint64_t OrigAlignOffs = 27; - static const uint64_t ByValSize = 0x3fffffffULL<<32; ///< Struct size - static const uint64_t ByValSizeOffs = 32; - static const uint64_t InConsecutiveRegsLast = 0x1ULL<<62; ///< Struct size - static const uint64_t InConsecutiveRegsLastOffs = 62; - static const uint64_t InConsecutiveRegs = 0x1ULL<<63; ///< Struct size - static const uint64_t InConsecutiveRegsOffs = 63; - - static const uint64_t One = 1ULL; ///< 1 of this type, for shifts - - uint64_t Flags; - public: - ArgFlagsTy() : Flags(0) { } - - bool isZExt() const { return Flags & ZExt; } - void setZExt() { Flags |= One << ZExtOffs; } - - bool isSExt() const { return Flags & SExt; } - void setSExt() { Flags |= One << SExtOffs; } - - bool isInReg() const { return Flags & InReg; } - void setInReg() { Flags |= One << InRegOffs; } - - bool isSRet() const { return Flags & SRet; } - void setSRet() { Flags |= One << SRetOffs; } - - bool isByVal() const { return Flags & ByVal; } - void setByVal() { Flags |= One << ByValOffs; } - - bool isInAlloca() const { return Flags & InAlloca; } - void setInAlloca() { Flags |= One << InAllocaOffs; } - - bool isNest() const { return Flags & Nest; } - void setNest() { Flags |= One << NestOffs; } - - bool isReturned() const { return Flags & Returned; } - void setReturned() { Flags |= One << ReturnedOffs; } - - bool isInConsecutiveRegs() const { return Flags & InConsecutiveRegs; } - void setInConsecutiveRegs() { Flags |= One << InConsecutiveRegsOffs; } - - bool isInConsecutiveRegsLast() const { return Flags & InConsecutiveRegsLast; } - void setInConsecutiveRegsLast() { Flags |= One << InConsecutiveRegsLastOffs; } - - unsigned getByValAlign() const { - return (unsigned) - ((One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2); - } - void setByValAlign(unsigned A) { - Flags = (Flags & ~ByValAlign) | - (uint64_t(Log2_32(A) + 1) << ByValAlignOffs); - } - - bool isSplit() const { return Flags & Split; } - void setSplit() { Flags |= One << SplitOffs; } - - bool isSplitEnd() const { return Flags & SplitEnd; } - void setSplitEnd() { Flags |= One << SplitEndOffs; } - - unsigned getOrigAlign() const { - return (unsigned) - ((One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2); - } - void setOrigAlign(unsigned A) { - Flags = (Flags & ~OrigAlign) | - (uint64_t(Log2_32(A) + 1) << OrigAlignOffs); - } - - unsigned getByValSize() const { - return (unsigned)((Flags & ByValSize) >> ByValSizeOffs); - } - void setByValSize(unsigned S) { - Flags = (Flags & ~ByValSize) | (uint64_t(S) << ByValSizeOffs); - } - - /// getRawBits - Represent the flags as a bunch of bits. - uint64_t getRawBits() const { return Flags; } - }; - - /// InputArg - This struct carries flags and type information about a - /// single incoming (formal) argument or incoming (from the perspective - /// of the caller) return value virtual register. - /// - struct InputArg { - ArgFlagsTy Flags; - MVT VT; - EVT ArgVT; - bool Used; - - /// Index original Function's argument. - unsigned OrigArgIndex; - /// Sentinel value for implicit machine-level input arguments. - static const unsigned NoArgIndex = UINT_MAX; - - /// Offset in bytes of current input value relative to the beginning of - /// original argument. E.g. if argument was splitted into four 32 bit - /// registers, we got 4 InputArgs with PartOffsets 0, 4, 8 and 12. - unsigned PartOffset; - - InputArg() : VT(MVT::Other), Used(false) {} - InputArg(ArgFlagsTy flags, EVT vt, EVT argvt, bool used, - unsigned origIdx, unsigned partOffs) - : Flags(flags), Used(used), OrigArgIndex(origIdx), PartOffset(partOffs) { - VT = vt.getSimpleVT(); - ArgVT = argvt; - } - - bool isOrigArg() const { - return OrigArgIndex != NoArgIndex; - } - - unsigned getOrigArgIndex() const { - assert(OrigArgIndex != NoArgIndex && "Implicit machine-level argument"); - return OrigArgIndex; - } - }; - - /// OutputArg - This struct carries flags and a value for a - /// single outgoing (actual) argument or outgoing (from the perspective - /// of the caller) return value virtual register. - /// - struct OutputArg { - ArgFlagsTy Flags; - MVT VT; - EVT ArgVT; - - /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". - bool IsFixed; - - /// Index original Function's argument. - unsigned OrigArgIndex; - - /// Offset in bytes of current output value relative to the beginning of - /// original argument. E.g. if argument was splitted into four 32 bit - /// registers, we got 4 OutputArgs with PartOffsets 0, 4, 8 and 12. - unsigned PartOffset; - - OutputArg() : IsFixed(false) {} - OutputArg(ArgFlagsTy flags, EVT vt, EVT argvt, bool isfixed, - unsigned origIdx, unsigned partOffs) - : Flags(flags), IsFixed(isfixed), OrigArgIndex(origIdx), - PartOffset(partOffs) { - VT = vt.getSimpleVT(); - ArgVT = argvt; - } - }; -} - -} // end llvm namespace - -#endif diff --git a/gnu/llvm/include/llvm/Target/TargetFrameLowering.h b/gnu/llvm/include/llvm/Target/TargetFrameLowering.h deleted file mode 100644 index cadd07d71f1..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetFrameLowering.h +++ /dev/null @@ -1,318 +0,0 @@ -//===-- llvm/Target/TargetFrameLowering.h ---------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Interface to describe the layout of a stack frame on the target machine. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETFRAMELOWERING_H -#define LLVM_TARGET_TARGETFRAMELOWERING_H - -#include "llvm/CodeGen/MachineBasicBlock.h" -#include <utility> -#include <vector> - -namespace llvm { - class BitVector; - class CalleeSavedInfo; - class MachineFunction; - class RegScavenger; - -/// Information about stack frame layout on the target. It holds the direction -/// of stack growth, the known stack alignment on entry to each function, and -/// the offset to the locals area. -/// -/// The offset to the local area is the offset from the stack pointer on -/// function entry to the first location where function data (local variables, -/// spill locations) can be stored. -class TargetFrameLowering { -public: - enum StackDirection { - StackGrowsUp, // Adding to the stack increases the stack address - StackGrowsDown // Adding to the stack decreases the stack address - }; - - // Maps a callee saved register to a stack slot with a fixed offset. - struct SpillSlot { - unsigned Reg; - int Offset; // Offset relative to stack pointer on function entry. - }; -private: - StackDirection StackDir; - unsigned StackAlignment; - unsigned TransientStackAlignment; - int LocalAreaOffset; - bool StackRealignable; -public: - TargetFrameLowering(StackDirection D, unsigned StackAl, int LAO, - unsigned TransAl = 1, bool StackReal = true) - : StackDir(D), StackAlignment(StackAl), TransientStackAlignment(TransAl), - LocalAreaOffset(LAO), StackRealignable(StackReal) {} - - virtual ~TargetFrameLowering(); - - // These methods return information that describes the abstract stack layout - // of the target machine. - - /// getStackGrowthDirection - Return the direction the stack grows - /// - StackDirection getStackGrowthDirection() const { return StackDir; } - - /// getStackAlignment - This method returns the number of bytes to which the - /// stack pointer must be aligned on entry to a function. Typically, this - /// is the largest alignment for any data object in the target. - /// - unsigned getStackAlignment() const { return StackAlignment; } - - /// alignSPAdjust - This method aligns the stack adjustment to the correct - /// alignment. - /// - int alignSPAdjust(int SPAdj) const { - if (SPAdj < 0) { - SPAdj = -RoundUpToAlignment(-SPAdj, StackAlignment); - } else { - SPAdj = RoundUpToAlignment(SPAdj, StackAlignment); - } - return SPAdj; - } - - /// getTransientStackAlignment - This method returns the number of bytes to - /// which the stack pointer must be aligned at all times, even between - /// calls. - /// - unsigned getTransientStackAlignment() const { - return TransientStackAlignment; - } - - /// isStackRealignable - This method returns whether the stack can be - /// realigned. - bool isStackRealignable() const { - return StackRealignable; - } - - /// Return the skew that has to be applied to stack alignment under - /// certain conditions (e.g. stack was adjusted before function \p MF - /// was called). - virtual unsigned getStackAlignmentSkew(const MachineFunction &MF) const; - - /// getOffsetOfLocalArea - This method returns the offset of the local area - /// from the stack pointer on entrance to a function. - /// - int getOffsetOfLocalArea() const { return LocalAreaOffset; } - - /// isFPCloseToIncomingSP - Return true if the frame pointer is close to - /// the incoming stack pointer, false if it is close to the post-prologue - /// stack pointer. - virtual bool isFPCloseToIncomingSP() const { return true; } - - /// assignCalleeSavedSpillSlots - Allows target to override spill slot - /// assignment logic. If implemented, assignCalleeSavedSpillSlots() should - /// assign frame slots to all CSI entries and return true. If this method - /// returns false, spill slots will be assigned using generic implementation. - /// assignCalleeSavedSpillSlots() may add, delete or rearrange elements of - /// CSI. - virtual bool - assignCalleeSavedSpillSlots(MachineFunction &MF, - const TargetRegisterInfo *TRI, - std::vector<CalleeSavedInfo> &CSI) const { - return false; - } - - /// getCalleeSavedSpillSlots - This method returns a pointer to an array of - /// pairs, that contains an entry for each callee saved register that must be - /// spilled to a particular stack location if it is spilled. - /// - /// Each entry in this array contains a <register,offset> pair, indicating the - /// fixed offset from the incoming stack pointer that each register should be - /// spilled at. If a register is not listed here, the code generator is - /// allowed to spill it anywhere it chooses. - /// - virtual const SpillSlot * - getCalleeSavedSpillSlots(unsigned &NumEntries) const { - NumEntries = 0; - return nullptr; - } - - /// targetHandlesStackFrameRounding - Returns true if the target is - /// responsible for rounding up the stack frame (probably at emitPrologue - /// time). - virtual bool targetHandlesStackFrameRounding() const { - return false; - } - - /// Returns true if the target will correctly handle shrink wrapping. - virtual bool enableShrinkWrapping(const MachineFunction &MF) const { - return false; - } - - /// emitProlog/emitEpilog - These methods insert prolog and epilog code into - /// the function. - virtual void emitPrologue(MachineFunction &MF, - MachineBasicBlock &MBB) const = 0; - virtual void emitEpilogue(MachineFunction &MF, - MachineBasicBlock &MBB) const = 0; - - /// Replace a StackProbe stub (if any) with the actual probe code inline - virtual void inlineStackProbe(MachineFunction &MF, - MachineBasicBlock &PrologueMBB) const {} - - /// Adjust the prologue to have the function use segmented stacks. This works - /// by adding a check even before the "normal" function prologue. - virtual void adjustForSegmentedStacks(MachineFunction &MF, - MachineBasicBlock &PrologueMBB) const {} - - /// Adjust the prologue to add Erlang Run-Time System (ERTS) specific code in - /// the assembly prologue to explicitly handle the stack. - virtual void adjustForHiPEPrologue(MachineFunction &MF, - MachineBasicBlock &PrologueMBB) const {} - - /// Adjust the prologue to add an allocation at a fixed offset from the frame - /// pointer. - virtual void - adjustForFrameAllocatePrologue(MachineFunction &MF, - MachineBasicBlock &PrologueMBB) const {} - - /// spillCalleeSavedRegisters - Issues instruction(s) to spill all callee - /// saved registers and returns true if it isn't possible / profitable to do - /// so by issuing a series of store instructions via - /// storeRegToStackSlot(). Returns false otherwise. - virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - const std::vector<CalleeSavedInfo> &CSI, - const TargetRegisterInfo *TRI) const { - return false; - } - - /// restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee - /// saved registers and returns true if it isn't possible / profitable to do - /// so by issuing a series of load instructions via loadRegToStackSlot(). - /// Returns false otherwise. - virtual bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - const std::vector<CalleeSavedInfo> &CSI, - const TargetRegisterInfo *TRI) const { - return false; - } - - /// Return true if the target needs to disable frame pointer elimination. - virtual bool noFramePointerElim(const MachineFunction &MF) const; - - /// hasFP - Return true if the specified function should have a dedicated - /// frame pointer register. For most targets this is true only if the function - /// has variable sized allocas or if frame pointer elimination is disabled. - virtual bool hasFP(const MachineFunction &MF) const = 0; - - /// hasReservedCallFrame - Under normal circumstances, when a frame pointer is - /// not required, we reserve argument space for call sites in the function - /// immediately on entry to the current function. This eliminates the need for - /// add/sub sp brackets around call sites. Returns true if the call frame is - /// included as part of the stack frame. - virtual bool hasReservedCallFrame(const MachineFunction &MF) const { - return !hasFP(MF); - } - - /// canSimplifyCallFramePseudos - When possible, it's best to simplify the - /// call frame pseudo ops before doing frame index elimination. This is - /// possible only when frame index references between the pseudos won't - /// need adjusting for the call frame adjustments. Normally, that's true - /// if the function has a reserved call frame or a frame pointer. Some - /// targets (Thumb2, for example) may have more complicated criteria, - /// however, and can override this behavior. - virtual bool canSimplifyCallFramePseudos(const MachineFunction &MF) const { - return hasReservedCallFrame(MF) || hasFP(MF); - } - - // needsFrameIndexResolution - Do we need to perform FI resolution for - // this function. Normally, this is required only when the function - // has any stack objects. However, targets may want to override this. - virtual bool needsFrameIndexResolution(const MachineFunction &MF) const; - - /// getFrameIndexReference - This method should return the base register - /// and offset used to reference a frame index location. The offset is - /// returned directly, and the base register is returned via FrameReg. - virtual int getFrameIndexReference(const MachineFunction &MF, int FI, - unsigned &FrameReg) const; - - /// Same as above, except that the 'base register' will always be RSP, not - /// RBP on x86. This is generally used for emitting statepoint or EH tables - /// that use offsets from RSP. - /// TODO: This should really be a parameterizable choice. - virtual int getFrameIndexReferenceFromSP(const MachineFunction &MF, int FI, - unsigned &FrameReg) const { - // default to calling normal version, we override this on x86 only - llvm_unreachable("unimplemented for non-x86"); - return 0; - } - - /// This method determines which of the registers reported by - /// TargetRegisterInfo::getCalleeSavedRegs() should actually get saved. - /// The default implementation checks populates the \p SavedRegs bitset with - /// all registers which are modified in the function, targets may override - /// this function to save additional registers. - /// This method also sets up the register scavenger ensuring there is a free - /// register or a frameindex available. - virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, - RegScavenger *RS = nullptr) const; - - /// processFunctionBeforeFrameFinalized - This method is called immediately - /// before the specified function's frame layout (MF.getFrameInfo()) is - /// finalized. Once the frame is finalized, MO_FrameIndex operands are - /// replaced with direct constants. This method is optional. - /// - virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF, - RegScavenger *RS = nullptr) const { - } - - virtual unsigned getWinEHParentFrameOffset(const MachineFunction &MF) const { - report_fatal_error("WinEH not implemented for this target"); - } - - /// eliminateCallFramePseudoInstr - This method is called during prolog/epilog - /// code insertion to eliminate call frame setup and destroy pseudo - /// instructions (but only if the Target is using them). It is responsible - /// for eliminating these instructions, replacing them with concrete - /// instructions. This method need only be implemented if using call frame - /// setup/destroy pseudo instructions. - /// - virtual void - eliminateCallFramePseudoInstr(MachineFunction &MF, - MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI) const { - llvm_unreachable("Call Frame Pseudo Instructions do not exist on this " - "target!"); - } - - /// Check whether or not the given \p MBB can be used as a prologue - /// for the target. - /// The prologue will be inserted first in this basic block. - /// This method is used by the shrink-wrapping pass to decide if - /// \p MBB will be correctly handled by the target. - /// As soon as the target enable shrink-wrapping without overriding - /// this method, we assume that each basic block is a valid - /// prologue. - virtual bool canUseAsPrologue(const MachineBasicBlock &MBB) const { - return true; - } - - /// Check whether or not the given \p MBB can be used as a epilogue - /// for the target. - /// The epilogue will be inserted before the first terminator of that block. - /// This method is used by the shrink-wrapping pass to decide if - /// \p MBB will be correctly handled by the target. - /// As soon as the target enable shrink-wrapping without overriding - /// this method, we assume that each basic block is a valid - /// epilogue. - virtual bool canUseAsEpilogue(const MachineBasicBlock &MBB) const { - return true; - } -}; - -} // End llvm namespace - -#endif diff --git a/gnu/llvm/include/llvm/Target/TargetInstrInfo.h b/gnu/llvm/include/llvm/Target/TargetInstrInfo.h deleted file mode 100644 index 0cebcf1c6b5..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetInstrInfo.h +++ /dev/null @@ -1,1440 +0,0 @@ -//===-- llvm/Target/TargetInstrInfo.h - Instruction Info --------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file describes the target machine instruction set to the code generator. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETINSTRINFO_H -#define LLVM_TARGET_TARGETINSTRINFO_H - -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/SmallSet.h" -#include "llvm/CodeGen/MachineCombinerPattern.h" -#include "llvm/CodeGen/MachineFunction.h" -#include "llvm/MC/MCInstrInfo.h" -#include "llvm/Support/BranchProbability.h" -#include "llvm/Target/TargetRegisterInfo.h" - -namespace llvm { - -class InstrItineraryData; -class LiveVariables; -class MCAsmInfo; -class MachineMemOperand; -class MachineRegisterInfo; -class MDNode; -class MCInst; -struct MCSchedModel; -class MCSymbolRefExpr; -class SDNode; -class ScheduleHazardRecognizer; -class SelectionDAG; -class ScheduleDAG; -class TargetRegisterClass; -class TargetRegisterInfo; -class TargetSubtargetInfo; -class TargetSchedModel; -class DFAPacketizer; - -template<class T> class SmallVectorImpl; - - -//--------------------------------------------------------------------------- -/// -/// TargetInstrInfo - Interface to description of machine instruction set -/// -class TargetInstrInfo : public MCInstrInfo { - TargetInstrInfo(const TargetInstrInfo &) = delete; - void operator=(const TargetInstrInfo &) = delete; -public: - TargetInstrInfo(unsigned CFSetupOpcode = ~0u, unsigned CFDestroyOpcode = ~0u, - unsigned CatchRetOpcode = ~0u) - : CallFrameSetupOpcode(CFSetupOpcode), - CallFrameDestroyOpcode(CFDestroyOpcode), - CatchRetOpcode(CatchRetOpcode) {} - - virtual ~TargetInstrInfo(); - - static bool isGenericOpcode(unsigned Opc) { - return Opc <= TargetOpcode::GENERIC_OP_END; - } - - /// Given a machine instruction descriptor, returns the register - /// class constraint for OpNum, or NULL. - const TargetRegisterClass *getRegClass(const MCInstrDesc &TID, - unsigned OpNum, - const TargetRegisterInfo *TRI, - const MachineFunction &MF) const; - - /// Return true if the instruction is trivially rematerializable, meaning it - /// has no side effects and requires no operands that aren't always available. - /// This means the only allowed uses are constants and unallocatable physical - /// registers so that the instructions result is independent of the place - /// in the function. - bool isTriviallyReMaterializable(const MachineInstr *MI, - AliasAnalysis *AA = nullptr) const { - return MI->getOpcode() == TargetOpcode::IMPLICIT_DEF || - (MI->getDesc().isRematerializable() && - (isReallyTriviallyReMaterializable(MI, AA) || - isReallyTriviallyReMaterializableGeneric(MI, AA))); - } - -protected: - /// For instructions with opcodes for which the M_REMATERIALIZABLE flag is - /// set, this hook lets the target specify whether the instruction is actually - /// trivially rematerializable, taking into consideration its operands. This - /// predicate must return false if the instruction has any side effects other - /// than producing a value, or if it requres any address registers that are - /// not always available. - /// Requirements must be check as stated in isTriviallyReMaterializable() . - virtual bool isReallyTriviallyReMaterializable(const MachineInstr *MI, - AliasAnalysis *AA) const { - return false; - } - - /// This method commutes the operands of the given machine instruction MI. - /// The operands to be commuted are specified by their indices OpIdx1 and - /// OpIdx2. - /// - /// If a target has any instructions that are commutable but require - /// converting to different instructions or making non-trivial changes - /// to commute them, this method can be overloaded to do that. - /// The default implementation simply swaps the commutable operands. - /// - /// If NewMI is false, MI is modified in place and returned; otherwise, a - /// new machine instruction is created and returned. - /// - /// Do not call this method for a non-commutable instruction. - /// Even though the instruction is commutable, the method may still - /// fail to commute the operands, null pointer is returned in such cases. - virtual MachineInstr *commuteInstructionImpl(MachineInstr *MI, - bool NewMI, - unsigned OpIdx1, - unsigned OpIdx2) const; - - /// Assigns the (CommutableOpIdx1, CommutableOpIdx2) pair of commutable - /// operand indices to (ResultIdx1, ResultIdx2). - /// One or both input values of the pair: (ResultIdx1, ResultIdx2) may be - /// predefined to some indices or be undefined (designated by the special - /// value 'CommuteAnyOperandIndex'). - /// The predefined result indices cannot be re-defined. - /// The function returns true iff after the result pair redefinition - /// the fixed result pair is equal to or equivalent to the source pair of - /// indices: (CommutableOpIdx1, CommutableOpIdx2). It is assumed here that - /// the pairs (x,y) and (y,x) are equivalent. - static bool fixCommutedOpIndices(unsigned &ResultIdx1, - unsigned &ResultIdx2, - unsigned CommutableOpIdx1, - unsigned CommutableOpIdx2); - -private: - /// For instructions with opcodes for which the M_REMATERIALIZABLE flag is - /// set and the target hook isReallyTriviallyReMaterializable returns false, - /// this function does target-independent tests to determine if the - /// instruction is really trivially rematerializable. - bool isReallyTriviallyReMaterializableGeneric(const MachineInstr *MI, - AliasAnalysis *AA) const; - -public: - /// These methods return the opcode of the frame setup/destroy instructions - /// if they exist (-1 otherwise). Some targets use pseudo instructions in - /// order to abstract away the difference between operating with a frame - /// pointer and operating without, through the use of these two instructions. - /// - unsigned getCallFrameSetupOpcode() const { return CallFrameSetupOpcode; } - unsigned getCallFrameDestroyOpcode() const { return CallFrameDestroyOpcode; } - - unsigned getCatchReturnOpcode() const { return CatchRetOpcode; } - - /// Returns the actual stack pointer adjustment made by an instruction - /// as part of a call sequence. By default, only call frame setup/destroy - /// instructions adjust the stack, but targets may want to override this - /// to enable more fine-grained adjustment, or adjust by a different value. - virtual int getSPAdjust(const MachineInstr *MI) const; - - /// Return true if the instruction is a "coalescable" extension instruction. - /// That is, it's like a copy where it's legal for the source to overlap the - /// destination. e.g. X86::MOVSX64rr32. If this returns true, then it's - /// expected the pre-extension value is available as a subreg of the result - /// register. This also returns the sub-register index in SubIdx. - virtual bool isCoalescableExtInstr(const MachineInstr &MI, - unsigned &SrcReg, unsigned &DstReg, - unsigned &SubIdx) const { - return false; - } - - /// If the specified machine instruction is a direct - /// load from a stack slot, return the virtual or physical register number of - /// the destination along with the FrameIndex of the loaded stack slot. If - /// not, return 0. This predicate must return 0 if the instruction has - /// any side effects other than loading from the stack slot. - virtual unsigned isLoadFromStackSlot(const MachineInstr *MI, - int &FrameIndex) const { - return 0; - } - - /// Check for post-frame ptr elimination stack locations as well. - /// This uses a heuristic so it isn't reliable for correctness. - virtual unsigned isLoadFromStackSlotPostFE(const MachineInstr *MI, - int &FrameIndex) const { - return 0; - } - - /// If the specified machine instruction has a load from a stack slot, - /// return true along with the FrameIndex of the loaded stack slot and the - /// machine mem operand containing the reference. - /// If not, return false. Unlike isLoadFromStackSlot, this returns true for - /// any instructions that loads from the stack. This is just a hint, as some - /// cases may be missed. - virtual bool hasLoadFromStackSlot(const MachineInstr *MI, - const MachineMemOperand *&MMO, - int &FrameIndex) const; - - /// If the specified machine instruction is a direct - /// store to a stack slot, return the virtual or physical register number of - /// the source reg along with the FrameIndex of the loaded stack slot. If - /// not, return 0. This predicate must return 0 if the instruction has - /// any side effects other than storing to the stack slot. - virtual unsigned isStoreToStackSlot(const MachineInstr *MI, - int &FrameIndex) const { - return 0; - } - - /// Check for post-frame ptr elimination stack locations as well. - /// This uses a heuristic, so it isn't reliable for correctness. - virtual unsigned isStoreToStackSlotPostFE(const MachineInstr *MI, - int &FrameIndex) const { - return 0; - } - - /// If the specified machine instruction has a store to a stack slot, - /// return true along with the FrameIndex of the loaded stack slot and the - /// machine mem operand containing the reference. - /// If not, return false. Unlike isStoreToStackSlot, - /// this returns true for any instructions that stores to the - /// stack. This is just a hint, as some cases may be missed. - virtual bool hasStoreToStackSlot(const MachineInstr *MI, - const MachineMemOperand *&MMO, - int &FrameIndex) const; - - /// Return true if the specified machine instruction - /// is a copy of one stack slot to another and has no other effect. - /// Provide the identity of the two frame indices. - virtual bool isStackSlotCopy(const MachineInstr *MI, int &DestFrameIndex, - int &SrcFrameIndex) const { - return false; - } - - /// Compute the size in bytes and offset within a stack slot of a spilled - /// register or subregister. - /// - /// \param [out] Size in bytes of the spilled value. - /// \param [out] Offset in bytes within the stack slot. - /// \returns true if both Size and Offset are successfully computed. - /// - /// Not all subregisters have computable spill slots. For example, - /// subregisters registers may not be byte-sized, and a pair of discontiguous - /// subregisters has no single offset. - /// - /// Targets with nontrivial bigendian implementations may need to override - /// this, particularly to support spilled vector registers. - virtual bool getStackSlotRange(const TargetRegisterClass *RC, unsigned SubIdx, - unsigned &Size, unsigned &Offset, - const MachineFunction &MF) const; - - /// Return true if the instruction is as cheap as a move instruction. - /// - /// Targets for different archs need to override this, and different - /// micro-architectures can also be finely tuned inside. - virtual bool isAsCheapAsAMove(const MachineInstr *MI) const { - return MI->isAsCheapAsAMove(); - } - - /// Re-issue the specified 'original' instruction at the - /// specific location targeting a new destination register. - /// The register in Orig->getOperand(0).getReg() will be substituted by - /// DestReg:SubIdx. Any existing subreg index is preserved or composed with - /// SubIdx. - virtual void reMaterialize(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - unsigned DestReg, unsigned SubIdx, - const MachineInstr *Orig, - const TargetRegisterInfo &TRI) const; - - /// Create a duplicate of the Orig instruction in MF. This is like - /// MachineFunction::CloneMachineInstr(), but the target may update operands - /// that are required to be unique. - /// - /// The instruction must be duplicable as indicated by isNotDuplicable(). - virtual MachineInstr *duplicate(MachineInstr *Orig, - MachineFunction &MF) const; - - /// This method must be implemented by targets that - /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target - /// may be able to convert a two-address instruction into one or more true - /// three-address instructions on demand. This allows the X86 target (for - /// example) to convert ADD and SHL instructions into LEA instructions if they - /// would require register copies due to two-addressness. - /// - /// This method returns a null pointer if the transformation cannot be - /// performed, otherwise it returns the last new instruction. - /// - virtual MachineInstr * - convertToThreeAddress(MachineFunction::iterator &MFI, - MachineBasicBlock::iterator &MBBI, LiveVariables *LV) const { - return nullptr; - } - - // This constant can be used as an input value of operand index passed to - // the method findCommutedOpIndices() to tell the method that the - // corresponding operand index is not pre-defined and that the method - // can pick any commutable operand. - static const unsigned CommuteAnyOperandIndex = ~0U; - - /// This method commutes the operands of the given machine instruction MI. - /// - /// The operands to be commuted are specified by their indices OpIdx1 and - /// OpIdx2. OpIdx1 and OpIdx2 arguments may be set to a special value - /// 'CommuteAnyOperandIndex', which means that the method is free to choose - /// any arbitrarily chosen commutable operand. If both arguments are set to - /// 'CommuteAnyOperandIndex' then the method looks for 2 different commutable - /// operands; then commutes them if such operands could be found. - /// - /// If NewMI is false, MI is modified in place and returned; otherwise, a - /// new machine instruction is created and returned. - /// - /// Do not call this method for a non-commutable instruction or - /// for non-commuable operands. - /// Even though the instruction is commutable, the method may still - /// fail to commute the operands, null pointer is returned in such cases. - MachineInstr * - commuteInstruction(MachineInstr *MI, - bool NewMI = false, - unsigned OpIdx1 = CommuteAnyOperandIndex, - unsigned OpIdx2 = CommuteAnyOperandIndex) const; - - /// Returns true iff the routine could find two commutable operands in the - /// given machine instruction. - /// The 'SrcOpIdx1' and 'SrcOpIdx2' are INPUT and OUTPUT arguments. - /// If any of the INPUT values is set to the special value - /// 'CommuteAnyOperandIndex' then the method arbitrarily picks a commutable - /// operand, then returns its index in the corresponding argument. - /// If both of INPUT values are set to 'CommuteAnyOperandIndex' then method - /// looks for 2 commutable operands. - /// If INPUT values refer to some operands of MI, then the method simply - /// returns true if the corresponding operands are commutable and returns - /// false otherwise. - /// - /// For example, calling this method this way: - /// unsigned Op1 = 1, Op2 = CommuteAnyOperandIndex; - /// findCommutedOpIndices(MI, Op1, Op2); - /// can be interpreted as a query asking to find an operand that would be - /// commutable with the operand#1. - virtual bool findCommutedOpIndices(MachineInstr *MI, unsigned &SrcOpIdx1, - unsigned &SrcOpIdx2) const; - - /// A pair composed of a register and a sub-register index. - /// Used to give some type checking when modeling Reg:SubReg. - struct RegSubRegPair { - unsigned Reg; - unsigned SubReg; - RegSubRegPair(unsigned Reg = 0, unsigned SubReg = 0) - : Reg(Reg), SubReg(SubReg) {} - }; - /// A pair composed of a pair of a register and a sub-register index, - /// and another sub-register index. - /// Used to give some type checking when modeling Reg:SubReg1, SubReg2. - struct RegSubRegPairAndIdx : RegSubRegPair { - unsigned SubIdx; - RegSubRegPairAndIdx(unsigned Reg = 0, unsigned SubReg = 0, - unsigned SubIdx = 0) - : RegSubRegPair(Reg, SubReg), SubIdx(SubIdx) {} - }; - - /// Build the equivalent inputs of a REG_SEQUENCE for the given \p MI - /// and \p DefIdx. - /// \p [out] InputRegs of the equivalent REG_SEQUENCE. Each element of - /// the list is modeled as <Reg:SubReg, SubIdx>. - /// E.g., REG_SEQUENCE vreg1:sub1, sub0, vreg2, sub1 would produce - /// two elements: - /// - vreg1:sub1, sub0 - /// - vreg2<:0>, sub1 - /// - /// \returns true if it is possible to build such an input sequence - /// with the pair \p MI, \p DefIdx. False otherwise. - /// - /// \pre MI.isRegSequence() or MI.isRegSequenceLike(). - /// - /// \note The generic implementation does not provide any support for - /// MI.isRegSequenceLike(). In other words, one has to override - /// getRegSequenceLikeInputs for target specific instructions. - bool - getRegSequenceInputs(const MachineInstr &MI, unsigned DefIdx, - SmallVectorImpl<RegSubRegPairAndIdx> &InputRegs) const; - - /// Build the equivalent inputs of a EXTRACT_SUBREG for the given \p MI - /// and \p DefIdx. - /// \p [out] InputReg of the equivalent EXTRACT_SUBREG. - /// E.g., EXTRACT_SUBREG vreg1:sub1, sub0, sub1 would produce: - /// - vreg1:sub1, sub0 - /// - /// \returns true if it is possible to build such an input sequence - /// with the pair \p MI, \p DefIdx. False otherwise. - /// - /// \pre MI.isExtractSubreg() or MI.isExtractSubregLike(). - /// - /// \note The generic implementation does not provide any support for - /// MI.isExtractSubregLike(). In other words, one has to override - /// getExtractSubregLikeInputs for target specific instructions. - bool - getExtractSubregInputs(const MachineInstr &MI, unsigned DefIdx, - RegSubRegPairAndIdx &InputReg) const; - - /// Build the equivalent inputs of a INSERT_SUBREG for the given \p MI - /// and \p DefIdx. - /// \p [out] BaseReg and \p [out] InsertedReg contain - /// the equivalent inputs of INSERT_SUBREG. - /// E.g., INSERT_SUBREG vreg0:sub0, vreg1:sub1, sub3 would produce: - /// - BaseReg: vreg0:sub0 - /// - InsertedReg: vreg1:sub1, sub3 - /// - /// \returns true if it is possible to build such an input sequence - /// with the pair \p MI, \p DefIdx. False otherwise. - /// - /// \pre MI.isInsertSubreg() or MI.isInsertSubregLike(). - /// - /// \note The generic implementation does not provide any support for - /// MI.isInsertSubregLike(). In other words, one has to override - /// getInsertSubregLikeInputs for target specific instructions. - bool - getInsertSubregInputs(const MachineInstr &MI, unsigned DefIdx, - RegSubRegPair &BaseReg, - RegSubRegPairAndIdx &InsertedReg) const; - - - /// Return true if two machine instructions would produce identical values. - /// By default, this is only true when the two instructions - /// are deemed identical except for defs. If this function is called when the - /// IR is still in SSA form, the caller can pass the MachineRegisterInfo for - /// aggressive checks. - virtual bool produceSameValue(const MachineInstr *MI0, - const MachineInstr *MI1, - const MachineRegisterInfo *MRI = nullptr) const; - - /// Analyze the branching code at the end of MBB, returning - /// true if it cannot be understood (e.g. it's a switch dispatch or isn't - /// implemented for a target). Upon success, this returns false and returns - /// with the following information in various cases: - /// - /// 1. If this block ends with no branches (it just falls through to its succ) - /// just return false, leaving TBB/FBB null. - /// 2. If this block ends with only an unconditional branch, it sets TBB to be - /// the destination block. - /// 3. If this block ends with a conditional branch and it falls through to a - /// successor block, it sets TBB to be the branch destination block and a - /// list of operands that evaluate the condition. These operands can be - /// passed to other TargetInstrInfo methods to create new branches. - /// 4. If this block ends with a conditional branch followed by an - /// unconditional branch, it returns the 'true' destination in TBB, the - /// 'false' destination in FBB, and a list of operands that evaluate the - /// condition. These operands can be passed to other TargetInstrInfo - /// methods to create new branches. - /// - /// Note that RemoveBranch and InsertBranch must be implemented to support - /// cases where this method returns success. - /// - /// If AllowModify is true, then this routine is allowed to modify the basic - /// block (e.g. delete instructions after the unconditional branch). - /// - virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, - MachineBasicBlock *&FBB, - SmallVectorImpl<MachineOperand> &Cond, - bool AllowModify = false) const { - return true; - } - - /// Represents a predicate at the MachineFunction level. The control flow a - /// MachineBranchPredicate represents is: - /// - /// Reg <def>= LHS `Predicate` RHS == ConditionDef - /// if Reg then goto TrueDest else goto FalseDest - /// - struct MachineBranchPredicate { - enum ComparePredicate { - PRED_EQ, // True if two values are equal - PRED_NE, // True if two values are not equal - PRED_INVALID // Sentinel value - }; - - ComparePredicate Predicate; - MachineOperand LHS; - MachineOperand RHS; - MachineBasicBlock *TrueDest; - MachineBasicBlock *FalseDest; - MachineInstr *ConditionDef; - - /// SingleUseCondition is true if ConditionDef is dead except for the - /// branch(es) at the end of the basic block. - /// - bool SingleUseCondition; - - explicit MachineBranchPredicate() - : Predicate(PRED_INVALID), LHS(MachineOperand::CreateImm(0)), - RHS(MachineOperand::CreateImm(0)), TrueDest(nullptr), - FalseDest(nullptr), ConditionDef(nullptr), SingleUseCondition(false) { - } - }; - - /// Analyze the branching code at the end of MBB and parse it into the - /// MachineBranchPredicate structure if possible. Returns false on success - /// and true on failure. - /// - /// If AllowModify is true, then this routine is allowed to modify the basic - /// block (e.g. delete instructions after the unconditional branch). - /// - virtual bool AnalyzeBranchPredicate(MachineBasicBlock &MBB, - MachineBranchPredicate &MBP, - bool AllowModify = false) const { - return true; - } - - /// Remove the branching code at the end of the specific MBB. - /// This is only invoked in cases where AnalyzeBranch returns success. It - /// returns the number of instructions that were removed. - virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const { - llvm_unreachable("Target didn't implement TargetInstrInfo::RemoveBranch!"); - } - - /// Insert branch code into the end of the specified MachineBasicBlock. - /// The operands to this method are the same as those - /// returned by AnalyzeBranch. This is only invoked in cases where - /// AnalyzeBranch returns success. It returns the number of instructions - /// inserted. - /// - /// It is also invoked by tail merging to add unconditional branches in - /// cases where AnalyzeBranch doesn't apply because there was no original - /// branch to analyze. At least this much must be implemented, else tail - /// merging needs to be disabled. - virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, - MachineBasicBlock *FBB, - ArrayRef<MachineOperand> Cond, - DebugLoc DL) const { - llvm_unreachable("Target didn't implement TargetInstrInfo::InsertBranch!"); - } - - /// Delete the instruction OldInst and everything after it, replacing it with - /// an unconditional branch to NewDest. This is used by the tail merging pass. - virtual void ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail, - MachineBasicBlock *NewDest) const; - - /// Get an instruction that performs an unconditional branch to the given - /// symbol. - virtual void - getUnconditionalBranch(MCInst &MI, - const MCSymbolRefExpr *BranchTarget) const { - llvm_unreachable("Target didn't implement " - "TargetInstrInfo::getUnconditionalBranch!"); - } - - /// Get a machine trap instruction. - virtual void getTrap(MCInst &MI) const { - llvm_unreachable("Target didn't implement TargetInstrInfo::getTrap!"); - } - - /// Get a number of bytes that suffices to hold - /// either the instruction returned by getUnconditionalBranch or the - /// instruction returned by getTrap. This only makes sense because - /// getUnconditionalBranch returns a single, specific instruction. This - /// information is needed by the jumptable construction code, since it must - /// decide how many bytes to use for a jumptable entry so it can generate the - /// right mask. - /// - /// Note that if the jumptable instruction requires alignment, then that - /// alignment should be factored into this required bound so that the - /// resulting bound gives the right alignment for the instruction. - virtual unsigned getJumpInstrTableEntryBound() const { - // This method gets called by LLVMTargetMachine always, so it can't fail - // just because there happens to be no implementation for this target. - // Any code that tries to use a jumptable annotation without defining - // getUnconditionalBranch on the appropriate Target will fail anyway, and - // the value returned here won't matter in that case. - return 0; - } - - /// Return true if it's legal to split the given basic - /// block at the specified instruction (i.e. instruction would be the start - /// of a new basic block). - virtual bool isLegalToSplitMBBAt(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MBBI) const { - return true; - } - - /// Return true if it's profitable to predicate - /// instructions with accumulated instruction latency of "NumCycles" - /// of the specified basic block, where the probability of the instructions - /// being executed is given by Probability, and Confidence is a measure - /// of our confidence that it will be properly predicted. - virtual - bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, - unsigned ExtraPredCycles, - BranchProbability Probability) const { - return false; - } - - /// Second variant of isProfitableToIfCvt. This one - /// checks for the case where two basic blocks from true and false path - /// of a if-then-else (diamond) are predicated on mutally exclusive - /// predicates, where the probability of the true path being taken is given - /// by Probability, and Confidence is a measure of our confidence that it - /// will be properly predicted. - virtual bool - isProfitableToIfCvt(MachineBasicBlock &TMBB, - unsigned NumTCycles, unsigned ExtraTCycles, - MachineBasicBlock &FMBB, - unsigned NumFCycles, unsigned ExtraFCycles, - BranchProbability Probability) const { - return false; - } - - /// Return true if it's profitable for if-converter to duplicate instructions - /// of specified accumulated instruction latencies in the specified MBB to - /// enable if-conversion. - /// The probability of the instructions being executed is given by - /// Probability, and Confidence is a measure of our confidence that it - /// will be properly predicted. - virtual bool - isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, - BranchProbability Probability) const { - return false; - } - - /// Return true if it's profitable to unpredicate - /// one side of a 'diamond', i.e. two sides of if-else predicated on mutually - /// exclusive predicates. - /// e.g. - /// subeq r0, r1, #1 - /// addne r0, r1, #1 - /// => - /// sub r0, r1, #1 - /// addne r0, r1, #1 - /// - /// This may be profitable is conditional instructions are always executed. - virtual bool isProfitableToUnpredicate(MachineBasicBlock &TMBB, - MachineBasicBlock &FMBB) const { - return false; - } - - /// Return true if it is possible to insert a select - /// instruction that chooses between TrueReg and FalseReg based on the - /// condition code in Cond. - /// - /// When successful, also return the latency in cycles from TrueReg, - /// FalseReg, and Cond to the destination register. In most cases, a select - /// instruction will be 1 cycle, so CondCycles = TrueCycles = FalseCycles = 1 - /// - /// Some x86 implementations have 2-cycle cmov instructions. - /// - /// @param MBB Block where select instruction would be inserted. - /// @param Cond Condition returned by AnalyzeBranch. - /// @param TrueReg Virtual register to select when Cond is true. - /// @param FalseReg Virtual register to select when Cond is false. - /// @param CondCycles Latency from Cond+Branch to select output. - /// @param TrueCycles Latency from TrueReg to select output. - /// @param FalseCycles Latency from FalseReg to select output. - virtual bool canInsertSelect(const MachineBasicBlock &MBB, - ArrayRef<MachineOperand> Cond, - unsigned TrueReg, unsigned FalseReg, - int &CondCycles, - int &TrueCycles, int &FalseCycles) const { - return false; - } - - /// Insert a select instruction into MBB before I that will copy TrueReg to - /// DstReg when Cond is true, and FalseReg to DstReg when Cond is false. - /// - /// This function can only be called after canInsertSelect() returned true. - /// The condition in Cond comes from AnalyzeBranch, and it can be assumed - /// that the same flags or registers required by Cond are available at the - /// insertion point. - /// - /// @param MBB Block where select instruction should be inserted. - /// @param I Insertion point. - /// @param DL Source location for debugging. - /// @param DstReg Virtual register to be defined by select instruction. - /// @param Cond Condition as computed by AnalyzeBranch. - /// @param TrueReg Virtual register to copy when Cond is true. - /// @param FalseReg Virtual register to copy when Cons is false. - virtual void insertSelect(MachineBasicBlock &MBB, - MachineBasicBlock::iterator I, DebugLoc DL, - unsigned DstReg, ArrayRef<MachineOperand> Cond, - unsigned TrueReg, unsigned FalseReg) const { - llvm_unreachable("Target didn't implement TargetInstrInfo::insertSelect!"); - } - - /// Analyze the given select instruction, returning true if - /// it cannot be understood. It is assumed that MI->isSelect() is true. - /// - /// When successful, return the controlling condition and the operands that - /// determine the true and false result values. - /// - /// Result = SELECT Cond, TrueOp, FalseOp - /// - /// Some targets can optimize select instructions, for example by predicating - /// the instruction defining one of the operands. Such targets should set - /// Optimizable. - /// - /// @param MI Select instruction to analyze. - /// @param Cond Condition controlling the select. - /// @param TrueOp Operand number of the value selected when Cond is true. - /// @param FalseOp Operand number of the value selected when Cond is false. - /// @param Optimizable Returned as true if MI is optimizable. - /// @returns False on success. - virtual bool analyzeSelect(const MachineInstr *MI, - SmallVectorImpl<MachineOperand> &Cond, - unsigned &TrueOp, unsigned &FalseOp, - bool &Optimizable) const { - assert(MI && MI->getDesc().isSelect() && "MI must be a select instruction"); - return true; - } - - /// Given a select instruction that was understood by - /// analyzeSelect and returned Optimizable = true, attempt to optimize MI by - /// merging it with one of its operands. Returns NULL on failure. - /// - /// When successful, returns the new select instruction. The client is - /// responsible for deleting MI. - /// - /// If both sides of the select can be optimized, PreferFalse is used to pick - /// a side. - /// - /// @param MI Optimizable select instruction. - /// @param NewMIs Set that record all MIs in the basic block up to \p - /// MI. Has to be updated with any newly created MI or deleted ones. - /// @param PreferFalse Try to optimize FalseOp instead of TrueOp. - /// @returns Optimized instruction or NULL. - virtual MachineInstr *optimizeSelect(MachineInstr *MI, - SmallPtrSetImpl<MachineInstr *> &NewMIs, - bool PreferFalse = false) const { - // This function must be implemented if Optimizable is ever set. - llvm_unreachable("Target must implement TargetInstrInfo::optimizeSelect!"); - } - - /// Emit instructions to copy a pair of physical registers. - /// - /// This function should support copies within any legal register class as - /// well as any cross-class copies created during instruction selection. - /// - /// The source and destination registers may overlap, which may require a - /// careful implementation when multiple copy instructions are required for - /// large registers. See for example the ARM target. - virtual void copyPhysReg(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, DebugLoc DL, - unsigned DestReg, unsigned SrcReg, - bool KillSrc) const { - llvm_unreachable("Target didn't implement TargetInstrInfo::copyPhysReg!"); - } - - /// Store the specified register of the given register class to the specified - /// stack frame index. The store instruction is to be added to the given - /// machine basic block before the specified machine instruction. If isKill - /// is true, the register operand is the last use and must be marked kill. - virtual void storeRegToStackSlot(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - unsigned SrcReg, bool isKill, int FrameIndex, - const TargetRegisterClass *RC, - const TargetRegisterInfo *TRI) const { - llvm_unreachable("Target didn't implement " - "TargetInstrInfo::storeRegToStackSlot!"); - } - - /// Load the specified register of the given register class from the specified - /// stack frame index. The load instruction is to be added to the given - /// machine basic block before the specified machine instruction. - virtual void loadRegFromStackSlot(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - unsigned DestReg, int FrameIndex, - const TargetRegisterClass *RC, - const TargetRegisterInfo *TRI) const { - llvm_unreachable("Target didn't implement " - "TargetInstrInfo::loadRegFromStackSlot!"); - } - - /// This function is called for all pseudo instructions - /// that remain after register allocation. Many pseudo instructions are - /// created to help register allocation. This is the place to convert them - /// into real instructions. The target can edit MI in place, or it can insert - /// new instructions and erase MI. The function should return true if - /// anything was changed. - virtual bool expandPostRAPseudo(MachineBasicBlock::iterator MI) const { - return false; - } - - /// Attempt to fold a load or store of the specified stack - /// slot into the specified machine instruction for the specified operand(s). - /// If this is possible, a new instruction is returned with the specified - /// operand folded, otherwise NULL is returned. - /// The new instruction is inserted before MI, and the client is responsible - /// for removing the old instruction. - MachineInstr *foldMemoryOperand(MachineBasicBlock::iterator MI, - ArrayRef<unsigned> Ops, int FrameIndex) const; - - /// Same as the previous version except it allows folding of any load and - /// store from / to any address, not just from a specific stack slot. - MachineInstr *foldMemoryOperand(MachineBasicBlock::iterator MI, - ArrayRef<unsigned> Ops, - MachineInstr *LoadMI) const; - - /// Return true when there is potentially a faster code sequence - /// for an instruction chain ending in \p Root. All potential patterns are - /// returned in the \p Pattern vector. Pattern should be sorted in priority - /// order since the pattern evaluator stops checking as soon as it finds a - /// faster sequence. - /// \param Root - Instruction that could be combined with one of its operands - /// \param Patterns - Vector of possible combination patterns - virtual bool getMachineCombinerPatterns( - MachineInstr &Root, - SmallVectorImpl<MachineCombinerPattern> &Patterns) const; - - /// Return true if the input \P Inst is part of a chain of dependent ops - /// that are suitable for reassociation, otherwise return false. - /// If the instruction's operands must be commuted to have a previous - /// instruction of the same type define the first source operand, \P Commuted - /// will be set to true. - bool isReassociationCandidate(const MachineInstr &Inst, bool &Commuted) const; - - /// Return true when \P Inst is both associative and commutative. - virtual bool isAssociativeAndCommutative(const MachineInstr &Inst) const { - return false; - } - - /// Return true when \P Inst has reassociable operands in the same \P MBB. - virtual bool hasReassociableOperands(const MachineInstr &Inst, - const MachineBasicBlock *MBB) const; - - /// Return true when \P Inst has reassociable sibling. - bool hasReassociableSibling(const MachineInstr &Inst, bool &Commuted) const; - - /// When getMachineCombinerPatterns() finds patterns, this function generates - /// the instructions that could replace the original code sequence. The client - /// has to decide whether the actual replacement is beneficial or not. - /// \param Root - Instruction that could be combined with one of its operands - /// \param Pattern - Combination pattern for Root - /// \param InsInstrs - Vector of new instructions that implement P - /// \param DelInstrs - Old instructions, including Root, that could be - /// replaced by InsInstr - /// \param InstrIdxForVirtReg - map of virtual register to instruction in - /// InsInstr that defines it - virtual void genAlternativeCodeSequence( - MachineInstr &Root, MachineCombinerPattern Pattern, - SmallVectorImpl<MachineInstr *> &InsInstrs, - SmallVectorImpl<MachineInstr *> &DelInstrs, - DenseMap<unsigned, unsigned> &InstrIdxForVirtReg) const; - - /// Attempt to reassociate \P Root and \P Prev according to \P Pattern to - /// reduce critical path length. - void reassociateOps(MachineInstr &Root, MachineInstr &Prev, - MachineCombinerPattern Pattern, - SmallVectorImpl<MachineInstr *> &InsInstrs, - SmallVectorImpl<MachineInstr *> &DelInstrs, - DenseMap<unsigned, unsigned> &InstrIdxForVirtReg) const; - - /// This is an architecture-specific helper function of reassociateOps. - /// Set special operand attributes for new instructions after reassociation. - virtual void setSpecialOperandAttr(MachineInstr &OldMI1, MachineInstr &OldMI2, - MachineInstr &NewMI1, - MachineInstr &NewMI2) const { - return; - }; - - /// Return true when a target supports MachineCombiner. - virtual bool useMachineCombiner() const { return false; } - -protected: - /// Target-dependent implementation for foldMemoryOperand. - /// Target-independent code in foldMemoryOperand will - /// take care of adding a MachineMemOperand to the newly created instruction. - /// The instruction and any auxiliary instructions necessary will be inserted - /// at InsertPt. - virtual MachineInstr *foldMemoryOperandImpl( - MachineFunction &MF, MachineInstr *MI, ArrayRef<unsigned> Ops, - MachineBasicBlock::iterator InsertPt, int FrameIndex) const { - return nullptr; - } - - /// Target-dependent implementation for foldMemoryOperand. - /// Target-independent code in foldMemoryOperand will - /// take care of adding a MachineMemOperand to the newly created instruction. - /// The instruction and any auxiliary instructions necessary will be inserted - /// at InsertPt. - virtual MachineInstr *foldMemoryOperandImpl( - MachineFunction &MF, MachineInstr *MI, ArrayRef<unsigned> Ops, - MachineBasicBlock::iterator InsertPt, MachineInstr *LoadMI) const { - return nullptr; - } - - /// \brief Target-dependent implementation of getRegSequenceInputs. - /// - /// \returns true if it is possible to build the equivalent - /// REG_SEQUENCE inputs with the pair \p MI, \p DefIdx. False otherwise. - /// - /// \pre MI.isRegSequenceLike(). - /// - /// \see TargetInstrInfo::getRegSequenceInputs. - virtual bool getRegSequenceLikeInputs( - const MachineInstr &MI, unsigned DefIdx, - SmallVectorImpl<RegSubRegPairAndIdx> &InputRegs) const { - return false; - } - - /// \brief Target-dependent implementation of getExtractSubregInputs. - /// - /// \returns true if it is possible to build the equivalent - /// EXTRACT_SUBREG inputs with the pair \p MI, \p DefIdx. False otherwise. - /// - /// \pre MI.isExtractSubregLike(). - /// - /// \see TargetInstrInfo::getExtractSubregInputs. - virtual bool getExtractSubregLikeInputs( - const MachineInstr &MI, unsigned DefIdx, - RegSubRegPairAndIdx &InputReg) const { - return false; - } - - /// \brief Target-dependent implementation of getInsertSubregInputs. - /// - /// \returns true if it is possible to build the equivalent - /// INSERT_SUBREG inputs with the pair \p MI, \p DefIdx. False otherwise. - /// - /// \pre MI.isInsertSubregLike(). - /// - /// \see TargetInstrInfo::getInsertSubregInputs. - virtual bool - getInsertSubregLikeInputs(const MachineInstr &MI, unsigned DefIdx, - RegSubRegPair &BaseReg, - RegSubRegPairAndIdx &InsertedReg) const { - return false; - } - -public: - /// unfoldMemoryOperand - Separate a single instruction which folded a load or - /// a store or a load and a store into two or more instruction. If this is - /// possible, returns true as well as the new instructions by reference. - virtual bool unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI, - unsigned Reg, bool UnfoldLoad, bool UnfoldStore, - SmallVectorImpl<MachineInstr*> &NewMIs) const{ - return false; - } - - virtual bool unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N, - SmallVectorImpl<SDNode*> &NewNodes) const { - return false; - } - - /// Returns the opcode of the would be new - /// instruction after load / store are unfolded from an instruction of the - /// specified opcode. It returns zero if the specified unfolding is not - /// possible. If LoadRegIndex is non-null, it is filled in with the operand - /// index of the operand which will hold the register holding the loaded - /// value. - virtual unsigned getOpcodeAfterMemoryUnfold(unsigned Opc, - bool UnfoldLoad, bool UnfoldStore, - unsigned *LoadRegIndex = nullptr) const { - return 0; - } - - /// This is used by the pre-regalloc scheduler to determine if two loads are - /// loading from the same base address. It should only return true if the base - /// pointers are the same and the only differences between the two addresses - /// are the offset. It also returns the offsets by reference. - virtual bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, - int64_t &Offset1, int64_t &Offset2) const { - return false; - } - - /// This is a used by the pre-regalloc scheduler to determine (in conjunction - /// with areLoadsFromSameBasePtr) if two loads should be scheduled together. - /// On some targets if two loads are loading from - /// addresses in the same cache line, it's better if they are scheduled - /// together. This function takes two integers that represent the load offsets - /// from the common base address. It returns true if it decides it's desirable - /// to schedule the two loads together. "NumLoads" is the number of loads that - /// have already been scheduled after Load1. - virtual bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, - int64_t Offset1, int64_t Offset2, - unsigned NumLoads) const { - return false; - } - - /// Get the base register and byte offset of an instruction that reads/writes - /// memory. - virtual bool getMemOpBaseRegImmOfs(MachineInstr *MemOp, unsigned &BaseReg, - unsigned &Offset, - const TargetRegisterInfo *TRI) const { - return false; - } - - virtual bool enableClusterLoads() const { return false; } - - virtual bool shouldClusterLoads(MachineInstr *FirstLdSt, - MachineInstr *SecondLdSt, - unsigned NumLoads) const { - return false; - } - - /// Can this target fuse the given instructions if they are scheduled - /// adjacent. - virtual bool shouldScheduleAdjacent(MachineInstr* First, - MachineInstr *Second) const { - return false; - } - - /// Reverses the branch condition of the specified condition list, - /// returning false on success and true if it cannot be reversed. - virtual - bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const { - return true; - } - - /// Insert a noop into the instruction stream at the specified point. - virtual void insertNoop(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI) const; - - - /// Return the noop instruction to use for a noop. - virtual void getNoopForMachoTarget(MCInst &NopInst) const; - - - /// Returns true if the instruction is already predicated. - virtual bool isPredicated(const MachineInstr *MI) const { - return false; - } - - /// Returns true if the instruction is a - /// terminator instruction that has not been predicated. - virtual bool isUnpredicatedTerminator(const MachineInstr *MI) const; - - /// Convert the instruction into a predicated instruction. - /// It returns true if the operation was successful. - virtual - bool PredicateInstruction(MachineInstr *MI, - ArrayRef<MachineOperand> Pred) const; - - /// Returns true if the first specified predicate - /// subsumes the second, e.g. GE subsumes GT. - virtual - bool SubsumesPredicate(ArrayRef<MachineOperand> Pred1, - ArrayRef<MachineOperand> Pred2) const { - return false; - } - - /// If the specified instruction defines any predicate - /// or condition code register(s) used for predication, returns true as well - /// as the definition predicate(s) by reference. - virtual bool DefinesPredicate(MachineInstr *MI, - std::vector<MachineOperand> &Pred) const { - return false; - } - - /// Return true if the specified instruction can be predicated. - /// By default, this returns true for every instruction with a - /// PredicateOperand. - virtual bool isPredicable(MachineInstr *MI) const { - return MI->getDesc().isPredicable(); - } - - /// Return true if it's safe to move a machine - /// instruction that defines the specified register class. - virtual bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const { - return true; - } - - /// Test if the given instruction should be considered a scheduling boundary. - /// This primarily includes labels and terminators. - virtual bool isSchedulingBoundary(const MachineInstr *MI, - const MachineBasicBlock *MBB, - const MachineFunction &MF) const; - - /// Measure the specified inline asm to determine an approximation of its - /// length. - virtual unsigned getInlineAsmLength(const char *Str, - const MCAsmInfo &MAI) const; - - /// Allocate and return a hazard recognizer to use for this target when - /// scheduling the machine instructions before register allocation. - virtual ScheduleHazardRecognizer* - CreateTargetHazardRecognizer(const TargetSubtargetInfo *STI, - const ScheduleDAG *DAG) const; - - /// Allocate and return a hazard recognizer to use for this target when - /// scheduling the machine instructions before register allocation. - virtual ScheduleHazardRecognizer* - CreateTargetMIHazardRecognizer(const InstrItineraryData*, - const ScheduleDAG *DAG) const; - - /// Allocate and return a hazard recognizer to use for this target when - /// scheduling the machine instructions after register allocation. - virtual ScheduleHazardRecognizer* - CreateTargetPostRAHazardRecognizer(const InstrItineraryData*, - const ScheduleDAG *DAG) const; - - /// Provide a global flag for disabling the PreRA hazard recognizer that - /// targets may choose to honor. - bool usePreRAHazardRecognizer() const; - - /// For a comparison instruction, return the source registers - /// in SrcReg and SrcReg2 if having two register operands, and the value it - /// compares against in CmpValue. Return true if the comparison instruction - /// can be analyzed. - virtual bool analyzeCompare(const MachineInstr *MI, - unsigned &SrcReg, unsigned &SrcReg2, - int &Mask, int &Value) const { - return false; - } - - /// See if the comparison instruction can be converted - /// into something more efficient. E.g., on ARM most instructions can set the - /// flags register, obviating the need for a separate CMP. - virtual bool optimizeCompareInstr(MachineInstr *CmpInstr, - unsigned SrcReg, unsigned SrcReg2, - int Mask, int Value, - const MachineRegisterInfo *MRI) const { - return false; - } - virtual bool optimizeCondBranch(MachineInstr *MI) const { return false; } - - /// Try to remove the load by folding it to a register operand at the use. - /// We fold the load instructions if and only if the - /// def and use are in the same BB. We only look at one load and see - /// whether it can be folded into MI. FoldAsLoadDefReg is the virtual register - /// defined by the load we are trying to fold. DefMI returns the machine - /// instruction that defines FoldAsLoadDefReg, and the function returns - /// the machine instruction generated due to folding. - virtual MachineInstr* optimizeLoadInstr(MachineInstr *MI, - const MachineRegisterInfo *MRI, - unsigned &FoldAsLoadDefReg, - MachineInstr *&DefMI) const { - return nullptr; - } - - /// 'Reg' is known to be defined by a move immediate instruction, - /// try to fold the immediate into the use instruction. - /// If MRI->hasOneNonDBGUse(Reg) is true, and this function returns true, - /// then the caller may assume that DefMI has been erased from its parent - /// block. The caller may assume that it will not be erased by this - /// function otherwise. - virtual bool FoldImmediate(MachineInstr *UseMI, MachineInstr *DefMI, - unsigned Reg, MachineRegisterInfo *MRI) const { - return false; - } - - /// Return the number of u-operations the given machine - /// instruction will be decoded to on the target cpu. The itinerary's - /// IssueWidth is the number of microops that can be dispatched each - /// cycle. An instruction with zero microops takes no dispatch resources. - virtual unsigned getNumMicroOps(const InstrItineraryData *ItinData, - const MachineInstr *MI) const; - - /// Return true for pseudo instructions that don't consume any - /// machine resources in their current form. These are common cases that the - /// scheduler should consider free, rather than conservatively handling them - /// as instructions with no itinerary. - bool isZeroCost(unsigned Opcode) const { - return Opcode <= TargetOpcode::COPY; - } - - virtual int getOperandLatency(const InstrItineraryData *ItinData, - SDNode *DefNode, unsigned DefIdx, - SDNode *UseNode, unsigned UseIdx) const; - - /// Compute and return the use operand latency of a given pair of def and use. - /// In most cases, the static scheduling itinerary was enough to determine the - /// operand latency. But it may not be possible for instructions with variable - /// number of defs / uses. - /// - /// This is a raw interface to the itinerary that may be directly overridden - /// by a target. Use computeOperandLatency to get the best estimate of - /// latency. - virtual int getOperandLatency(const InstrItineraryData *ItinData, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, - unsigned UseIdx) const; - - /// Compute and return the latency of the given data - /// dependent def and use when the operand indices are already known. - unsigned computeOperandLatency(const InstrItineraryData *ItinData, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, unsigned UseIdx) - const; - - /// Compute the instruction latency of a given instruction. - /// If the instruction has higher cost when predicated, it's returned via - /// PredCost. - virtual unsigned getInstrLatency(const InstrItineraryData *ItinData, - const MachineInstr *MI, - unsigned *PredCost = nullptr) const; - - virtual unsigned getPredicationCost(const MachineInstr *MI) const; - - virtual int getInstrLatency(const InstrItineraryData *ItinData, - SDNode *Node) const; - - /// Return the default expected latency for a def based on it's opcode. - unsigned defaultDefLatency(const MCSchedModel &SchedModel, - const MachineInstr *DefMI) const; - - int computeDefOperandLatency(const InstrItineraryData *ItinData, - const MachineInstr *DefMI) const; - - /// Return true if this opcode has high latency to its result. - virtual bool isHighLatencyDef(int opc) const { return false; } - - /// Compute operand latency between a def of 'Reg' - /// and a use in the current loop. Return true if the target considered - /// it 'high'. This is used by optimization passes such as machine LICM to - /// determine whether it makes sense to hoist an instruction out even in a - /// high register pressure situation. - virtual - bool hasHighOperandLatency(const TargetSchedModel &SchedModel, - const MachineRegisterInfo *MRI, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, unsigned UseIdx) const { - return false; - } - - /// Compute operand latency of a def of 'Reg'. Return true - /// if the target considered it 'low'. - virtual - bool hasLowDefLatency(const TargetSchedModel &SchedModel, - const MachineInstr *DefMI, unsigned DefIdx) const; - - /// Perform target-specific instruction verification. - virtual - bool verifyInstruction(const MachineInstr *MI, StringRef &ErrInfo) const { - return true; - } - - /// Return the current execution domain and bit mask of - /// possible domains for instruction. - /// - /// Some micro-architectures have multiple execution domains, and multiple - /// opcodes that perform the same operation in different domains. For - /// example, the x86 architecture provides the por, orps, and orpd - /// instructions that all do the same thing. There is a latency penalty if a - /// register is written in one domain and read in another. - /// - /// This function returns a pair (domain, mask) containing the execution - /// domain of MI, and a bit mask of possible domains. The setExecutionDomain - /// function can be used to change the opcode to one of the domains in the - /// bit mask. Instructions whose execution domain can't be changed should - /// return a 0 mask. - /// - /// The execution domain numbers don't have any special meaning except domain - /// 0 is used for instructions that are not associated with any interesting - /// execution domain. - /// - virtual std::pair<uint16_t, uint16_t> - getExecutionDomain(const MachineInstr *MI) const { - return std::make_pair(0, 0); - } - - /// Change the opcode of MI to execute in Domain. - /// - /// The bit (1 << Domain) must be set in the mask returned from - /// getExecutionDomain(MI). - virtual void setExecutionDomain(MachineInstr *MI, unsigned Domain) const {} - - - /// Returns the preferred minimum clearance - /// before an instruction with an unwanted partial register update. - /// - /// Some instructions only write part of a register, and implicitly need to - /// read the other parts of the register. This may cause unwanted stalls - /// preventing otherwise unrelated instructions from executing in parallel in - /// an out-of-order CPU. - /// - /// For example, the x86 instruction cvtsi2ss writes its result to bits - /// [31:0] of the destination xmm register. Bits [127:32] are unaffected, so - /// the instruction needs to wait for the old value of the register to become - /// available: - /// - /// addps %xmm1, %xmm0 - /// movaps %xmm0, (%rax) - /// cvtsi2ss %rbx, %xmm0 - /// - /// In the code above, the cvtsi2ss instruction needs to wait for the addps - /// instruction before it can issue, even though the high bits of %xmm0 - /// probably aren't needed. - /// - /// This hook returns the preferred clearance before MI, measured in - /// instructions. Other defs of MI's operand OpNum are avoided in the last N - /// instructions before MI. It should only return a positive value for - /// unwanted dependencies. If the old bits of the defined register have - /// useful values, or if MI is determined to otherwise read the dependency, - /// the hook should return 0. - /// - /// The unwanted dependency may be handled by: - /// - /// 1. Allocating the same register for an MI def and use. That makes the - /// unwanted dependency identical to a required dependency. - /// - /// 2. Allocating a register for the def that has no defs in the previous N - /// instructions. - /// - /// 3. Calling breakPartialRegDependency() with the same arguments. This - /// allows the target to insert a dependency breaking instruction. - /// - virtual unsigned - getPartialRegUpdateClearance(const MachineInstr *MI, unsigned OpNum, - const TargetRegisterInfo *TRI) const { - // The default implementation returns 0 for no partial register dependency. - return 0; - } - - /// \brief Return the minimum clearance before an instruction that reads an - /// unused register. - /// - /// For example, AVX instructions may copy part of a register operand into - /// the unused high bits of the destination register. - /// - /// vcvtsi2sdq %rax, %xmm0<undef>, %xmm14 - /// - /// In the code above, vcvtsi2sdq copies %xmm0[127:64] into %xmm14 creating a - /// false dependence on any previous write to %xmm0. - /// - /// This hook works similarly to getPartialRegUpdateClearance, except that it - /// does not take an operand index. Instead sets \p OpNum to the index of the - /// unused register. - virtual unsigned getUndefRegClearance(const MachineInstr *MI, unsigned &OpNum, - const TargetRegisterInfo *TRI) const { - // The default implementation returns 0 for no undef register dependency. - return 0; - } - - /// Insert a dependency-breaking instruction - /// before MI to eliminate an unwanted dependency on OpNum. - /// - /// If it wasn't possible to avoid a def in the last N instructions before MI - /// (see getPartialRegUpdateClearance), this hook will be called to break the - /// unwanted dependency. - /// - /// On x86, an xorps instruction can be used as a dependency breaker: - /// - /// addps %xmm1, %xmm0 - /// movaps %xmm0, (%rax) - /// xorps %xmm0, %xmm0 - /// cvtsi2ss %rbx, %xmm0 - /// - /// An <imp-kill> operand should be added to MI if an instruction was - /// inserted. This ties the instructions together in the post-ra scheduler. - /// - virtual void - breakPartialRegDependency(MachineBasicBlock::iterator MI, unsigned OpNum, - const TargetRegisterInfo *TRI) const {} - - /// Create machine specific model for scheduling. - virtual DFAPacketizer * - CreateTargetScheduleState(const TargetSubtargetInfo &) const { - return nullptr; - } - - // Sometimes, it is possible for the target - // to tell, even without aliasing information, that two MIs access different - // memory addresses. This function returns true if two MIs access different - // memory addresses and false otherwise. - virtual bool - areMemAccessesTriviallyDisjoint(MachineInstr *MIa, MachineInstr *MIb, - AliasAnalysis *AA = nullptr) const { - assert(MIa && (MIa->mayLoad() || MIa->mayStore()) && - "MIa must load from or modify a memory location"); - assert(MIb && (MIb->mayLoad() || MIb->mayStore()) && - "MIb must load from or modify a memory location"); - return false; - } - - /// \brief Return the value to use for the MachineCSE's LookAheadLimit, - /// which is a heuristic used for CSE'ing phys reg defs. - virtual unsigned getMachineCSELookAheadLimit () const { - // The default lookahead is small to prevent unprofitable quadratic - // behavior. - return 5; - } - - /// Return an array that contains the ids of the target indices (used for the - /// TargetIndex machine operand) and their names. - /// - /// MIR Serialization is able to serialize only the target indices that are - /// defined by this method. - virtual ArrayRef<std::pair<int, const char *>> - getSerializableTargetIndices() const { - return None; - } - - /// Decompose the machine operand's target flags into two values - the direct - /// target flag value and any of bit flags that are applied. - virtual std::pair<unsigned, unsigned> - decomposeMachineOperandsTargetFlags(unsigned /*TF*/) const { - return std::make_pair(0u, 0u); - } - - /// Return an array that contains the direct target flag values and their - /// names. - /// - /// MIR Serialization is able to serialize only the target flags that are - /// defined by this method. - virtual ArrayRef<std::pair<unsigned, const char *>> - getSerializableDirectMachineOperandTargetFlags() const { - return None; - } - - /// Return an array that contains the bitmask target flag values and their - /// names. - /// - /// MIR Serialization is able to serialize only the target flags that are - /// defined by this method. - virtual ArrayRef<std::pair<unsigned, const char *>> - getSerializableBitmaskMachineOperandTargetFlags() const { - return None; - } - -private: - unsigned CallFrameSetupOpcode, CallFrameDestroyOpcode; - unsigned CatchRetOpcode; -}; - -/// \brief Provide DenseMapInfo for TargetInstrInfo::RegSubRegPair. -template<> -struct DenseMapInfo<TargetInstrInfo::RegSubRegPair> { - typedef DenseMapInfo<unsigned> RegInfo; - - static inline TargetInstrInfo::RegSubRegPair getEmptyKey() { - return TargetInstrInfo::RegSubRegPair(RegInfo::getEmptyKey(), - RegInfo::getEmptyKey()); - } - static inline TargetInstrInfo::RegSubRegPair getTombstoneKey() { - return TargetInstrInfo::RegSubRegPair(RegInfo::getTombstoneKey(), - RegInfo::getTombstoneKey()); - } - /// \brief Reuse getHashValue implementation from - /// std::pair<unsigned, unsigned>. - static unsigned getHashValue(const TargetInstrInfo::RegSubRegPair &Val) { - std::pair<unsigned, unsigned> PairVal = - std::make_pair(Val.Reg, Val.SubReg); - return DenseMapInfo<std::pair<unsigned, unsigned>>::getHashValue(PairVal); - } - static bool isEqual(const TargetInstrInfo::RegSubRegPair &LHS, - const TargetInstrInfo::RegSubRegPair &RHS) { - return RegInfo::isEqual(LHS.Reg, RHS.Reg) && - RegInfo::isEqual(LHS.SubReg, RHS.SubReg); - } -}; - -} // End llvm namespace - -#endif diff --git a/gnu/llvm/include/llvm/Target/TargetLowering.h b/gnu/llvm/include/llvm/Target/TargetLowering.h deleted file mode 100644 index 304da4f8751..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetLowering.h +++ /dev/null @@ -1,2885 +0,0 @@ -//===-- llvm/Target/TargetLowering.h - Target Lowering Info -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// This file describes how to lower LLVM code to machine code. This has two -/// main components: -/// -/// 1. Which ValueTypes are natively supported by the target. -/// 2. Which operations are supported for supported ValueTypes. -/// 3. Cost thresholds for alternative implementations of certain operations. -/// -/// In addition it has a few other components, like information about FP -/// immediates. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETLOWERING_H -#define LLVM_TARGET_TARGETLOWERING_H - -#include "llvm/ADT/DenseMap.h" -#include "llvm/CodeGen/DAGCombine.h" -#include "llvm/CodeGen/RuntimeLibcalls.h" -#include "llvm/CodeGen/SelectionDAGNodes.h" -#include "llvm/IR/Attributes.h" -#include "llvm/IR/CallSite.h" -#include "llvm/IR/CallingConv.h" -#include "llvm/IR/IRBuilder.h" -#include "llvm/IR/InlineAsm.h" -#include "llvm/IR/Instructions.h" -#include "llvm/MC/MCRegisterInfo.h" -#include "llvm/Target/TargetCallingConv.h" -#include "llvm/Target/TargetMachine.h" -#include <climits> -#include <map> -#include <vector> - -namespace llvm { - class CallInst; - class CCState; - class FastISel; - class FunctionLoweringInfo; - class ImmutableCallSite; - class IntrinsicInst; - class MachineBasicBlock; - class MachineFunction; - class MachineInstr; - class MachineJumpTableInfo; - class MachineLoop; - class Mangler; - class MCContext; - class MCExpr; - class MCSymbol; - template<typename T> class SmallVectorImpl; - class DataLayout; - class TargetRegisterClass; - class TargetLibraryInfo; - class TargetLoweringObjectFile; - class Value; - - namespace Sched { - enum Preference { - None, // No preference - Source, // Follow source order. - RegPressure, // Scheduling for lowest register pressure. - Hybrid, // Scheduling for both latency and register pressure. - ILP, // Scheduling for ILP in low register pressure mode. - VLIW // Scheduling for VLIW targets. - }; - } - -/// This base class for TargetLowering contains the SelectionDAG-independent -/// parts that can be used from the rest of CodeGen. -class TargetLoweringBase { - TargetLoweringBase(const TargetLoweringBase&) = delete; - void operator=(const TargetLoweringBase&) = delete; - -public: - /// This enum indicates whether operations are valid for a target, and if not, - /// what action should be used to make them valid. - enum LegalizeAction : uint8_t { - Legal, // The target natively supports this operation. - Promote, // This operation should be executed in a larger type. - Expand, // Try to expand this to other ops, otherwise use a libcall. - LibCall, // Don't try to expand this to other ops, always use a libcall. - Custom // Use the LowerOperation hook to implement custom lowering. - }; - - /// This enum indicates whether a types are legal for a target, and if not, - /// what action should be used to make them valid. - enum LegalizeTypeAction : uint8_t { - TypeLegal, // The target natively supports this type. - TypePromoteInteger, // Replace this integer with a larger one. - TypeExpandInteger, // Split this integer into two of half the size. - TypeSoftenFloat, // Convert this float to a same size integer type, - // if an operation is not supported in target HW. - TypeExpandFloat, // Split this float into two of half the size. - TypeScalarizeVector, // Replace this one-element vector with its element. - TypeSplitVector, // Split this vector into two of half the size. - TypeWidenVector, // This vector should be widened into a larger vector. - TypePromoteFloat // Replace this float with a larger one. - }; - - /// LegalizeKind holds the legalization kind that needs to happen to EVT - /// in order to type-legalize it. - typedef std::pair<LegalizeTypeAction, EVT> LegalizeKind; - - /// Enum that describes how the target represents true/false values. - enum BooleanContent { - UndefinedBooleanContent, // Only bit 0 counts, the rest can hold garbage. - ZeroOrOneBooleanContent, // All bits zero except for bit 0. - ZeroOrNegativeOneBooleanContent // All bits equal to bit 0. - }; - - /// Enum that describes what type of support for selects the target has. - enum SelectSupportKind { - ScalarValSelect, // The target supports scalar selects (ex: cmov). - ScalarCondVectorVal, // The target supports selects with a scalar condition - // and vector values (ex: cmov). - VectorMaskSelect // The target supports vector selects with a vector - // mask (ex: x86 blends). - }; - - /// Enum that specifies what an atomic load/AtomicRMWInst is expanded - /// to, if at all. Exists because different targets have different levels of - /// support for these atomic instructions, and also have different options - /// w.r.t. what they should expand to. - enum class AtomicExpansionKind { - None, // Don't expand the instruction. - LLSC, // Expand the instruction into loadlinked/storeconditional; used - // by ARM/AArch64. - LLOnly, // Expand the (load) instruction into just a load-linked, which has - // greater atomic guarantees than a normal load. - CmpXChg, // Expand the instruction into cmpxchg; used by at least X86. - }; - - static ISD::NodeType getExtendForContent(BooleanContent Content) { - switch (Content) { - case UndefinedBooleanContent: - // Extend by adding rubbish bits. - return ISD::ANY_EXTEND; - case ZeroOrOneBooleanContent: - // Extend by adding zero bits. - return ISD::ZERO_EXTEND; - case ZeroOrNegativeOneBooleanContent: - // Extend by copying the sign bit. - return ISD::SIGN_EXTEND; - } - llvm_unreachable("Invalid content kind"); - } - - /// NOTE: The TargetMachine owns TLOF. - explicit TargetLoweringBase(const TargetMachine &TM); - virtual ~TargetLoweringBase() {} - -protected: - /// \brief Initialize all of the actions to default values. - void initActions(); - -public: - const TargetMachine &getTargetMachine() const { return TM; } - - virtual bool useSoftFloat() const { return false; } - - /// Return the pointer type for the given address space, defaults to - /// the pointer type from the data layout. - /// FIXME: The default needs to be removed once all the code is updated. - MVT getPointerTy(const DataLayout &DL, uint32_t AS = 0) const { - return MVT::getIntegerVT(DL.getPointerSizeInBits(AS)); - } - - /// EVT is not used in-tree, but is used by out-of-tree target. - /// A documentation for this function would be nice... - virtual MVT getScalarShiftAmountTy(const DataLayout &, EVT) const; - - EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL) const; - - /// Returns the type to be used for the index operand of: - /// ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT, - /// ISD::INSERT_SUBVECTOR, and ISD::EXTRACT_SUBVECTOR - virtual MVT getVectorIdxTy(const DataLayout &DL) const { - return getPointerTy(DL); - } - - /// Return true if the select operation is expensive for this target. - bool isSelectExpensive() const { return SelectIsExpensive; } - - virtual bool isSelectSupported(SelectSupportKind /*kind*/) const { - return true; - } - - /// Return true if multiple condition registers are available. - bool hasMultipleConditionRegisters() const { - return HasMultipleConditionRegisters; - } - - /// Return true if the target has BitExtract instructions. - bool hasExtractBitsInsn() const { return HasExtractBitsInsn; } - - /// Return the preferred vector type legalization action. - virtual TargetLoweringBase::LegalizeTypeAction - getPreferredVectorAction(EVT VT) const { - // The default action for one element vectors is to scalarize - if (VT.getVectorNumElements() == 1) - return TypeScalarizeVector; - // The default action for other vectors is to promote - return TypePromoteInteger; - } - - // There are two general methods for expanding a BUILD_VECTOR node: - // 1. Use SCALAR_TO_VECTOR on the defined scalar values and then shuffle - // them together. - // 2. Build the vector on the stack and then load it. - // If this function returns true, then method (1) will be used, subject to - // the constraint that all of the necessary shuffles are legal (as determined - // by isShuffleMaskLegal). If this function returns false, then method (2) is - // always used. The vector type, and the number of defined values, are - // provided. - virtual bool - shouldExpandBuildVectorWithShuffles(EVT /* VT */, - unsigned DefinedValues) const { - return DefinedValues < 3; - } - - /// Return true if integer divide is usually cheaper than a sequence of - /// several shifts, adds, and multiplies for this target. - /// The definition of "cheaper" may depend on whether we're optimizing - /// for speed or for size. - virtual bool isIntDivCheap(EVT VT, AttributeSet Attr) const { - return false; - } - - /// Return true if sqrt(x) is as cheap or cheaper than 1 / rsqrt(x) - bool isFsqrtCheap() const { - return FsqrtIsCheap; - } - - /// Returns true if target has indicated at least one type should be bypassed. - bool isSlowDivBypassed() const { return !BypassSlowDivWidths.empty(); } - - /// Returns map of slow types for division or remainder with corresponding - /// fast types - const DenseMap<unsigned int, unsigned int> &getBypassSlowDivWidths() const { - return BypassSlowDivWidths; - } - - /// Return true if Flow Control is an expensive operation that should be - /// avoided. - bool isJumpExpensive() const { return JumpIsExpensive; } - - /// Return true if selects are only cheaper than branches if the branch is - /// unlikely to be predicted right. - bool isPredictableSelectExpensive() const { - return PredictableSelectIsExpensive; - } - - /// isLoadBitCastBeneficial() - Return true if the following transform - /// is beneficial. - /// fold (conv (load x)) -> (load (conv*)x) - /// On architectures that don't natively support some vector loads - /// efficiently, casting the load to a smaller vector of larger types and - /// loading is more efficient, however, this can be undone by optimizations in - /// dag combiner. - virtual bool isLoadBitCastBeneficial(EVT /* Load */, - EVT /* Bitcast */) const { - return true; - } - - /// Return true if it is expected to be cheaper to do a store of a non-zero - /// vector constant with the given size and type for the address space than to - /// store the individual scalar element constants. - virtual bool storeOfVectorConstantIsCheap(EVT MemVT, - unsigned NumElem, - unsigned AddrSpace) const { - return false; - } - - /// \brief Return true if it is cheap to speculate a call to intrinsic cttz. - virtual bool isCheapToSpeculateCttz() const { - return false; - } - - /// \brief Return true if it is cheap to speculate a call to intrinsic ctlz. - virtual bool isCheapToSpeculateCtlz() const { - return false; - } - - /// \brief Return if the target supports combining a - /// chain like: - /// \code - /// %andResult = and %val1, #imm-with-one-bit-set; - /// %icmpResult = icmp %andResult, 0 - /// br i1 %icmpResult, label %dest1, label %dest2 - /// \endcode - /// into a single machine instruction of a form like: - /// \code - /// brOnBitSet %register, #bitNumber, dest - /// \endcode - bool isMaskAndBranchFoldingLegal() const { - return MaskAndBranchFoldingIsLegal; - } - - /// \brief Return true if the target wants to use the optimization that - /// turns ext(promotableInst1(...(promotableInstN(load)))) into - /// promotedInst1(...(promotedInstN(ext(load)))). - bool enableExtLdPromotion() const { return EnableExtLdPromotion; } - - /// Return true if the target can combine store(extractelement VectorTy, - /// Idx). - /// \p Cost[out] gives the cost of that transformation when this is true. - virtual bool canCombineStoreAndExtract(Type *VectorTy, Value *Idx, - unsigned &Cost) const { - return false; - } - - /// Return true if target supports floating point exceptions. - bool hasFloatingPointExceptions() const { - return HasFloatingPointExceptions; - } - - /// Return true if target always beneficiates from combining into FMA for a - /// given value type. This must typically return false on targets where FMA - /// takes more cycles to execute than FADD. - virtual bool enableAggressiveFMAFusion(EVT VT) const { - return false; - } - - /// Return the ValueType of the result of SETCC operations. - virtual EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, - EVT VT) const; - - /// Return the ValueType for comparison libcalls. Comparions libcalls include - /// floating point comparion calls, and Ordered/Unordered check calls on - /// floating point numbers. - virtual - MVT::SimpleValueType getCmpLibcallReturnType() const; - - /// For targets without i1 registers, this gives the nature of the high-bits - /// of boolean values held in types wider than i1. - /// - /// "Boolean values" are special true/false values produced by nodes like - /// SETCC and consumed (as the condition) by nodes like SELECT and BRCOND. - /// Not to be confused with general values promoted from i1. Some cpus - /// distinguish between vectors of boolean and scalars; the isVec parameter - /// selects between the two kinds. For example on X86 a scalar boolean should - /// be zero extended from i1, while the elements of a vector of booleans - /// should be sign extended from i1. - /// - /// Some cpus also treat floating point types the same way as they treat - /// vectors instead of the way they treat scalars. - BooleanContent getBooleanContents(bool isVec, bool isFloat) const { - if (isVec) - return BooleanVectorContents; - return isFloat ? BooleanFloatContents : BooleanContents; - } - - BooleanContent getBooleanContents(EVT Type) const { - return getBooleanContents(Type.isVector(), Type.isFloatingPoint()); - } - - /// Return target scheduling preference. - Sched::Preference getSchedulingPreference() const { - return SchedPreferenceInfo; - } - - /// Some scheduler, e.g. hybrid, can switch to different scheduling heuristics - /// for different nodes. This function returns the preference (or none) for - /// the given node. - virtual Sched::Preference getSchedulingPreference(SDNode *) const { - return Sched::None; - } - - /// Return the register class that should be used for the specified value - /// type. - virtual const TargetRegisterClass *getRegClassFor(MVT VT) const { - const TargetRegisterClass *RC = RegClassForVT[VT.SimpleTy]; - assert(RC && "This value type is not natively supported!"); - return RC; - } - - /// Return the 'representative' register class for the specified value - /// type. - /// - /// The 'representative' register class is the largest legal super-reg - /// register class for the register class of the value type. For example, on - /// i386 the rep register class for i8, i16, and i32 are GR32; while the rep - /// register class is GR64 on x86_64. - virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const { - const TargetRegisterClass *RC = RepRegClassForVT[VT.SimpleTy]; - return RC; - } - - /// Return the cost of the 'representative' register class for the specified - /// value type. - virtual uint8_t getRepRegClassCostFor(MVT VT) const { - return RepRegClassCostForVT[VT.SimpleTy]; - } - - /// Return true if the target has native support for the specified value type. - /// This means that it has a register that directly holds it without - /// promotions or expansions. - bool isTypeLegal(EVT VT) const { - assert(!VT.isSimple() || - (unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(RegClassForVT)); - return VT.isSimple() && RegClassForVT[VT.getSimpleVT().SimpleTy] != nullptr; - } - - class ValueTypeActionImpl { - /// ValueTypeActions - For each value type, keep a LegalizeTypeAction enum - /// that indicates how instruction selection should deal with the type. - LegalizeTypeAction ValueTypeActions[MVT::LAST_VALUETYPE]; - - public: - ValueTypeActionImpl() { - std::fill(std::begin(ValueTypeActions), std::end(ValueTypeActions), - TypeLegal); - } - - LegalizeTypeAction getTypeAction(MVT VT) const { - return ValueTypeActions[VT.SimpleTy]; - } - - void setTypeAction(MVT VT, LegalizeTypeAction Action) { - ValueTypeActions[VT.SimpleTy] = Action; - } - }; - - const ValueTypeActionImpl &getValueTypeActions() const { - return ValueTypeActions; - } - - /// Return how we should legalize values of this type, either it is already - /// legal (return 'Legal') or we need to promote it to a larger type (return - /// 'Promote'), or we need to expand it into multiple registers of smaller - /// integer type (return 'Expand'). 'Custom' is not an option. - LegalizeTypeAction getTypeAction(LLVMContext &Context, EVT VT) const { - return getTypeConversion(Context, VT).first; - } - LegalizeTypeAction getTypeAction(MVT VT) const { - return ValueTypeActions.getTypeAction(VT); - } - - /// For types supported by the target, this is an identity function. For - /// types that must be promoted to larger types, this returns the larger type - /// to promote to. For integer types that are larger than the largest integer - /// register, this contains one step in the expansion to get to the smaller - /// register. For illegal floating point types, this returns the integer type - /// to transform to. - EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const { - return getTypeConversion(Context, VT).second; - } - - /// For types supported by the target, this is an identity function. For - /// types that must be expanded (i.e. integer types that are larger than the - /// largest integer register or illegal floating point types), this returns - /// the largest legal type it will be expanded to. - EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const { - assert(!VT.isVector()); - while (true) { - switch (getTypeAction(Context, VT)) { - case TypeLegal: - return VT; - case TypeExpandInteger: - VT = getTypeToTransformTo(Context, VT); - break; - default: - llvm_unreachable("Type is not legal nor is it to be expanded!"); - } - } - } - - /// Vector types are broken down into some number of legal first class types. - /// For example, EVT::v8f32 maps to 2 EVT::v4f32 with Altivec or SSE1, or 8 - /// promoted EVT::f64 values with the X86 FP stack. Similarly, EVT::v2i64 - /// turns into 4 EVT::i32 values with both PPC and X86. - /// - /// This method returns the number of registers needed, and the VT for each - /// register. It also returns the VT and quantity of the intermediate values - /// before they are promoted/expanded. - unsigned getVectorTypeBreakdown(LLVMContext &Context, EVT VT, - EVT &IntermediateVT, - unsigned &NumIntermediates, - MVT &RegisterVT) const; - - struct IntrinsicInfo { - unsigned opc; // target opcode - EVT memVT; // memory VT - const Value* ptrVal; // value representing memory location - int offset; // offset off of ptrVal - unsigned size; // the size of the memory location - // (taken from memVT if zero) - unsigned align; // alignment - bool vol; // is volatile? - bool readMem; // reads memory? - bool writeMem; // writes memory? - - IntrinsicInfo() : opc(0), ptrVal(nullptr), offset(0), size(0), align(1), - vol(false), readMem(false), writeMem(false) {} - }; - - /// Given an intrinsic, checks if on the target the intrinsic will need to map - /// to a MemIntrinsicNode (touches memory). If this is the case, it returns - /// true and store the intrinsic information into the IntrinsicInfo that was - /// passed to the function. - virtual bool getTgtMemIntrinsic(IntrinsicInfo &, const CallInst &, - unsigned /*Intrinsic*/) const { - return false; - } - - /// Returns true if the target can instruction select the specified FP - /// immediate natively. If false, the legalizer will materialize the FP - /// immediate as a load from a constant pool. - virtual bool isFPImmLegal(const APFloat &/*Imm*/, EVT /*VT*/) const { - return false; - } - - /// Targets can use this to indicate that they only support *some* - /// VECTOR_SHUFFLE operations, those with specific masks. By default, if a - /// target supports the VECTOR_SHUFFLE node, all mask values are assumed to be - /// legal. - virtual bool isShuffleMaskLegal(const SmallVectorImpl<int> &/*Mask*/, - EVT /*VT*/) const { - return true; - } - - /// Returns true if the operation can trap for the value type. - /// - /// VT must be a legal type. By default, we optimistically assume most - /// operations don't trap except for divide and remainder. - virtual bool canOpTrap(unsigned Op, EVT VT) const; - - /// Similar to isShuffleMaskLegal. This is used by Targets can use this to - /// indicate if there is a suitable VECTOR_SHUFFLE that can be used to replace - /// a VAND with a constant pool entry. - virtual bool isVectorClearMaskLegal(const SmallVectorImpl<int> &/*Mask*/, - EVT /*VT*/) const { - return false; - } - - /// Return how this operation should be treated: either it is legal, needs to - /// be promoted to a larger size, needs to be expanded to some other code - /// sequence, or the target has a custom expander for it. - LegalizeAction getOperationAction(unsigned Op, EVT VT) const { - if (VT.isExtended()) return Expand; - // If a target-specific SDNode requires legalization, require the target - // to provide custom legalization for it. - if (Op > array_lengthof(OpActions[0])) return Custom; - return OpActions[(unsigned)VT.getSimpleVT().SimpleTy][Op]; - } - - /// Return true if the specified operation is legal on this target or can be - /// made legal with custom lowering. This is used to help guide high-level - /// lowering decisions. - bool isOperationLegalOrCustom(unsigned Op, EVT VT) const { - return (VT == MVT::Other || isTypeLegal(VT)) && - (getOperationAction(Op, VT) == Legal || - getOperationAction(Op, VT) == Custom); - } - - /// Return true if the specified operation is legal on this target or can be - /// made legal using promotion. This is used to help guide high-level lowering - /// decisions. - bool isOperationLegalOrPromote(unsigned Op, EVT VT) const { - return (VT == MVT::Other || isTypeLegal(VT)) && - (getOperationAction(Op, VT) == Legal || - getOperationAction(Op, VT) == Promote); - } - - /// Return true if the specified operation is illegal on this target or - /// unlikely to be made legal with custom lowering. This is used to help guide - /// high-level lowering decisions. - bool isOperationExpand(unsigned Op, EVT VT) const { - return (!isTypeLegal(VT) || getOperationAction(Op, VT) == Expand); - } - - /// Return true if the specified operation is legal on this target. - bool isOperationLegal(unsigned Op, EVT VT) const { - return (VT == MVT::Other || isTypeLegal(VT)) && - getOperationAction(Op, VT) == Legal; - } - - /// Return how this load with extension should be treated: either it is legal, - /// needs to be promoted to a larger size, needs to be expanded to some other - /// code sequence, or the target has a custom expander for it. - LegalizeAction getLoadExtAction(unsigned ExtType, EVT ValVT, - EVT MemVT) const { - if (ValVT.isExtended() || MemVT.isExtended()) return Expand; - unsigned ValI = (unsigned) ValVT.getSimpleVT().SimpleTy; - unsigned MemI = (unsigned) MemVT.getSimpleVT().SimpleTy; - assert(ExtType < ISD::LAST_LOADEXT_TYPE && ValI < MVT::LAST_VALUETYPE && - MemI < MVT::LAST_VALUETYPE && "Table isn't big enough!"); - return LoadExtActions[ValI][MemI][ExtType]; - } - - /// Return true if the specified load with extension is legal on this target. - bool isLoadExtLegal(unsigned ExtType, EVT ValVT, EVT MemVT) const { - return ValVT.isSimple() && MemVT.isSimple() && - getLoadExtAction(ExtType, ValVT, MemVT) == Legal; - } - - /// Return true if the specified load with extension is legal or custom - /// on this target. - bool isLoadExtLegalOrCustom(unsigned ExtType, EVT ValVT, EVT MemVT) const { - return ValVT.isSimple() && MemVT.isSimple() && - (getLoadExtAction(ExtType, ValVT, MemVT) == Legal || - getLoadExtAction(ExtType, ValVT, MemVT) == Custom); - } - - /// Return how this store with truncation should be treated: either it is - /// legal, needs to be promoted to a larger size, needs to be expanded to some - /// other code sequence, or the target has a custom expander for it. - LegalizeAction getTruncStoreAction(EVT ValVT, EVT MemVT) const { - if (ValVT.isExtended() || MemVT.isExtended()) return Expand; - unsigned ValI = (unsigned) ValVT.getSimpleVT().SimpleTy; - unsigned MemI = (unsigned) MemVT.getSimpleVT().SimpleTy; - assert(ValI < MVT::LAST_VALUETYPE && MemI < MVT::LAST_VALUETYPE && - "Table isn't big enough!"); - return TruncStoreActions[ValI][MemI]; - } - - /// Return true if the specified store with truncation is legal on this - /// target. - bool isTruncStoreLegal(EVT ValVT, EVT MemVT) const { - return isTypeLegal(ValVT) && MemVT.isSimple() && - getTruncStoreAction(ValVT.getSimpleVT(), MemVT.getSimpleVT()) == Legal; - } - - /// Return how the indexed load should be treated: either it is legal, needs - /// to be promoted to a larger size, needs to be expanded to some other code - /// sequence, or the target has a custom expander for it. - LegalizeAction - getIndexedLoadAction(unsigned IdxMode, MVT VT) const { - assert(IdxMode < ISD::LAST_INDEXED_MODE && VT.isValid() && - "Table isn't big enough!"); - unsigned Ty = (unsigned)VT.SimpleTy; - return (LegalizeAction)((IndexedModeActions[Ty][IdxMode] & 0xf0) >> 4); - } - - /// Return true if the specified indexed load is legal on this target. - bool isIndexedLoadLegal(unsigned IdxMode, EVT VT) const { - return VT.isSimple() && - (getIndexedLoadAction(IdxMode, VT.getSimpleVT()) == Legal || - getIndexedLoadAction(IdxMode, VT.getSimpleVT()) == Custom); - } - - /// Return how the indexed store should be treated: either it is legal, needs - /// to be promoted to a larger size, needs to be expanded to some other code - /// sequence, or the target has a custom expander for it. - LegalizeAction - getIndexedStoreAction(unsigned IdxMode, MVT VT) const { - assert(IdxMode < ISD::LAST_INDEXED_MODE && VT.isValid() && - "Table isn't big enough!"); - unsigned Ty = (unsigned)VT.SimpleTy; - return (LegalizeAction)(IndexedModeActions[Ty][IdxMode] & 0x0f); - } - - /// Return true if the specified indexed load is legal on this target. - bool isIndexedStoreLegal(unsigned IdxMode, EVT VT) const { - return VT.isSimple() && - (getIndexedStoreAction(IdxMode, VT.getSimpleVT()) == Legal || - getIndexedStoreAction(IdxMode, VT.getSimpleVT()) == Custom); - } - - /// Return how the condition code should be treated: either it is legal, needs - /// to be expanded to some other code sequence, or the target has a custom - /// expander for it. - LegalizeAction - getCondCodeAction(ISD::CondCode CC, MVT VT) const { - assert((unsigned)CC < array_lengthof(CondCodeActions) && - ((unsigned)VT.SimpleTy >> 4) < array_lengthof(CondCodeActions[0]) && - "Table isn't big enough!"); - // See setCondCodeAction for how this is encoded. - uint32_t Shift = 4 * (VT.SimpleTy & 0x7); - uint32_t Value = CondCodeActions[CC][VT.SimpleTy >> 3]; - LegalizeAction Action = (LegalizeAction) ((Value >> Shift) & 0xF); - assert(Action != Promote && "Can't promote condition code!"); - return Action; - } - - /// Return true if the specified condition code is legal on this target. - bool isCondCodeLegal(ISD::CondCode CC, MVT VT) const { - return - getCondCodeAction(CC, VT) == Legal || - getCondCodeAction(CC, VT) == Custom; - } - - - /// If the action for this operation is to promote, this method returns the - /// ValueType to promote to. - MVT getTypeToPromoteTo(unsigned Op, MVT VT) const { - assert(getOperationAction(Op, VT) == Promote && - "This operation isn't promoted!"); - - // See if this has an explicit type specified. - std::map<std::pair<unsigned, MVT::SimpleValueType>, - MVT::SimpleValueType>::const_iterator PTTI = - PromoteToType.find(std::make_pair(Op, VT.SimpleTy)); - if (PTTI != PromoteToType.end()) return PTTI->second; - - assert((VT.isInteger() || VT.isFloatingPoint()) && - "Cannot autopromote this type, add it with AddPromotedToType."); - - MVT NVT = VT; - do { - NVT = (MVT::SimpleValueType)(NVT.SimpleTy+1); - assert(NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid && - "Didn't find type to promote to!"); - } while (!isTypeLegal(NVT) || - getOperationAction(Op, NVT) == Promote); - return NVT; - } - - /// Return the EVT corresponding to this LLVM type. This is fixed by the LLVM - /// operations except for the pointer size. If AllowUnknown is true, this - /// will return MVT::Other for types with no EVT counterpart (e.g. structs), - /// otherwise it will assert. - EVT getValueType(const DataLayout &DL, Type *Ty, - bool AllowUnknown = false) const { - // Lower scalar pointers to native pointer types. - if (PointerType *PTy = dyn_cast<PointerType>(Ty)) - return getPointerTy(DL, PTy->getAddressSpace()); - - if (Ty->isVectorTy()) { - VectorType *VTy = cast<VectorType>(Ty); - Type *Elm = VTy->getElementType(); - // Lower vectors of pointers to native pointer types. - if (PointerType *PT = dyn_cast<PointerType>(Elm)) { - EVT PointerTy(getPointerTy(DL, PT->getAddressSpace())); - Elm = PointerTy.getTypeForEVT(Ty->getContext()); - } - - return EVT::getVectorVT(Ty->getContext(), EVT::getEVT(Elm, false), - VTy->getNumElements()); - } - return EVT::getEVT(Ty, AllowUnknown); - } - - /// Return the MVT corresponding to this LLVM type. See getValueType. - MVT getSimpleValueType(const DataLayout &DL, Type *Ty, - bool AllowUnknown = false) const { - return getValueType(DL, Ty, AllowUnknown).getSimpleVT(); - } - - /// Return the desired alignment for ByVal or InAlloca aggregate function - /// arguments in the caller parameter area. This is the actual alignment, not - /// its logarithm. - virtual unsigned getByValTypeAlignment(Type *Ty, const DataLayout &DL) const; - - /// Return the type of registers that this ValueType will eventually require. - MVT getRegisterType(MVT VT) const { - assert((unsigned)VT.SimpleTy < array_lengthof(RegisterTypeForVT)); - return RegisterTypeForVT[VT.SimpleTy]; - } - - /// Return the type of registers that this ValueType will eventually require. - MVT getRegisterType(LLVMContext &Context, EVT VT) const { - if (VT.isSimple()) { - assert((unsigned)VT.getSimpleVT().SimpleTy < - array_lengthof(RegisterTypeForVT)); - return RegisterTypeForVT[VT.getSimpleVT().SimpleTy]; - } - if (VT.isVector()) { - EVT VT1; - MVT RegisterVT; - unsigned NumIntermediates; - (void)getVectorTypeBreakdown(Context, VT, VT1, - NumIntermediates, RegisterVT); - return RegisterVT; - } - if (VT.isInteger()) { - return getRegisterType(Context, getTypeToTransformTo(Context, VT)); - } - llvm_unreachable("Unsupported extended type!"); - } - - /// Return the number of registers that this ValueType will eventually - /// require. - /// - /// This is one for any types promoted to live in larger registers, but may be - /// more than one for types (like i64) that are split into pieces. For types - /// like i140, which are first promoted then expanded, it is the number of - /// registers needed to hold all the bits of the original type. For an i140 - /// on a 32 bit machine this means 5 registers. - unsigned getNumRegisters(LLVMContext &Context, EVT VT) const { - if (VT.isSimple()) { - assert((unsigned)VT.getSimpleVT().SimpleTy < - array_lengthof(NumRegistersForVT)); - return NumRegistersForVT[VT.getSimpleVT().SimpleTy]; - } - if (VT.isVector()) { - EVT VT1; - MVT VT2; - unsigned NumIntermediates; - return getVectorTypeBreakdown(Context, VT, VT1, NumIntermediates, VT2); - } - if (VT.isInteger()) { - unsigned BitWidth = VT.getSizeInBits(); - unsigned RegWidth = getRegisterType(Context, VT).getSizeInBits(); - return (BitWidth + RegWidth - 1) / RegWidth; - } - llvm_unreachable("Unsupported extended type!"); - } - - /// If true, then instruction selection should seek to shrink the FP constant - /// of the specified type to a smaller type in order to save space and / or - /// reduce runtime. - virtual bool ShouldShrinkFPConstant(EVT) const { return true; } - - // Return true if it is profitable to reduce the given load node to a smaller - // type. - // - // e.g. (i16 (trunc (i32 (load x))) -> i16 load x should be performed - virtual bool shouldReduceLoadWidth(SDNode *Load, - ISD::LoadExtType ExtTy, - EVT NewVT) const { - return true; - } - - /// When splitting a value of the specified type into parts, does the Lo - /// or Hi part come first? This usually follows the endianness, except - /// for ppcf128, where the Hi part always comes first. - bool hasBigEndianPartOrdering(EVT VT, const DataLayout &DL) const { - return DL.isBigEndian() || VT == MVT::ppcf128; - } - - /// If true, the target has custom DAG combine transformations that it can - /// perform for the specified node. - bool hasTargetDAGCombine(ISD::NodeType NT) const { - assert(unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray)); - return TargetDAGCombineArray[NT >> 3] & (1 << (NT&7)); - } - - unsigned getGatherAllAliasesMaxDepth() const { - return GatherAllAliasesMaxDepth; - } - - /// \brief Get maximum # of store operations permitted for llvm.memset - /// - /// This function returns the maximum number of store operations permitted - /// to replace a call to llvm.memset. The value is set by the target at the - /// performance threshold for such a replacement. If OptSize is true, - /// return the limit for functions that have OptSize attribute. - unsigned getMaxStoresPerMemset(bool OptSize) const { - return OptSize ? MaxStoresPerMemsetOptSize : MaxStoresPerMemset; - } - - /// \brief Get maximum # of store operations permitted for llvm.memcpy - /// - /// This function returns the maximum number of store operations permitted - /// to replace a call to llvm.memcpy. The value is set by the target at the - /// performance threshold for such a replacement. If OptSize is true, - /// return the limit for functions that have OptSize attribute. - unsigned getMaxStoresPerMemcpy(bool OptSize) const { - return OptSize ? MaxStoresPerMemcpyOptSize : MaxStoresPerMemcpy; - } - - /// \brief Get maximum # of store operations permitted for llvm.memmove - /// - /// This function returns the maximum number of store operations permitted - /// to replace a call to llvm.memmove. The value is set by the target at the - /// performance threshold for such a replacement. If OptSize is true, - /// return the limit for functions that have OptSize attribute. - unsigned getMaxStoresPerMemmove(bool OptSize) const { - return OptSize ? MaxStoresPerMemmoveOptSize : MaxStoresPerMemmove; - } - - /// \brief Determine if the target supports unaligned memory accesses. - /// - /// This function returns true if the target allows unaligned memory accesses - /// of the specified type in the given address space. If true, it also returns - /// whether the unaligned memory access is "fast" in the last argument by - /// reference. This is used, for example, in situations where an array - /// copy/move/set is converted to a sequence of store operations. Its use - /// helps to ensure that such replacements don't generate code that causes an - /// alignment error (trap) on the target machine. - virtual bool allowsMisalignedMemoryAccesses(EVT, - unsigned AddrSpace = 0, - unsigned Align = 1, - bool * /*Fast*/ = nullptr) const { - return false; - } - - /// Return true if the target supports a memory access of this type for the - /// given address space and alignment. If the access is allowed, the optional - /// final parameter returns if the access is also fast (as defined by the - /// target). - bool allowsMemoryAccess(LLVMContext &Context, const DataLayout &DL, EVT VT, - unsigned AddrSpace = 0, unsigned Alignment = 1, - bool *Fast = nullptr) const; - - /// Returns the target specific optimal type for load and store operations as - /// a result of memset, memcpy, and memmove lowering. - /// - /// If DstAlign is zero that means it's safe to destination alignment can - /// satisfy any constraint. Similarly if SrcAlign is zero it means there isn't - /// a need to check it against alignment requirement, probably because the - /// source does not need to be loaded. If 'IsMemset' is true, that means it's - /// expanding a memset. If 'ZeroMemset' is true, that means it's a memset of - /// zero. 'MemcpyStrSrc' indicates whether the memcpy source is constant so it - /// does not need to be loaded. It returns EVT::Other if the type should be - /// determined using generic target-independent logic. - virtual EVT getOptimalMemOpType(uint64_t /*Size*/, - unsigned /*DstAlign*/, unsigned /*SrcAlign*/, - bool /*IsMemset*/, - bool /*ZeroMemset*/, - bool /*MemcpyStrSrc*/, - MachineFunction &/*MF*/) const { - return MVT::Other; - } - - /// Returns true if it's safe to use load / store of the specified type to - /// expand memcpy / memset inline. - /// - /// This is mostly true for all types except for some special cases. For - /// example, on X86 targets without SSE2 f64 load / store are done with fldl / - /// fstpl which also does type conversion. Note the specified type doesn't - /// have to be legal as the hook is used before type legalization. - virtual bool isSafeMemOpType(MVT /*VT*/) const { return true; } - - /// Determine if we should use _setjmp or setjmp to implement llvm.setjmp. - bool usesUnderscoreSetJmp() const { - return UseUnderscoreSetJmp; - } - - /// Determine if we should use _longjmp or longjmp to implement llvm.longjmp. - bool usesUnderscoreLongJmp() const { - return UseUnderscoreLongJmp; - } - - /// Return integer threshold on number of blocks to use jump tables rather - /// than if sequence. - int getMinimumJumpTableEntries() const { - return MinimumJumpTableEntries; - } - - /// If a physical register, this specifies the register that - /// llvm.savestack/llvm.restorestack should save and restore. - unsigned getStackPointerRegisterToSaveRestore() const { - return StackPointerRegisterToSaveRestore; - } - - /// If a physical register, this returns the register that receives the - /// exception address on entry to an EH pad. - virtual unsigned - getExceptionPointerRegister(const Constant *PersonalityFn) const { - // 0 is guaranteed to be the NoRegister value on all targets - return 0; - } - - /// If a physical register, this returns the register that receives the - /// exception typeid on entry to a landing pad. - virtual unsigned - getExceptionSelectorRegister(const Constant *PersonalityFn) const { - // 0 is guaranteed to be the NoRegister value on all targets - return 0; - } - - /// Returns the target's jmp_buf size in bytes (if never set, the default is - /// 200) - unsigned getJumpBufSize() const { - return JumpBufSize; - } - - /// Returns the target's jmp_buf alignment in bytes (if never set, the default - /// is 0) - unsigned getJumpBufAlignment() const { - return JumpBufAlignment; - } - - /// Return the minimum stack alignment of an argument. - unsigned getMinStackArgumentAlignment() const { - return MinStackArgumentAlignment; - } - - /// Return the minimum function alignment. - unsigned getMinFunctionAlignment() const { - return MinFunctionAlignment; - } - - /// Return the preferred function alignment. - unsigned getPrefFunctionAlignment() const { - return PrefFunctionAlignment; - } - - /// Return the preferred loop alignment. - virtual unsigned getPrefLoopAlignment(MachineLoop *ML = nullptr) const { - return PrefLoopAlignment; - } - - /// Return whether the DAG builder should automatically insert fences and - /// reduce ordering for atomics. - bool getInsertFencesForAtomic() const { - return InsertFencesForAtomic; - } - - /// Return true if the target stores stack protector cookies at a fixed offset - /// in some non-standard address space, and populates the address space and - /// offset as appropriate. - virtual bool getStackCookieLocation(unsigned &/*AddressSpace*/, - unsigned &/*Offset*/) const { - return false; - } - - /// If the target has a standard location for the unsafe stack pointer, - /// returns the address of that location. Otherwise, returns nullptr. - virtual Value *getSafeStackPointerLocation(IRBuilder<> &IRB) const; - - /// Returns true if a cast between SrcAS and DestAS is a noop. - virtual bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const { - return false; - } - - /// Return true if the pointer arguments to CI should be aligned by aligning - /// the object whose address is being passed. If so then MinSize is set to the - /// minimum size the object must be to be aligned and PrefAlign is set to the - /// preferred alignment. - virtual bool shouldAlignPointerArgs(CallInst * /*CI*/, unsigned & /*MinSize*/, - unsigned & /*PrefAlign*/) const { - return false; - } - - //===--------------------------------------------------------------------===// - /// \name Helpers for TargetTransformInfo implementations - /// @{ - - /// Get the ISD node that corresponds to the Instruction class opcode. - int InstructionOpcodeToISD(unsigned Opcode) const; - - /// Estimate the cost of type-legalization and the legalized type. - std::pair<int, MVT> getTypeLegalizationCost(const DataLayout &DL, - Type *Ty) const; - - /// @} - - //===--------------------------------------------------------------------===// - /// \name Helpers for atomic expansion. - /// @{ - - /// Perform a load-linked operation on Addr, returning a "Value *" with the - /// corresponding pointee type. This may entail some non-trivial operations to - /// truncate or reconstruct types that will be illegal in the backend. See - /// ARMISelLowering for an example implementation. - virtual Value *emitLoadLinked(IRBuilder<> &Builder, Value *Addr, - AtomicOrdering Ord) const { - llvm_unreachable("Load linked unimplemented on this target"); - } - - /// Perform a store-conditional operation to Addr. Return the status of the - /// store. This should be 0 if the store succeeded, non-zero otherwise. - virtual Value *emitStoreConditional(IRBuilder<> &Builder, Value *Val, - Value *Addr, AtomicOrdering Ord) const { - llvm_unreachable("Store conditional unimplemented on this target"); - } - - /// Inserts in the IR a target-specific intrinsic specifying a fence. - /// It is called by AtomicExpandPass before expanding an - /// AtomicRMW/AtomicCmpXchg/AtomicStore/AtomicLoad. - /// RMW and CmpXchg set both IsStore and IsLoad to true. - /// This function should either return a nullptr, or a pointer to an IR-level - /// Instruction*. Even complex fence sequences can be represented by a - /// single Instruction* through an intrinsic to be lowered later. - /// Backends with !getInsertFencesForAtomic() should keep a no-op here. - /// Backends should override this method to produce target-specific intrinsic - /// for their fences. - /// FIXME: Please note that the default implementation here in terms of - /// IR-level fences exists for historical/compatibility reasons and is - /// *unsound* ! Fences cannot, in general, be used to restore sequential - /// consistency. For example, consider the following example: - /// atomic<int> x = y = 0; - /// int r1, r2, r3, r4; - /// Thread 0: - /// x.store(1); - /// Thread 1: - /// y.store(1); - /// Thread 2: - /// r1 = x.load(); - /// r2 = y.load(); - /// Thread 3: - /// r3 = y.load(); - /// r4 = x.load(); - /// r1 = r3 = 1 and r2 = r4 = 0 is impossible as long as the accesses are all - /// seq_cst. But if they are lowered to monotonic accesses, no amount of - /// IR-level fences can prevent it. - /// @{ - virtual Instruction *emitLeadingFence(IRBuilder<> &Builder, - AtomicOrdering Ord, bool IsStore, - bool IsLoad) const { - if (!getInsertFencesForAtomic()) - return nullptr; - - if (isAtLeastRelease(Ord) && IsStore) - return Builder.CreateFence(Ord); - else - return nullptr; - } - - virtual Instruction *emitTrailingFence(IRBuilder<> &Builder, - AtomicOrdering Ord, bool IsStore, - bool IsLoad) const { - if (!getInsertFencesForAtomic()) - return nullptr; - - if (isAtLeastAcquire(Ord)) - return Builder.CreateFence(Ord); - else - return nullptr; - } - /// @} - - // Emits code that executes when the comparison result in the ll/sc - // expansion of a cmpxchg instruction is such that the store-conditional will - // not execute. This makes it possible to balance out the load-linked with - // a dedicated instruction, if desired. - // E.g., on ARM, if ldrex isn't followed by strex, the exclusive monitor would - // be unnecessarily held, except if clrex, inserted by this hook, is executed. - virtual void emitAtomicCmpXchgNoStoreLLBalance(IRBuilder<> &Builder) const {} - - /// Returns true if the given (atomic) store should be expanded by the - /// IR-level AtomicExpand pass into an "atomic xchg" which ignores its input. - virtual bool shouldExpandAtomicStoreInIR(StoreInst *SI) const { - return false; - } - - /// Returns true if arguments should be sign-extended in lib calls. - virtual bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const { - return IsSigned; - } - - /// Returns how the given (atomic) load should be expanded by the - /// IR-level AtomicExpand pass. - virtual AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const { - return AtomicExpansionKind::None; - } - - /// Returns true if the given atomic cmpxchg should be expanded by the - /// IR-level AtomicExpand pass into a load-linked/store-conditional sequence - /// (through emitLoadLinked() and emitStoreConditional()). - virtual bool shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const { - return false; - } - - /// Returns how the IR-level AtomicExpand pass should expand the given - /// AtomicRMW, if at all. Default is to never expand. - virtual AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *) const { - return AtomicExpansionKind::None; - } - - /// On some platforms, an AtomicRMW that never actually modifies the value - /// (such as fetch_add of 0) can be turned into a fence followed by an - /// atomic load. This may sound useless, but it makes it possible for the - /// processor to keep the cacheline shared, dramatically improving - /// performance. And such idempotent RMWs are useful for implementing some - /// kinds of locks, see for example (justification + benchmarks): - /// http://www.hpl.hp.com/techreports/2012/HPL-2012-68.pdf - /// This method tries doing that transformation, returning the atomic load if - /// it succeeds, and nullptr otherwise. - /// If shouldExpandAtomicLoadInIR returns true on that load, it will undergo - /// another round of expansion. - virtual LoadInst * - lowerIdempotentRMWIntoFencedLoad(AtomicRMWInst *RMWI) const { - return nullptr; - } - - /// Returns true if we should normalize - /// select(N0&N1, X, Y) => select(N0, select(N1, X, Y), Y) and - /// select(N0|N1, X, Y) => select(N0, select(N1, X, Y, Y)) if it is likely - /// that it saves us from materializing N0 and N1 in an integer register. - /// Targets that are able to perform and/or on flags should return false here. - virtual bool shouldNormalizeToSelectSequence(LLVMContext &Context, - EVT VT) const { - // If a target has multiple condition registers, then it likely has logical - // operations on those registers. - if (hasMultipleConditionRegisters()) - return false; - // Only do the transform if the value won't be split into multiple - // registers. - LegalizeTypeAction Action = getTypeAction(Context, VT); - return Action != TypeExpandInteger && Action != TypeExpandFloat && - Action != TypeSplitVector; - } - - //===--------------------------------------------------------------------===// - // TargetLowering Configuration Methods - These methods should be invoked by - // the derived class constructor to configure this object for the target. - // -protected: - /// Specify how the target extends the result of integer and floating point - /// boolean values from i1 to a wider type. See getBooleanContents. - void setBooleanContents(BooleanContent Ty) { - BooleanContents = Ty; - BooleanFloatContents = Ty; - } - - /// Specify how the target extends the result of integer and floating point - /// boolean values from i1 to a wider type. See getBooleanContents. - void setBooleanContents(BooleanContent IntTy, BooleanContent FloatTy) { - BooleanContents = IntTy; - BooleanFloatContents = FloatTy; - } - - /// Specify how the target extends the result of a vector boolean value from a - /// vector of i1 to a wider type. See getBooleanContents. - void setBooleanVectorContents(BooleanContent Ty) { - BooleanVectorContents = Ty; - } - - /// Specify the target scheduling preference. - void setSchedulingPreference(Sched::Preference Pref) { - SchedPreferenceInfo = Pref; - } - - /// Indicate whether this target prefers to use _setjmp to implement - /// llvm.setjmp or the version without _. Defaults to false. - void setUseUnderscoreSetJmp(bool Val) { - UseUnderscoreSetJmp = Val; - } - - /// Indicate whether this target prefers to use _longjmp to implement - /// llvm.longjmp or the version without _. Defaults to false. - void setUseUnderscoreLongJmp(bool Val) { - UseUnderscoreLongJmp = Val; - } - - /// Indicate the number of blocks to generate jump tables rather than if - /// sequence. - void setMinimumJumpTableEntries(int Val) { - MinimumJumpTableEntries = Val; - } - - /// If set to a physical register, this specifies the register that - /// llvm.savestack/llvm.restorestack should save and restore. - void setStackPointerRegisterToSaveRestore(unsigned R) { - StackPointerRegisterToSaveRestore = R; - } - - /// Tells the code generator not to expand operations into sequences that use - /// the select operations if possible. - void setSelectIsExpensive(bool isExpensive = true) { - SelectIsExpensive = isExpensive; - } - - /// Tells the code generator that the target has multiple (allocatable) - /// condition registers that can be used to store the results of comparisons - /// for use by selects and conditional branches. With multiple condition - /// registers, the code generator will not aggressively sink comparisons into - /// the blocks of their users. - void setHasMultipleConditionRegisters(bool hasManyRegs = true) { - HasMultipleConditionRegisters = hasManyRegs; - } - - /// Tells the code generator that the target has BitExtract instructions. - /// The code generator will aggressively sink "shift"s into the blocks of - /// their users if the users will generate "and" instructions which can be - /// combined with "shift" to BitExtract instructions. - void setHasExtractBitsInsn(bool hasExtractInsn = true) { - HasExtractBitsInsn = hasExtractInsn; - } - - /// Tells the code generator not to expand logic operations on comparison - /// predicates into separate sequences that increase the amount of flow - /// control. - void setJumpIsExpensive(bool isExpensive = true); - - /// Tells the code generator that fsqrt is cheap, and should not be replaced - /// with an alternative sequence of instructions. - void setFsqrtIsCheap(bool isCheap = true) { FsqrtIsCheap = isCheap; } - - /// Tells the code generator that this target supports floating point - /// exceptions and cares about preserving floating point exception behavior. - void setHasFloatingPointExceptions(bool FPExceptions = true) { - HasFloatingPointExceptions = FPExceptions; - } - - /// Tells the code generator which bitwidths to bypass. - void addBypassSlowDiv(unsigned int SlowBitWidth, unsigned int FastBitWidth) { - BypassSlowDivWidths[SlowBitWidth] = FastBitWidth; - } - - /// Add the specified register class as an available regclass for the - /// specified value type. This indicates the selector can handle values of - /// that class natively. - void addRegisterClass(MVT VT, const TargetRegisterClass *RC) { - assert((unsigned)VT.SimpleTy < array_lengthof(RegClassForVT)); - AvailableRegClasses.push_back(std::make_pair(VT, RC)); - RegClassForVT[VT.SimpleTy] = RC; - } - - /// Remove all register classes. - void clearRegisterClasses() { - std::fill(std::begin(RegClassForVT), std::end(RegClassForVT), nullptr); - - AvailableRegClasses.clear(); - } - - /// \brief Remove all operation actions. - void clearOperationActions() { - } - - /// Return the largest legal super-reg register class of the register class - /// for the specified type and its associated "cost". - virtual std::pair<const TargetRegisterClass *, uint8_t> - findRepresentativeClass(const TargetRegisterInfo *TRI, MVT VT) const; - - /// Once all of the register classes are added, this allows us to compute - /// derived properties we expose. - void computeRegisterProperties(const TargetRegisterInfo *TRI); - - /// Indicate that the specified operation does not work with the specified - /// type and indicate what to do about it. - void setOperationAction(unsigned Op, MVT VT, - LegalizeAction Action) { - assert(Op < array_lengthof(OpActions[0]) && "Table isn't big enough!"); - OpActions[(unsigned)VT.SimpleTy][Op] = Action; - } - - /// Indicate that the specified load with extension does not work with the - /// specified type and indicate what to do about it. - void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, - LegalizeAction Action) { - assert(ExtType < ISD::LAST_LOADEXT_TYPE && ValVT.isValid() && - MemVT.isValid() && "Table isn't big enough!"); - LoadExtActions[(unsigned)ValVT.SimpleTy][MemVT.SimpleTy][ExtType] = Action; - } - - /// Indicate that the specified truncating store does not work with the - /// specified type and indicate what to do about it. - void setTruncStoreAction(MVT ValVT, MVT MemVT, - LegalizeAction Action) { - assert(ValVT.isValid() && MemVT.isValid() && "Table isn't big enough!"); - TruncStoreActions[(unsigned)ValVT.SimpleTy][MemVT.SimpleTy] = Action; - } - - /// Indicate that the specified indexed load does or does not work with the - /// specified type and indicate what to do abort it. - /// - /// NOTE: All indexed mode loads are initialized to Expand in - /// TargetLowering.cpp - void setIndexedLoadAction(unsigned IdxMode, MVT VT, - LegalizeAction Action) { - assert(VT.isValid() && IdxMode < ISD::LAST_INDEXED_MODE && - (unsigned)Action < 0xf && "Table isn't big enough!"); - // Load action are kept in the upper half. - IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] &= ~0xf0; - IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] |= ((uint8_t)Action) <<4; - } - - /// Indicate that the specified indexed store does or does not work with the - /// specified type and indicate what to do about it. - /// - /// NOTE: All indexed mode stores are initialized to Expand in - /// TargetLowering.cpp - void setIndexedStoreAction(unsigned IdxMode, MVT VT, - LegalizeAction Action) { - assert(VT.isValid() && IdxMode < ISD::LAST_INDEXED_MODE && - (unsigned)Action < 0xf && "Table isn't big enough!"); - // Store action are kept in the lower half. - IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] &= ~0x0f; - IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] |= ((uint8_t)Action); - } - - /// Indicate that the specified condition code is or isn't supported on the - /// target and indicate what to do about it. - void setCondCodeAction(ISD::CondCode CC, MVT VT, - LegalizeAction Action) { - assert(VT.isValid() && (unsigned)CC < array_lengthof(CondCodeActions) && - "Table isn't big enough!"); - assert((unsigned)Action < 0x10 && "too many bits for bitfield array"); - /// The lower 3 bits of the SimpleTy index into Nth 4bit set from the 32-bit - /// value and the upper 29 bits index into the second dimension of the array - /// to select what 32-bit value to use. - uint32_t Shift = 4 * (VT.SimpleTy & 0x7); - CondCodeActions[CC][VT.SimpleTy >> 3] &= ~((uint32_t)0xF << Shift); - CondCodeActions[CC][VT.SimpleTy >> 3] |= (uint32_t)Action << Shift; - } - - /// If Opc/OrigVT is specified as being promoted, the promotion code defaults - /// to trying a larger integer/fp until it can find one that works. If that - /// default is insufficient, this method can be used by the target to override - /// the default. - void AddPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT) { - PromoteToType[std::make_pair(Opc, OrigVT.SimpleTy)] = DestVT.SimpleTy; - } - - /// Targets should invoke this method for each target independent node that - /// they want to provide a custom DAG combiner for by implementing the - /// PerformDAGCombine virtual method. - void setTargetDAGCombine(ISD::NodeType NT) { - assert(unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray)); - TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7); - } - - /// Set the target's required jmp_buf buffer size (in bytes); default is 200 - void setJumpBufSize(unsigned Size) { - JumpBufSize = Size; - } - - /// Set the target's required jmp_buf buffer alignment (in bytes); default is - /// 0 - void setJumpBufAlignment(unsigned Align) { - JumpBufAlignment = Align; - } - - /// Set the target's minimum function alignment (in log2(bytes)) - void setMinFunctionAlignment(unsigned Align) { - MinFunctionAlignment = Align; - } - - /// Set the target's preferred function alignment. This should be set if - /// there is a performance benefit to higher-than-minimum alignment (in - /// log2(bytes)) - void setPrefFunctionAlignment(unsigned Align) { - PrefFunctionAlignment = Align; - } - - /// Set the target's preferred loop alignment. Default alignment is zero, it - /// means the target does not care about loop alignment. The alignment is - /// specified in log2(bytes). The target may also override - /// getPrefLoopAlignment to provide per-loop values. - void setPrefLoopAlignment(unsigned Align) { - PrefLoopAlignment = Align; - } - - /// Set the minimum stack alignment of an argument (in log2(bytes)). - void setMinStackArgumentAlignment(unsigned Align) { - MinStackArgumentAlignment = Align; - } - - /// Set if the DAG builder should automatically insert fences and reduce the - /// order of atomic memory operations to Monotonic. - void setInsertFencesForAtomic(bool fence) { - InsertFencesForAtomic = fence; - } - -public: - //===--------------------------------------------------------------------===// - // Addressing mode description hooks (used by LSR etc). - // - - /// CodeGenPrepare sinks address calculations into the same BB as Load/Store - /// instructions reading the address. This allows as much computation as - /// possible to be done in the address mode for that operand. This hook lets - /// targets also pass back when this should be done on intrinsics which - /// load/store. - virtual bool GetAddrModeArguments(IntrinsicInst * /*I*/, - SmallVectorImpl<Value*> &/*Ops*/, - Type *&/*AccessTy*/, - unsigned AddrSpace = 0) const { - return false; - } - - /// This represents an addressing mode of: - /// BaseGV + BaseOffs + BaseReg + Scale*ScaleReg - /// If BaseGV is null, there is no BaseGV. - /// If BaseOffs is zero, there is no base offset. - /// If HasBaseReg is false, there is no base register. - /// If Scale is zero, there is no ScaleReg. Scale of 1 indicates a reg with - /// no scale. - struct AddrMode { - GlobalValue *BaseGV; - int64_t BaseOffs; - bool HasBaseReg; - int64_t Scale; - AddrMode() : BaseGV(nullptr), BaseOffs(0), HasBaseReg(false), Scale(0) {} - }; - - /// Return true if the addressing mode represented by AM is legal for this - /// target, for a load/store of the specified type. - /// - /// The type may be VoidTy, in which case only return true if the addressing - /// mode is legal for a load/store of any legal type. TODO: Handle - /// pre/postinc as well. - /// - /// If the address space cannot be determined, it will be -1. - /// - /// TODO: Remove default argument - virtual bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, - Type *Ty, unsigned AddrSpace) const; - - /// \brief Return the cost of the scaling factor used in the addressing mode - /// represented by AM for this target, for a load/store of the specified type. - /// - /// If the AM is supported, the return value must be >= 0. - /// If the AM is not supported, it returns a negative value. - /// TODO: Handle pre/postinc as well. - /// TODO: Remove default argument - virtual int getScalingFactorCost(const DataLayout &DL, const AddrMode &AM, - Type *Ty, unsigned AS = 0) const { - // Default: assume that any scaling factor used in a legal AM is free. - if (isLegalAddressingMode(DL, AM, Ty, AS)) - return 0; - return -1; - } - - /// Return true if the specified immediate is legal icmp immediate, that is - /// the target has icmp instructions which can compare a register against the - /// immediate without having to materialize the immediate into a register. - virtual bool isLegalICmpImmediate(int64_t) const { - return true; - } - - /// Return true if the specified immediate is legal add immediate, that is the - /// target has add instructions which can add a register with the immediate - /// without having to materialize the immediate into a register. - virtual bool isLegalAddImmediate(int64_t) const { - return true; - } - - /// Return true if it's significantly cheaper to shift a vector by a uniform - /// scalar than by an amount which will vary across each lane. On x86, for - /// example, there is a "psllw" instruction for the former case, but no simple - /// instruction for a general "a << b" operation on vectors. - virtual bool isVectorShiftByScalarCheap(Type *Ty) const { - return false; - } - - /// Return true if it's free to truncate a value of type FromTy to type - /// ToTy. e.g. On x86 it's free to truncate a i32 value in register EAX to i16 - /// by referencing its sub-register AX. - /// Targets must return false when FromTy <= ToTy. - virtual bool isTruncateFree(Type *FromTy, Type *ToTy) const { - return false; - } - - /// Return true if a truncation from FromTy to ToTy is permitted when deciding - /// whether a call is in tail position. Typically this means that both results - /// would be assigned to the same register or stack slot, but it could mean - /// the target performs adequate checks of its own before proceeding with the - /// tail call. Targets must return false when FromTy <= ToTy. - virtual bool allowTruncateForTailCall(Type *FromTy, Type *ToTy) const { - return false; - } - - virtual bool isTruncateFree(EVT FromVT, EVT ToVT) const { - return false; - } - - virtual bool isProfitableToHoist(Instruction *I) const { return true; } - - /// Return true if the extension represented by \p I is free. - /// Unlikely the is[Z|FP]ExtFree family which is based on types, - /// this method can use the context provided by \p I to decide - /// whether or not \p I is free. - /// This method extends the behavior of the is[Z|FP]ExtFree family. - /// In other words, if is[Z|FP]Free returns true, then this method - /// returns true as well. The converse is not true. - /// The target can perform the adequate checks by overriding isExtFreeImpl. - /// \pre \p I must be a sign, zero, or fp extension. - bool isExtFree(const Instruction *I) const { - switch (I->getOpcode()) { - case Instruction::FPExt: - if (isFPExtFree(EVT::getEVT(I->getType()))) - return true; - break; - case Instruction::ZExt: - if (isZExtFree(I->getOperand(0)->getType(), I->getType())) - return true; - break; - case Instruction::SExt: - break; - default: - llvm_unreachable("Instruction is not an extension"); - } - return isExtFreeImpl(I); - } - - /// Return true if any actual instruction that defines a value of type FromTy - /// implicitly zero-extends the value to ToTy in the result register. - /// - /// The function should return true when it is likely that the truncate can - /// be freely folded with an instruction defining a value of FromTy. If - /// the defining instruction is unknown (because you're looking at a - /// function argument, PHI, etc.) then the target may require an - /// explicit truncate, which is not necessarily free, but this function - /// does not deal with those cases. - /// Targets must return false when FromTy >= ToTy. - virtual bool isZExtFree(Type *FromTy, Type *ToTy) const { - return false; - } - - virtual bool isZExtFree(EVT FromTy, EVT ToTy) const { - return false; - } - - /// Return true if the target supplies and combines to a paired load - /// two loaded values of type LoadedType next to each other in memory. - /// RequiredAlignment gives the minimal alignment constraints that must be met - /// to be able to select this paired load. - /// - /// This information is *not* used to generate actual paired loads, but it is - /// used to generate a sequence of loads that is easier to combine into a - /// paired load. - /// For instance, something like this: - /// a = load i64* addr - /// b = trunc i64 a to i32 - /// c = lshr i64 a, 32 - /// d = trunc i64 c to i32 - /// will be optimized into: - /// b = load i32* addr1 - /// d = load i32* addr2 - /// Where addr1 = addr2 +/- sizeof(i32). - /// - /// In other words, unless the target performs a post-isel load combining, - /// this information should not be provided because it will generate more - /// loads. - virtual bool hasPairedLoad(Type * /*LoadedType*/, - unsigned & /*RequiredAligment*/) const { - return false; - } - - virtual bool hasPairedLoad(EVT /*LoadedType*/, - unsigned & /*RequiredAligment*/) const { - return false; - } - - /// \brief Get the maximum supported factor for interleaved memory accesses. - /// Default to be the minimum interleave factor: 2. - virtual unsigned getMaxSupportedInterleaveFactor() const { return 2; } - - /// \brief Lower an interleaved load to target specific intrinsics. Return - /// true on success. - /// - /// \p LI is the vector load instruction. - /// \p Shuffles is the shufflevector list to DE-interleave the loaded vector. - /// \p Indices is the corresponding indices for each shufflevector. - /// \p Factor is the interleave factor. - virtual bool lowerInterleavedLoad(LoadInst *LI, - ArrayRef<ShuffleVectorInst *> Shuffles, - ArrayRef<unsigned> Indices, - unsigned Factor) const { - return false; - } - - /// \brief Lower an interleaved store to target specific intrinsics. Return - /// true on success. - /// - /// \p SI is the vector store instruction. - /// \p SVI is the shufflevector to RE-interleave the stored vector. - /// \p Factor is the interleave factor. - virtual bool lowerInterleavedStore(StoreInst *SI, ShuffleVectorInst *SVI, - unsigned Factor) const { - return false; - } - - /// Return true if zero-extending the specific node Val to type VT2 is free - /// (either because it's implicitly zero-extended such as ARM ldrb / ldrh or - /// because it's folded such as X86 zero-extending loads). - virtual bool isZExtFree(SDValue Val, EVT VT2) const { - return isZExtFree(Val.getValueType(), VT2); - } - - /// Return true if an fpext operation is free (for instance, because - /// single-precision floating-point numbers are implicitly extended to - /// double-precision). - virtual bool isFPExtFree(EVT VT) const { - assert(VT.isFloatingPoint()); - return false; - } - - /// Return true if folding a vector load into ExtVal (a sign, zero, or any - /// extend node) is profitable. - virtual bool isVectorLoadExtDesirable(SDValue ExtVal) const { return false; } - - /// Return true if an fneg operation is free to the point where it is never - /// worthwhile to replace it with a bitwise operation. - virtual bool isFNegFree(EVT VT) const { - assert(VT.isFloatingPoint()); - return false; - } - - /// Return true if an fabs operation is free to the point where it is never - /// worthwhile to replace it with a bitwise operation. - virtual bool isFAbsFree(EVT VT) const { - assert(VT.isFloatingPoint()); - return false; - } - - /// Return true if an FMA operation is faster than a pair of fmul and fadd - /// instructions. fmuladd intrinsics will be expanded to FMAs when this method - /// returns true, otherwise fmuladd is expanded to fmul + fadd. - /// - /// NOTE: This may be called before legalization on types for which FMAs are - /// not legal, but should return true if those types will eventually legalize - /// to types that support FMAs. After legalization, it will only be called on - /// types that support FMAs (via Legal or Custom actions) - virtual bool isFMAFasterThanFMulAndFAdd(EVT) const { - return false; - } - - /// Return true if it's profitable to narrow operations of type VT1 to - /// VT2. e.g. on x86, it's profitable to narrow from i32 to i8 but not from - /// i32 to i16. - virtual bool isNarrowingProfitable(EVT /*VT1*/, EVT /*VT2*/) const { - return false; - } - - /// \brief Return true if it is beneficial to convert a load of a constant to - /// just the constant itself. - /// On some targets it might be more efficient to use a combination of - /// arithmetic instructions to materialize the constant instead of loading it - /// from a constant pool. - virtual bool shouldConvertConstantLoadToIntImm(const APInt &Imm, - Type *Ty) const { - return false; - } - - /// Return true if EXTRACT_SUBVECTOR is cheap for this result type - /// with this index. This is needed because EXTRACT_SUBVECTOR usually - /// has custom lowering that depends on the index of the first element, - /// and only the target knows which lowering is cheap. - virtual bool isExtractSubvectorCheap(EVT ResVT, unsigned Index) const { - return false; - } - - // Return true if it is profitable to use a scalar input to a BUILD_VECTOR - // even if the vector itself has multiple uses. - virtual bool aggressivelyPreferBuildVectorSources(EVT VecVT) const { - return false; - } - - //===--------------------------------------------------------------------===// - // Runtime Library hooks - // - - /// Rename the default libcall routine name for the specified libcall. - void setLibcallName(RTLIB::Libcall Call, const char *Name) { - LibcallRoutineNames[Call] = Name; - } - - /// Get the libcall routine name for the specified libcall. - const char *getLibcallName(RTLIB::Libcall Call) const { - return LibcallRoutineNames[Call]; - } - - /// Override the default CondCode to be used to test the result of the - /// comparison libcall against zero. - void setCmpLibcallCC(RTLIB::Libcall Call, ISD::CondCode CC) { - CmpLibcallCCs[Call] = CC; - } - - /// Get the CondCode that's to be used to test the result of the comparison - /// libcall against zero. - ISD::CondCode getCmpLibcallCC(RTLIB::Libcall Call) const { - return CmpLibcallCCs[Call]; - } - - /// Set the CallingConv that should be used for the specified libcall. - void setLibcallCallingConv(RTLIB::Libcall Call, CallingConv::ID CC) { - LibcallCallingConvs[Call] = CC; - } - - /// Get the CallingConv that should be used for the specified libcall. - CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const { - return LibcallCallingConvs[Call]; - } - -private: - const TargetMachine &TM; - - /// Tells the code generator not to expand operations into sequences that use - /// the select operations if possible. - bool SelectIsExpensive; - - /// Tells the code generator that the target has multiple (allocatable) - /// condition registers that can be used to store the results of comparisons - /// for use by selects and conditional branches. With multiple condition - /// registers, the code generator will not aggressively sink comparisons into - /// the blocks of their users. - bool HasMultipleConditionRegisters; - - /// Tells the code generator that the target has BitExtract instructions. - /// The code generator will aggressively sink "shift"s into the blocks of - /// their users if the users will generate "and" instructions which can be - /// combined with "shift" to BitExtract instructions. - bool HasExtractBitsInsn; - - // Don't expand fsqrt with an approximation based on the inverse sqrt. - bool FsqrtIsCheap; - - /// Tells the code generator to bypass slow divide or remainder - /// instructions. For example, BypassSlowDivWidths[32,8] tells the code - /// generator to bypass 32-bit integer div/rem with an 8-bit unsigned integer - /// div/rem when the operands are positive and less than 256. - DenseMap <unsigned int, unsigned int> BypassSlowDivWidths; - - /// Tells the code generator that it shouldn't generate extra flow control - /// instructions and should attempt to combine flow control instructions via - /// predication. - bool JumpIsExpensive; - - /// Whether the target supports or cares about preserving floating point - /// exception behavior. - bool HasFloatingPointExceptions; - - /// This target prefers to use _setjmp to implement llvm.setjmp. - /// - /// Defaults to false. - bool UseUnderscoreSetJmp; - - /// This target prefers to use _longjmp to implement llvm.longjmp. - /// - /// Defaults to false. - bool UseUnderscoreLongJmp; - - /// Number of blocks threshold to use jump tables. - int MinimumJumpTableEntries; - - /// Information about the contents of the high-bits in boolean values held in - /// a type wider than i1. See getBooleanContents. - BooleanContent BooleanContents; - - /// Information about the contents of the high-bits in boolean values held in - /// a type wider than i1. See getBooleanContents. - BooleanContent BooleanFloatContents; - - /// Information about the contents of the high-bits in boolean vector values - /// when the element type is wider than i1. See getBooleanContents. - BooleanContent BooleanVectorContents; - - /// The target scheduling preference: shortest possible total cycles or lowest - /// register usage. - Sched::Preference SchedPreferenceInfo; - - /// The size, in bytes, of the target's jmp_buf buffers - unsigned JumpBufSize; - - /// The alignment, in bytes, of the target's jmp_buf buffers - unsigned JumpBufAlignment; - - /// The minimum alignment that any argument on the stack needs to have. - unsigned MinStackArgumentAlignment; - - /// The minimum function alignment (used when optimizing for size, and to - /// prevent explicitly provided alignment from leading to incorrect code). - unsigned MinFunctionAlignment; - - /// The preferred function alignment (used when alignment unspecified and - /// optimizing for speed). - unsigned PrefFunctionAlignment; - - /// The preferred loop alignment. - unsigned PrefLoopAlignment; - - /// Whether the DAG builder should automatically insert fences and reduce - /// ordering for atomics. (This will be set for for most architectures with - /// weak memory ordering.) - bool InsertFencesForAtomic; - - /// If set to a physical register, this specifies the register that - /// llvm.savestack/llvm.restorestack should save and restore. - unsigned StackPointerRegisterToSaveRestore; - - /// This indicates the default register class to use for each ValueType the - /// target supports natively. - const TargetRegisterClass *RegClassForVT[MVT::LAST_VALUETYPE]; - unsigned char NumRegistersForVT[MVT::LAST_VALUETYPE]; - MVT RegisterTypeForVT[MVT::LAST_VALUETYPE]; - - /// This indicates the "representative" register class to use for each - /// ValueType the target supports natively. This information is used by the - /// scheduler to track register pressure. By default, the representative - /// register class is the largest legal super-reg register class of the - /// register class of the specified type. e.g. On x86, i8, i16, and i32's - /// representative class would be GR32. - const TargetRegisterClass *RepRegClassForVT[MVT::LAST_VALUETYPE]; - - /// This indicates the "cost" of the "representative" register class for each - /// ValueType. The cost is used by the scheduler to approximate register - /// pressure. - uint8_t RepRegClassCostForVT[MVT::LAST_VALUETYPE]; - - /// For any value types we are promoting or expanding, this contains the value - /// type that we are changing to. For Expanded types, this contains one step - /// of the expand (e.g. i64 -> i32), even if there are multiple steps required - /// (e.g. i64 -> i16). For types natively supported by the system, this holds - /// the same type (e.g. i32 -> i32). - MVT TransformToType[MVT::LAST_VALUETYPE]; - - /// For each operation and each value type, keep a LegalizeAction that - /// indicates how instruction selection should deal with the operation. Most - /// operations are Legal (aka, supported natively by the target), but - /// operations that are not should be described. Note that operations on - /// non-legal value types are not described here. - LegalizeAction OpActions[MVT::LAST_VALUETYPE][ISD::BUILTIN_OP_END]; - - /// For each load extension type and each value type, keep a LegalizeAction - /// that indicates how instruction selection should deal with a load of a - /// specific value type and extension type. - LegalizeAction LoadExtActions[MVT::LAST_VALUETYPE][MVT::LAST_VALUETYPE] - [ISD::LAST_LOADEXT_TYPE]; - - /// For each value type pair keep a LegalizeAction that indicates whether a - /// truncating store of a specific value type and truncating type is legal. - LegalizeAction TruncStoreActions[MVT::LAST_VALUETYPE][MVT::LAST_VALUETYPE]; - - /// For each indexed mode and each value type, keep a pair of LegalizeAction - /// that indicates how instruction selection should deal with the load / - /// store. - /// - /// The first dimension is the value_type for the reference. The second - /// dimension represents the various modes for load store. - uint8_t IndexedModeActions[MVT::LAST_VALUETYPE][ISD::LAST_INDEXED_MODE]; - - /// For each condition code (ISD::CondCode) keep a LegalizeAction that - /// indicates how instruction selection should deal with the condition code. - /// - /// Because each CC action takes up 4 bits, we need to have the array size be - /// large enough to fit all of the value types. This can be done by rounding - /// up the MVT::LAST_VALUETYPE value to the next multiple of 8. - uint32_t CondCodeActions[ISD::SETCC_INVALID][(MVT::LAST_VALUETYPE + 7) / 8]; - -protected: - ValueTypeActionImpl ValueTypeActions; - -private: - LegalizeKind getTypeConversion(LLVMContext &Context, EVT VT) const; - -private: - std::vector<std::pair<MVT, const TargetRegisterClass*> > AvailableRegClasses; - - /// Targets can specify ISD nodes that they would like PerformDAGCombine - /// callbacks for by calling setTargetDAGCombine(), which sets a bit in this - /// array. - unsigned char - TargetDAGCombineArray[(ISD::BUILTIN_OP_END+CHAR_BIT-1)/CHAR_BIT]; - - /// For operations that must be promoted to a specific type, this holds the - /// destination type. This map should be sparse, so don't hold it as an - /// array. - /// - /// Targets add entries to this map with AddPromotedToType(..), clients access - /// this with getTypeToPromoteTo(..). - std::map<std::pair<unsigned, MVT::SimpleValueType>, MVT::SimpleValueType> - PromoteToType; - - /// Stores the name each libcall. - const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL]; - - /// The ISD::CondCode that should be used to test the result of each of the - /// comparison libcall against zero. - ISD::CondCode CmpLibcallCCs[RTLIB::UNKNOWN_LIBCALL]; - - /// Stores the CallingConv that should be used for each libcall. - CallingConv::ID LibcallCallingConvs[RTLIB::UNKNOWN_LIBCALL]; - -protected: - /// Return true if the extension represented by \p I is free. - /// \pre \p I is a sign, zero, or fp extension and - /// is[Z|FP]ExtFree of the related types is not true. - virtual bool isExtFreeImpl(const Instruction *I) const { return false; } - - /// Depth that GatherAllAliases should should continue looking for chain - /// dependencies when trying to find a more preferrable chain. As an - /// approximation, this should be more than the number of consecutive stores - /// expected to be merged. - unsigned GatherAllAliasesMaxDepth; - - /// \brief Specify maximum number of store instructions per memset call. - /// - /// When lowering \@llvm.memset this field specifies the maximum number of - /// store operations that may be substituted for the call to memset. Targets - /// must set this value based on the cost threshold for that target. Targets - /// should assume that the memset will be done using as many of the largest - /// store operations first, followed by smaller ones, if necessary, per - /// alignment restrictions. For example, storing 9 bytes on a 32-bit machine - /// with 16-bit alignment would result in four 2-byte stores and one 1-byte - /// store. This only applies to setting a constant array of a constant size. - unsigned MaxStoresPerMemset; - - /// Maximum number of stores operations that may be substituted for the call - /// to memset, used for functions with OptSize attribute. - unsigned MaxStoresPerMemsetOptSize; - - /// \brief Specify maximum bytes of store instructions per memcpy call. - /// - /// When lowering \@llvm.memcpy this field specifies the maximum number of - /// store operations that may be substituted for a call to memcpy. Targets - /// must set this value based on the cost threshold for that target. Targets - /// should assume that the memcpy will be done using as many of the largest - /// store operations first, followed by smaller ones, if necessary, per - /// alignment restrictions. For example, storing 7 bytes on a 32-bit machine - /// with 32-bit alignment would result in one 4-byte store, a one 2-byte store - /// and one 1-byte store. This only applies to copying a constant array of - /// constant size. - unsigned MaxStoresPerMemcpy; - - /// Maximum number of store operations that may be substituted for a call to - /// memcpy, used for functions with OptSize attribute. - unsigned MaxStoresPerMemcpyOptSize; - - /// \brief Specify maximum bytes of store instructions per memmove call. - /// - /// When lowering \@llvm.memmove this field specifies the maximum number of - /// store instructions that may be substituted for a call to memmove. Targets - /// must set this value based on the cost threshold for that target. Targets - /// should assume that the memmove will be done using as many of the largest - /// store operations first, followed by smaller ones, if necessary, per - /// alignment restrictions. For example, moving 9 bytes on a 32-bit machine - /// with 8-bit alignment would result in nine 1-byte stores. This only - /// applies to copying a constant array of constant size. - unsigned MaxStoresPerMemmove; - - /// Maximum number of store instructions that may be substituted for a call to - /// memmove, used for functions with OptSize attribute. - unsigned MaxStoresPerMemmoveOptSize; - - /// Tells the code generator that select is more expensive than a branch if - /// the branch is usually predicted right. - bool PredictableSelectIsExpensive; - - /// MaskAndBranchFoldingIsLegal - Indicates if the target supports folding - /// a mask of a single bit, a compare, and a branch into a single instruction. - bool MaskAndBranchFoldingIsLegal; - - /// \see enableExtLdPromotion. - bool EnableExtLdPromotion; - -protected: - /// Return true if the value types that can be represented by the specified - /// register class are all legal. - bool isLegalRC(const TargetRegisterClass *RC) const; - - /// Replace/modify any TargetFrameIndex operands with a targte-dependent - /// sequence of memory operands that is recognized by PrologEpilogInserter. - MachineBasicBlock *emitPatchPoint(MachineInstr *MI, - MachineBasicBlock *MBB) const; -}; - -/// This class defines information used to lower LLVM code to legal SelectionDAG -/// operators that the target instruction selector can accept natively. -/// -/// This class also defines callbacks that targets must implement to lower -/// target-specific constructs to SelectionDAG operators. -class TargetLowering : public TargetLoweringBase { - TargetLowering(const TargetLowering&) = delete; - void operator=(const TargetLowering&) = delete; - -public: - /// NOTE: The TargetMachine owns TLOF. - explicit TargetLowering(const TargetMachine &TM); - - /// Returns true by value, base pointer and offset pointer and addressing mode - /// by reference if the node's address can be legally represented as - /// pre-indexed load / store address. - virtual bool getPreIndexedAddressParts(SDNode * /*N*/, SDValue &/*Base*/, - SDValue &/*Offset*/, - ISD::MemIndexedMode &/*AM*/, - SelectionDAG &/*DAG*/) const { - return false; - } - - /// Returns true by value, base pointer and offset pointer and addressing mode - /// by reference if this node can be combined with a load / store to form a - /// post-indexed load / store. - virtual bool getPostIndexedAddressParts(SDNode * /*N*/, SDNode * /*Op*/, - SDValue &/*Base*/, - SDValue &/*Offset*/, - ISD::MemIndexedMode &/*AM*/, - SelectionDAG &/*DAG*/) const { - return false; - } - - /// Return the entry encoding for a jump table in the current function. The - /// returned value is a member of the MachineJumpTableInfo::JTEntryKind enum. - virtual unsigned getJumpTableEncoding() const; - - virtual const MCExpr * - LowerCustomJumpTableEntry(const MachineJumpTableInfo * /*MJTI*/, - const MachineBasicBlock * /*MBB*/, unsigned /*uid*/, - MCContext &/*Ctx*/) const { - llvm_unreachable("Need to implement this hook if target has custom JTIs"); - } - - /// Returns relocation base for the given PIC jumptable. - virtual SDValue getPICJumpTableRelocBase(SDValue Table, - SelectionDAG &DAG) const; - - /// This returns the relocation base for the given PIC jumptable, the same as - /// getPICJumpTableRelocBase, but as an MCExpr. - virtual const MCExpr * - getPICJumpTableRelocBaseExpr(const MachineFunction *MF, - unsigned JTI, MCContext &Ctx) const; - - /// Return true if folding a constant offset with the given GlobalAddress is - /// legal. It is frequently not legal in PIC relocation models. - virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const; - - bool isInTailCallPosition(SelectionDAG &DAG, SDNode *Node, - SDValue &Chain) const; - - void softenSetCCOperands(SelectionDAG &DAG, EVT VT, - SDValue &NewLHS, SDValue &NewRHS, - ISD::CondCode &CCCode, SDLoc DL) const; - - /// Returns a pair of (return value, chain). - /// It is an error to pass RTLIB::UNKNOWN_LIBCALL as \p LC. - std::pair<SDValue, SDValue> makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, - EVT RetVT, ArrayRef<SDValue> Ops, - bool isSigned, SDLoc dl, - bool doesNotReturn = false, - bool isReturnValueUsed = true) const; - - //===--------------------------------------------------------------------===// - // TargetLowering Optimization Methods - // - - /// A convenience struct that encapsulates a DAG, and two SDValues for - /// returning information from TargetLowering to its clients that want to - /// combine. - struct TargetLoweringOpt { - SelectionDAG &DAG; - bool LegalTys; - bool LegalOps; - SDValue Old; - SDValue New; - - explicit TargetLoweringOpt(SelectionDAG &InDAG, - bool LT, bool LO) : - DAG(InDAG), LegalTys(LT), LegalOps(LO) {} - - bool LegalTypes() const { return LegalTys; } - bool LegalOperations() const { return LegalOps; } - - bool CombineTo(SDValue O, SDValue N) { - Old = O; - New = N; - return true; - } - - /// Check to see if the specified operand of the specified instruction is a - /// constant integer. If so, check to see if there are any bits set in the - /// constant that are not demanded. If so, shrink the constant and return - /// true. - bool ShrinkDemandedConstant(SDValue Op, const APInt &Demanded); - - /// Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free. This - /// uses isZExtFree and ZERO_EXTEND for the widening cast, but it could be - /// generalized for targets with other types of implicit widening casts. - bool ShrinkDemandedOp(SDValue Op, unsigned BitWidth, const APInt &Demanded, - SDLoc dl); - }; - - /// Look at Op. At this point, we know that only the DemandedMask bits of the - /// result of Op are ever used downstream. If we can use this information to - /// simplify Op, create a new simplified DAG node and return true, returning - /// the original and new nodes in Old and New. Otherwise, analyze the - /// expression and return a mask of KnownOne and KnownZero bits for the - /// expression (used to simplify the caller). The KnownZero/One bits may only - /// be accurate for those bits in the DemandedMask. - bool SimplifyDemandedBits(SDValue Op, const APInt &DemandedMask, - APInt &KnownZero, APInt &KnownOne, - TargetLoweringOpt &TLO, unsigned Depth = 0) const; - - /// Determine which of the bits specified in Mask are known to be either zero - /// or one and return them in the KnownZero/KnownOne bitsets. - virtual void computeKnownBitsForTargetNode(const SDValue Op, - APInt &KnownZero, - APInt &KnownOne, - const SelectionDAG &DAG, - unsigned Depth = 0) const; - - /// This method can be implemented by targets that want to expose additional - /// information about sign bits to the DAG Combiner. - virtual unsigned ComputeNumSignBitsForTargetNode(SDValue Op, - const SelectionDAG &DAG, - unsigned Depth = 0) const; - - struct DAGCombinerInfo { - void *DC; // The DAG Combiner object. - CombineLevel Level; - bool CalledByLegalizer; - public: - SelectionDAG &DAG; - - DAGCombinerInfo(SelectionDAG &dag, CombineLevel level, bool cl, void *dc) - : DC(dc), Level(level), CalledByLegalizer(cl), DAG(dag) {} - - bool isBeforeLegalize() const { return Level == BeforeLegalizeTypes; } - bool isBeforeLegalizeOps() const { return Level < AfterLegalizeVectorOps; } - bool isAfterLegalizeVectorOps() const { - return Level == AfterLegalizeDAG; - } - CombineLevel getDAGCombineLevel() { return Level; } - bool isCalledByLegalizer() const { return CalledByLegalizer; } - - void AddToWorklist(SDNode *N); - void RemoveFromWorklist(SDNode *N); - SDValue CombineTo(SDNode *N, ArrayRef<SDValue> To, bool AddTo = true); - SDValue CombineTo(SDNode *N, SDValue Res, bool AddTo = true); - SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1, bool AddTo = true); - - void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO); - }; - - /// Return if the N is a constant or constant vector equal to the true value - /// from getBooleanContents(). - bool isConstTrueVal(const SDNode *N) const; - - /// Return if the N is a constant or constant vector equal to the false value - /// from getBooleanContents(). - bool isConstFalseVal(const SDNode *N) const; - - /// Try to simplify a setcc built with the specified operands and cc. If it is - /// unable to simplify it, return a null SDValue. - SDValue SimplifySetCC(EVT VT, SDValue N0, SDValue N1, - ISD::CondCode Cond, bool foldBooleans, - DAGCombinerInfo &DCI, SDLoc dl) const; - - /// Returns true (and the GlobalValue and the offset) if the node is a - /// GlobalAddress + offset. - virtual bool - isGAPlusOffset(SDNode *N, const GlobalValue* &GA, int64_t &Offset) const; - - /// This method will be invoked for all target nodes and for any - /// target-independent nodes that the target has registered with invoke it - /// for. - /// - /// The semantics are as follows: - /// Return Value: - /// SDValue.Val == 0 - No change was made - /// SDValue.Val == N - N was replaced, is dead, and is already handled. - /// otherwise - N should be replaced by the returned Operand. - /// - /// In addition, methods provided by DAGCombinerInfo may be used to perform - /// more complex transformations. - /// - virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const; - - /// Return true if it is profitable to move a following shift through this - // node, adjusting any immediate operands as necessary to preserve semantics. - // This transformation may not be desirable if it disrupts a particularly - // auspicious target-specific tree (e.g. bitfield extraction in AArch64). - // By default, it returns true. - virtual bool isDesirableToCommuteWithShift(const SDNode *N /*Op*/) const { - return true; - } - - /// Return true if the target has native support for the specified value type - /// and it is 'desirable' to use the type for the given node type. e.g. On x86 - /// i16 is legal, but undesirable since i16 instruction encodings are longer - /// and some i16 instructions are slow. - virtual bool isTypeDesirableForOp(unsigned /*Opc*/, EVT VT) const { - // By default, assume all legal types are desirable. - return isTypeLegal(VT); - } - - /// Return true if it is profitable for dag combiner to transform a floating - /// point op of specified opcode to a equivalent op of an integer - /// type. e.g. f32 load -> i32 load can be profitable on ARM. - virtual bool isDesirableToTransformToIntegerOp(unsigned /*Opc*/, - EVT /*VT*/) const { - return false; - } - - /// This method query the target whether it is beneficial for dag combiner to - /// promote the specified node. If true, it should return the desired - /// promotion type by reference. - virtual bool IsDesirableToPromoteOp(SDValue /*Op*/, EVT &/*PVT*/) const { - return false; - } - - /// Return true if the target supports that a subset of CSRs for the given - /// machine function is handled explicitly via copies. - virtual bool supportSplitCSR(MachineFunction *MF) const { - return false; - } - - /// Return true if the MachineFunction contains a COPY which would imply - /// HasCopyImplyingStackAdjustment. - virtual bool hasCopyImplyingStackAdjustment(MachineFunction *MF) const { - return false; - } - - /// Perform necessary initialization to handle a subset of CSRs explicitly - /// via copies. This function is called at the beginning of instruction - /// selection. - virtual void initializeSplitCSR(MachineBasicBlock *Entry) const { - llvm_unreachable("Not Implemented"); - } - - /// Insert explicit copies in entry and exit blocks. We copy a subset of - /// CSRs to virtual registers in the entry block, and copy them back to - /// physical registers in the exit blocks. This function is called at the end - /// of instruction selection. - virtual void insertCopiesSplitCSR( - MachineBasicBlock *Entry, - const SmallVectorImpl<MachineBasicBlock *> &Exits) const { - llvm_unreachable("Not Implemented"); - } - - //===--------------------------------------------------------------------===// - // Lowering methods - These methods must be implemented by targets so that - // the SelectionDAGBuilder code knows how to lower these. - // - - /// This hook must be implemented to lower the incoming (formal) arguments, - /// described by the Ins array, into the specified DAG. The implementation - /// should fill in the InVals array with legal-type argument values, and - /// return the resulting token chain value. - /// - virtual SDValue - LowerFormalArguments(SDValue /*Chain*/, CallingConv::ID /*CallConv*/, - bool /*isVarArg*/, - const SmallVectorImpl<ISD::InputArg> &/*Ins*/, - SDLoc /*dl*/, SelectionDAG &/*DAG*/, - SmallVectorImpl<SDValue> &/*InVals*/) const { - llvm_unreachable("Not Implemented"); - } - - struct ArgListEntry { - SDValue Node; - Type* Ty; - bool isSExt : 1; - bool isZExt : 1; - bool isInReg : 1; - bool isSRet : 1; - bool isNest : 1; - bool isByVal : 1; - bool isInAlloca : 1; - bool isReturned : 1; - uint16_t Alignment; - - ArgListEntry() : isSExt(false), isZExt(false), isInReg(false), - isSRet(false), isNest(false), isByVal(false), isInAlloca(false), - isReturned(false), Alignment(0) { } - - void setAttributes(ImmutableCallSite *CS, unsigned AttrIdx); - }; - typedef std::vector<ArgListEntry> ArgListTy; - - /// This structure contains all information that is necessary for lowering - /// calls. It is passed to TLI::LowerCallTo when the SelectionDAG builder - /// needs to lower a call, and targets will see this struct in their LowerCall - /// implementation. - struct CallLoweringInfo { - SDValue Chain; - Type *RetTy; - bool RetSExt : 1; - bool RetZExt : 1; - bool IsVarArg : 1; - bool IsInReg : 1; - bool DoesNotReturn : 1; - bool IsReturnValueUsed : 1; - - // IsTailCall should be modified by implementations of - // TargetLowering::LowerCall that perform tail call conversions. - bool IsTailCall; - - unsigned NumFixedArgs; - CallingConv::ID CallConv; - SDValue Callee; - ArgListTy Args; - SelectionDAG &DAG; - SDLoc DL; - ImmutableCallSite *CS; - bool IsPatchPoint; - SmallVector<ISD::OutputArg, 32> Outs; - SmallVector<SDValue, 32> OutVals; - SmallVector<ISD::InputArg, 32> Ins; - - CallLoweringInfo(SelectionDAG &DAG) - : RetTy(nullptr), RetSExt(false), RetZExt(false), IsVarArg(false), - IsInReg(false), DoesNotReturn(false), IsReturnValueUsed(true), - IsTailCall(false), NumFixedArgs(-1), CallConv(CallingConv::C), - DAG(DAG), CS(nullptr), IsPatchPoint(false) {} - - CallLoweringInfo &setDebugLoc(SDLoc dl) { - DL = dl; - return *this; - } - - CallLoweringInfo &setChain(SDValue InChain) { - Chain = InChain; - return *this; - } - - CallLoweringInfo &setCallee(CallingConv::ID CC, Type *ResultType, - SDValue Target, ArgListTy &&ArgsList, - unsigned FixedArgs = -1) { - RetTy = ResultType; - Callee = Target; - CallConv = CC; - NumFixedArgs = - (FixedArgs == static_cast<unsigned>(-1) ? Args.size() : FixedArgs); - Args = std::move(ArgsList); - return *this; - } - - CallLoweringInfo &setCallee(Type *ResultType, FunctionType *FTy, - SDValue Target, ArgListTy &&ArgsList, - ImmutableCallSite &Call) { - RetTy = ResultType; - - IsInReg = Call.paramHasAttr(0, Attribute::InReg); - DoesNotReturn = Call.doesNotReturn(); - IsVarArg = FTy->isVarArg(); - IsReturnValueUsed = !Call.getInstruction()->use_empty(); - RetSExt = Call.paramHasAttr(0, Attribute::SExt); - RetZExt = Call.paramHasAttr(0, Attribute::ZExt); - - Callee = Target; - - CallConv = Call.getCallingConv(); - NumFixedArgs = FTy->getNumParams(); - Args = std::move(ArgsList); - - CS = &Call; - - return *this; - } - - CallLoweringInfo &setInRegister(bool Value = true) { - IsInReg = Value; - return *this; - } - - CallLoweringInfo &setNoReturn(bool Value = true) { - DoesNotReturn = Value; - return *this; - } - - CallLoweringInfo &setVarArg(bool Value = true) { - IsVarArg = Value; - return *this; - } - - CallLoweringInfo &setTailCall(bool Value = true) { - IsTailCall = Value; - return *this; - } - - CallLoweringInfo &setDiscardResult(bool Value = true) { - IsReturnValueUsed = !Value; - return *this; - } - - CallLoweringInfo &setSExtResult(bool Value = true) { - RetSExt = Value; - return *this; - } - - CallLoweringInfo &setZExtResult(bool Value = true) { - RetZExt = Value; - return *this; - } - - CallLoweringInfo &setIsPatchPoint(bool Value = true) { - IsPatchPoint = Value; - return *this; - } - - ArgListTy &getArgs() { - return Args; - } - - }; - - /// This function lowers an abstract call to a function into an actual call. - /// This returns a pair of operands. The first element is the return value - /// for the function (if RetTy is not VoidTy). The second element is the - /// outgoing token chain. It calls LowerCall to do the actual lowering. - std::pair<SDValue, SDValue> LowerCallTo(CallLoweringInfo &CLI) const; - - /// This hook must be implemented to lower calls into the specified - /// DAG. The outgoing arguments to the call are described by the Outs array, - /// and the values to be returned by the call are described by the Ins - /// array. The implementation should fill in the InVals array with legal-type - /// return values from the call, and return the resulting token chain value. - virtual SDValue - LowerCall(CallLoweringInfo &/*CLI*/, - SmallVectorImpl<SDValue> &/*InVals*/) const { - llvm_unreachable("Not Implemented"); - } - - /// Target-specific cleanup for formal ByVal parameters. - virtual void HandleByVal(CCState *, unsigned &, unsigned) const {} - - /// This hook should be implemented to check whether the return values - /// described by the Outs array can fit into the return registers. If false - /// is returned, an sret-demotion is performed. - virtual bool CanLowerReturn(CallingConv::ID /*CallConv*/, - MachineFunction &/*MF*/, bool /*isVarArg*/, - const SmallVectorImpl<ISD::OutputArg> &/*Outs*/, - LLVMContext &/*Context*/) const - { - // Return true by default to get preexisting behavior. - return true; - } - - /// This hook must be implemented to lower outgoing return values, described - /// by the Outs array, into the specified DAG. The implementation should - /// return the resulting token chain value. - virtual SDValue - LowerReturn(SDValue /*Chain*/, CallingConv::ID /*CallConv*/, - bool /*isVarArg*/, - const SmallVectorImpl<ISD::OutputArg> &/*Outs*/, - const SmallVectorImpl<SDValue> &/*OutVals*/, - SDLoc /*dl*/, SelectionDAG &/*DAG*/) const { - llvm_unreachable("Not Implemented"); - } - - /// Return true if result of the specified node is used by a return node - /// only. It also compute and return the input chain for the tail call. - /// - /// This is used to determine whether it is possible to codegen a libcall as - /// tail call at legalization time. - virtual bool isUsedByReturnOnly(SDNode *, SDValue &/*Chain*/) const { - return false; - } - - /// Return true if the target may be able emit the call instruction as a tail - /// call. This is used by optimization passes to determine if it's profitable - /// to duplicate return instructions to enable tailcall optimization. - virtual bool mayBeEmittedAsTailCall(CallInst *) const { - return false; - } - - /// Return the builtin name for the __builtin___clear_cache intrinsic - /// Default is to invoke the clear cache library call - virtual const char * getClearCacheBuiltinName() const { - return "__clear_cache"; - } - - /// Return the register ID of the name passed in. Used by named register - /// global variables extension. There is no target-independent behaviour - /// so the default action is to bail. - virtual unsigned getRegisterByName(const char* RegName, EVT VT, - SelectionDAG &DAG) const { - report_fatal_error("Named registers not implemented for this target"); - } - - /// Return the type that should be used to zero or sign extend a - /// zeroext/signext integer argument or return value. FIXME: Most C calling - /// convention requires the return type to be promoted, but this is not true - /// all the time, e.g. i1 on x86-64. It is also not necessary for non-C - /// calling conventions. The frontend should handle this and include all of - /// the necessary information. - virtual EVT getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT, - ISD::NodeType /*ExtendKind*/) const { - EVT MinVT = getRegisterType(Context, MVT::i32); - return VT.bitsLT(MinVT) ? MinVT : VT; - } - - /// For some targets, an LLVM struct type must be broken down into multiple - /// simple types, but the calling convention specifies that the entire struct - /// must be passed in a block of consecutive registers. - virtual bool - functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, - bool isVarArg) const { - return false; - } - - /// Returns a 0 terminated array of registers that can be safely used as - /// scratch registers. - virtual const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const { - return nullptr; - } - - /// This callback is used to prepare for a volatile or atomic load. - /// It takes a chain node as input and returns the chain for the load itself. - /// - /// Having a callback like this is necessary for targets like SystemZ, - /// which allows a CPU to reuse the result of a previous load indefinitely, - /// even if a cache-coherent store is performed by another CPU. The default - /// implementation does nothing. - virtual SDValue prepareVolatileOrAtomicLoad(SDValue Chain, SDLoc DL, - SelectionDAG &DAG) const { - return Chain; - } - - /// This callback is invoked by the type legalizer to legalize nodes with an - /// illegal operand type but legal result types. It replaces the - /// LowerOperation callback in the type Legalizer. The reason we can not do - /// away with LowerOperation entirely is that LegalizeDAG isn't yet ready to - /// use this callback. - /// - /// TODO: Consider merging with ReplaceNodeResults. - /// - /// The target places new result values for the node in Results (their number - /// and types must exactly match those of the original return values of - /// the node), or leaves Results empty, which indicates that the node is not - /// to be custom lowered after all. - /// The default implementation calls LowerOperation. - virtual void LowerOperationWrapper(SDNode *N, - SmallVectorImpl<SDValue> &Results, - SelectionDAG &DAG) const; - - /// This callback is invoked for operations that are unsupported by the - /// target, which are registered to use 'custom' lowering, and whose defined - /// values are all legal. If the target has no operations that require custom - /// lowering, it need not implement this. The default implementation of this - /// aborts. - virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const; - - /// This callback is invoked when a node result type is illegal for the - /// target, and the operation was registered to use 'custom' lowering for that - /// result type. The target places new result values for the node in Results - /// (their number and types must exactly match those of the original return - /// values of the node), or leaves Results empty, which indicates that the - /// node is not to be custom lowered after all. - /// - /// If the target has no operations that require custom lowering, it need not - /// implement this. The default implementation aborts. - virtual void ReplaceNodeResults(SDNode * /*N*/, - SmallVectorImpl<SDValue> &/*Results*/, - SelectionDAG &/*DAG*/) const { - llvm_unreachable("ReplaceNodeResults not implemented for this target!"); - } - - /// This method returns the name of a target specific DAG node. - virtual const char *getTargetNodeName(unsigned Opcode) const; - - /// This method returns a target specific FastISel object, or null if the - /// target does not support "fast" ISel. - virtual FastISel *createFastISel(FunctionLoweringInfo &, - const TargetLibraryInfo *) const { - return nullptr; - } - - - bool verifyReturnAddressArgumentIsConstant(SDValue Op, - SelectionDAG &DAG) const; - - //===--------------------------------------------------------------------===// - // Inline Asm Support hooks - // - - /// This hook allows the target to expand an inline asm call to be explicit - /// llvm code if it wants to. This is useful for turning simple inline asms - /// into LLVM intrinsics, which gives the compiler more information about the - /// behavior of the code. - virtual bool ExpandInlineAsm(CallInst *) const { - return false; - } - - enum ConstraintType { - C_Register, // Constraint represents specific register(s). - C_RegisterClass, // Constraint represents any of register(s) in class. - C_Memory, // Memory constraint. - C_Other, // Something else. - C_Unknown // Unsupported constraint. - }; - - enum ConstraintWeight { - // Generic weights. - CW_Invalid = -1, // No match. - CW_Okay = 0, // Acceptable. - CW_Good = 1, // Good weight. - CW_Better = 2, // Better weight. - CW_Best = 3, // Best weight. - - // Well-known weights. - CW_SpecificReg = CW_Okay, // Specific register operands. - CW_Register = CW_Good, // Register operands. - CW_Memory = CW_Better, // Memory operands. - CW_Constant = CW_Best, // Constant operand. - CW_Default = CW_Okay // Default or don't know type. - }; - - /// This contains information for each constraint that we are lowering. - struct AsmOperandInfo : public InlineAsm::ConstraintInfo { - /// This contains the actual string for the code, like "m". TargetLowering - /// picks the 'best' code from ConstraintInfo::Codes that most closely - /// matches the operand. - std::string ConstraintCode; - - /// Information about the constraint code, e.g. Register, RegisterClass, - /// Memory, Other, Unknown. - TargetLowering::ConstraintType ConstraintType; - - /// If this is the result output operand or a clobber, this is null, - /// otherwise it is the incoming operand to the CallInst. This gets - /// modified as the asm is processed. - Value *CallOperandVal; - - /// The ValueType for the operand value. - MVT ConstraintVT; - - /// Return true of this is an input operand that is a matching constraint - /// like "4". - bool isMatchingInputConstraint() const; - - /// If this is an input matching constraint, this method returns the output - /// operand it matches. - unsigned getMatchedOperand() const; - - /// Copy constructor for copying from a ConstraintInfo. - AsmOperandInfo(InlineAsm::ConstraintInfo Info) - : InlineAsm::ConstraintInfo(std::move(Info)), - ConstraintType(TargetLowering::C_Unknown), CallOperandVal(nullptr), - ConstraintVT(MVT::Other) {} - }; - - typedef std::vector<AsmOperandInfo> AsmOperandInfoVector; - - /// Split up the constraint string from the inline assembly value into the - /// specific constraints and their prefixes, and also tie in the associated - /// operand values. If this returns an empty vector, and if the constraint - /// string itself isn't empty, there was an error parsing. - virtual AsmOperandInfoVector ParseConstraints(const DataLayout &DL, - const TargetRegisterInfo *TRI, - ImmutableCallSite CS) const; - - /// Examine constraint type and operand type and determine a weight value. - /// The operand object must already have been set up with the operand type. - virtual ConstraintWeight getMultipleConstraintMatchWeight( - AsmOperandInfo &info, int maIndex) const; - - /// Examine constraint string and operand type and determine a weight value. - /// The operand object must already have been set up with the operand type. - virtual ConstraintWeight getSingleConstraintMatchWeight( - AsmOperandInfo &info, const char *constraint) const; - - /// Determines the constraint code and constraint type to use for the specific - /// AsmOperandInfo, setting OpInfo.ConstraintCode and OpInfo.ConstraintType. - /// If the actual operand being passed in is available, it can be passed in as - /// Op, otherwise an empty SDValue can be passed. - virtual void ComputeConstraintToUse(AsmOperandInfo &OpInfo, - SDValue Op, - SelectionDAG *DAG = nullptr) const; - - /// Given a constraint, return the type of constraint it is for this target. - virtual ConstraintType getConstraintType(StringRef Constraint) const; - - /// Given a physical register constraint (e.g. {edx}), return the register - /// number and the register class for the register. - /// - /// Given a register class constraint, like 'r', if this corresponds directly - /// to an LLVM register class, return a register of 0 and the register class - /// pointer. - /// - /// This should only be used for C_Register constraints. On error, this - /// returns a register number of 0 and a null register class pointer. - virtual std::pair<unsigned, const TargetRegisterClass *> - getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, - StringRef Constraint, MVT VT) const; - - virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const { - if (ConstraintCode == "i") - return InlineAsm::Constraint_i; - else if (ConstraintCode == "m") - return InlineAsm::Constraint_m; - return InlineAsm::Constraint_Unknown; - } - - /// Try to replace an X constraint, which matches anything, with another that - /// has more specific requirements based on the type of the corresponding - /// operand. This returns null if there is no replacement to make. - virtual const char *LowerXConstraint(EVT ConstraintVT) const; - - /// Lower the specified operand into the Ops vector. If it is invalid, don't - /// add anything to Ops. - virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, - std::vector<SDValue> &Ops, - SelectionDAG &DAG) const; - - //===--------------------------------------------------------------------===// - // Div utility functions - // - SDValue BuildSDIV(SDNode *N, const APInt &Divisor, SelectionDAG &DAG, - bool IsAfterLegalization, - std::vector<SDNode *> *Created) const; - SDValue BuildUDIV(SDNode *N, const APInt &Divisor, SelectionDAG &DAG, - bool IsAfterLegalization, - std::vector<SDNode *> *Created) const; - - /// Targets may override this function to provide custom SDIV lowering for - /// power-of-2 denominators. If the target returns an empty SDValue, LLVM - /// assumes SDIV is expensive and replaces it with a series of other integer - /// operations. - virtual SDValue BuildSDIVPow2(SDNode *N, const APInt &Divisor, - SelectionDAG &DAG, - std::vector<SDNode *> *Created) const; - - /// Indicate whether this target prefers to combine FDIVs with the same - /// divisor. If the transform should never be done, return zero. If the - /// transform should be done, return the minimum number of divisor uses - /// that must exist. - virtual unsigned combineRepeatedFPDivisors() const { - return 0; - } - - /// Hooks for building estimates in place of slower divisions and square - /// roots. - - /// Return a reciprocal square root estimate value for the input operand. - /// The RefinementSteps output is the number of Newton-Raphson refinement - /// iterations required to generate a sufficient (though not necessarily - /// IEEE-754 compliant) estimate for the value type. - /// The boolean UseOneConstNR output is used to select a Newton-Raphson - /// algorithm implementation that uses one constant or two constants. - /// A target may choose to implement its own refinement within this function. - /// If that's true, then return '0' as the number of RefinementSteps to avoid - /// any further refinement of the estimate. - /// An empty SDValue return means no estimate sequence can be created. - virtual SDValue getRsqrtEstimate(SDValue Operand, DAGCombinerInfo &DCI, - unsigned &RefinementSteps, - bool &UseOneConstNR) const { - return SDValue(); - } - - /// Return a reciprocal estimate value for the input operand. - /// The RefinementSteps output is the number of Newton-Raphson refinement - /// iterations required to generate a sufficient (though not necessarily - /// IEEE-754 compliant) estimate for the value type. - /// A target may choose to implement its own refinement within this function. - /// If that's true, then return '0' as the number of RefinementSteps to avoid - /// any further refinement of the estimate. - /// An empty SDValue return means no estimate sequence can be created. - virtual SDValue getRecipEstimate(SDValue Operand, DAGCombinerInfo &DCI, - unsigned &RefinementSteps) const { - return SDValue(); - } - - //===--------------------------------------------------------------------===// - // Legalization utility functions - // - - /// Expand a MUL into two nodes. One that computes the high bits of - /// the result and one that computes the low bits. - /// \param HiLoVT The value type to use for the Lo and Hi nodes. - /// \param LL Low bits of the LHS of the MUL. You can use this parameter - /// if you want to control how low bits are extracted from the LHS. - /// \param LH High bits of the LHS of the MUL. See LL for meaning. - /// \param RL Low bits of the RHS of the MUL. See LL for meaning - /// \param RH High bits of the RHS of the MUL. See LL for meaning. - /// \returns true if the node has been expanded. false if it has not - bool expandMUL(SDNode *N, SDValue &Lo, SDValue &Hi, EVT HiLoVT, - SelectionDAG &DAG, SDValue LL = SDValue(), - SDValue LH = SDValue(), SDValue RL = SDValue(), - SDValue RH = SDValue()) const; - - /// Expand float(f32) to SINT(i64) conversion - /// \param N Node to expand - /// \param Result output after conversion - /// \returns True, if the expansion was successful, false otherwise - bool expandFP_TO_SINT(SDNode *N, SDValue &Result, SelectionDAG &DAG) const; - - //===--------------------------------------------------------------------===// - // Instruction Emitting Hooks - // - - /// This method should be implemented by targets that mark instructions with - /// the 'usesCustomInserter' flag. These instructions are special in various - /// ways, which require special support to insert. The specified MachineInstr - /// is created but not inserted into any basic blocks, and this method is - /// called to expand it into a sequence of instructions, potentially also - /// creating new basic blocks and control flow. - /// As long as the returned basic block is different (i.e., we created a new - /// one), the custom inserter is free to modify the rest of \p MBB. - virtual MachineBasicBlock * - EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const; - - /// This method should be implemented by targets that mark instructions with - /// the 'hasPostISelHook' flag. These instructions must be adjusted after - /// instruction selection by target hooks. e.g. To fill in optional defs for - /// ARM 's' setting instructions. - virtual void - AdjustInstrPostInstrSelection(MachineInstr *MI, SDNode *Node) const; - - /// If this function returns true, SelectionDAGBuilder emits a - /// LOAD_STACK_GUARD node when it is lowering Intrinsic::stackprotector. - virtual bool useLoadStackGuardNode() const { - return false; - } - - /// Lower TLS global address SDNode for target independent emulated TLS model. - virtual SDValue LowerToTLSEmulatedModel(const GlobalAddressSDNode *GA, - SelectionDAG &DAG) const; -}; - -/// Given an LLVM IR type and return type attributes, compute the return value -/// EVTs and flags, and optionally also the offsets, if the return value is -/// being lowered to memory. -void GetReturnInfo(Type *ReturnType, AttributeSet attr, - SmallVectorImpl<ISD::OutputArg> &Outs, - const TargetLowering &TLI, const DataLayout &DL); - -} // end llvm namespace - -#endif diff --git a/gnu/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/gnu/llvm/include/llvm/Target/TargetLoweringObjectFile.h deleted file mode 100644 index cb52698c58b..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetLoweringObjectFile.h +++ /dev/null @@ -1,194 +0,0 @@ -//===-- llvm/Target/TargetLoweringObjectFile.h - Object Info ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements classes used to handle lowerings specific to common -// object file formats. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H -#define LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/IR/Module.h" -#include "llvm/MC/MCObjectFileInfo.h" -#include "llvm/MC/SectionKind.h" - -namespace llvm { - class MachineModuleInfo; - class Mangler; - class MCContext; - class MCExpr; - class MCSection; - class MCSymbol; - class MCSymbolRefExpr; - class MCStreamer; - class MCValue; - class ConstantExpr; - class GlobalValue; - class TargetMachine; - -class TargetLoweringObjectFile : public MCObjectFileInfo { - MCContext *Ctx; - - TargetLoweringObjectFile( - const TargetLoweringObjectFile&) = delete; - void operator=(const TargetLoweringObjectFile&) = delete; - -protected: - bool SupportIndirectSymViaGOTPCRel; - bool SupportGOTPCRelWithOffset; - -public: - MCContext &getContext() const { return *Ctx; } - - TargetLoweringObjectFile() - : MCObjectFileInfo(), Ctx(nullptr), SupportIndirectSymViaGOTPCRel(false), - SupportGOTPCRelWithOffset(true) {} - - virtual ~TargetLoweringObjectFile(); - - /// This method must be called before any actual lowering is done. This - /// specifies the current context for codegen, and gives the lowering - /// implementations a chance to set up their default sections. - virtual void Initialize(MCContext &ctx, const TargetMachine &TM); - - virtual void emitPersonalityValue(MCStreamer &Streamer, const DataLayout &TM, - const MCSymbol *Sym) const; - - /// Emit the module flags that the platform cares about. - virtual void emitModuleFlags(MCStreamer &Streamer, - ArrayRef<Module::ModuleFlagEntry> Flags, - Mangler &Mang, const TargetMachine &TM) const {} - - /// Given a constant with the SectionKind, return a section that it should be - /// placed in. - virtual MCSection *getSectionForConstant(const DataLayout &DL, - SectionKind Kind, - const Constant *C) const; - - /// Classify the specified global variable into a set of target independent - /// categories embodied in SectionKind. - static SectionKind getKindForGlobal(const GlobalValue *GV, - const TargetMachine &TM); - - /// This method computes the appropriate section to emit the specified global - /// variable or function definition. This should not be passed external (or - /// available externally) globals. - MCSection *SectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler &Mang, const TargetMachine &TM) const; - - /// This method computes the appropriate section to emit the specified global - /// variable or function definition. This should not be passed external (or - /// available externally) globals. - MCSection *SectionForGlobal(const GlobalValue *GV, Mangler &Mang, - const TargetMachine &TM) const { - return SectionForGlobal(GV, getKindForGlobal(GV, TM), Mang, TM); - } - - virtual void getNameWithPrefix(SmallVectorImpl<char> &OutName, - const GlobalValue *GV, Mangler &Mang, - const TargetMachine &TM) const; - - virtual MCSection *getSectionForJumpTable(const Function &F, Mangler &Mang, - const TargetMachine &TM) const; - - virtual bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference, - const Function &F) const; - - /// Targets should implement this method to assign a section to globals with - /// an explicit section specfied. The implementation of this method can - /// assume that GV->hasSection() is true. - virtual MCSection * - getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler &Mang, const TargetMachine &TM) const = 0; - - /// Allow the target to completely override section assignment of a global. - virtual const MCSection *getSpecialCasedSectionGlobals(const GlobalValue *GV, - SectionKind Kind, - Mangler &Mang) const { - return nullptr; - } - - /// Return an MCExpr to use for a reference to the specified global variable - /// from exception handling information. - virtual const MCExpr * - getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, - Mangler &Mang, const TargetMachine &TM, - MachineModuleInfo *MMI, MCStreamer &Streamer) const; - - /// Return the MCSymbol for a private symbol with global value name as its - /// base, with the specified suffix. - MCSymbol *getSymbolWithGlobalValueBase(const GlobalValue *GV, - StringRef Suffix, Mangler &Mang, - const TargetMachine &TM) const; - - // The symbol that gets passed to .cfi_personality. - virtual MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, - Mangler &Mang, - const TargetMachine &TM, - MachineModuleInfo *MMI) const; - - const MCExpr * - getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding, - MCStreamer &Streamer) const; - - virtual MCSection *getStaticCtorSection(unsigned Priority, - const MCSymbol *KeySym) const { - return StaticCtorSection; - } - - virtual MCSection *getStaticDtorSection(unsigned Priority, - const MCSymbol *KeySym) const { - return StaticDtorSection; - } - - /// \brief Create a symbol reference to describe the given TLS variable when - /// emitting the address in debug info. - virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const; - - virtual const MCExpr * - getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang, - const TargetMachine &TM) const { - return nullptr; - } - - /// \brief Target supports replacing a data "PC"-relative access to a symbol - /// through another symbol, by accessing the later via a GOT entry instead? - bool supportIndirectSymViaGOTPCRel() const { - return SupportIndirectSymViaGOTPCRel; - } - - /// \brief Target GOT "PC"-relative relocation supports encoding an additional - /// binary expression with an offset? - bool supportGOTPCRelWithOffset() const { - return SupportGOTPCRelWithOffset; - } - - /// \brief Get the target specific PC relative GOT entry relocation - virtual const MCExpr *getIndirectSymViaGOTPCRel(const MCSymbol *Sym, - const MCValue &MV, - int64_t Offset, - MachineModuleInfo *MMI, - MCStreamer &Streamer) const { - return nullptr; - } - - virtual void emitLinkerFlagsForGlobal(raw_ostream &OS, const GlobalValue *GV, - const Mangler &Mang) const {} - -protected: - virtual MCSection *SelectSectionForGlobal(const GlobalValue *GV, - SectionKind Kind, Mangler &Mang, - const TargetMachine &TM) const = 0; -}; - -} // end namespace llvm - -#endif diff --git a/gnu/llvm/include/llvm/Target/TargetOpcodes.def b/gnu/llvm/include/llvm/Target/TargetOpcodes.def deleted file mode 100644 index abab6c7a2a7..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetOpcodes.def +++ /dev/null @@ -1,177 +0,0 @@ -//===-- llvm/Target/TargetOpcodes.def - Target Indep Opcodes ------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the target independent instruction opcodes. -// -//===----------------------------------------------------------------------===// - -// NOTE: NO INCLUDE GUARD DESIRED! - -/// HANDLE_TARGET_OPCODE defines an opcode and its associated enum value. -/// -#ifndef HANDLE_TARGET_OPCODE -#define HANDLE_TARGET_OPCODE(OPC, NUM) -#endif - -/// HANDLE_TARGET_OPCODE_MARKER defines an alternative identifier for an opcode. -/// -#ifndef HANDLE_TARGET_OPCODE_MARKER -#define HANDLE_TARGET_OPCODE_MARKER(IDENT, OPC) -#endif - -/// Every instruction defined here must also appear in Target.td. -/// -HANDLE_TARGET_OPCODE(PHI, 0) -HANDLE_TARGET_OPCODE(INLINEASM, 1) -HANDLE_TARGET_OPCODE(CFI_INSTRUCTION, 2) -HANDLE_TARGET_OPCODE(EH_LABEL, 3) -HANDLE_TARGET_OPCODE(GC_LABEL, 4) - -/// KILL - This instruction is a noop that is used only to adjust the -/// liveness of registers. This can be useful when dealing with -/// sub-registers. -HANDLE_TARGET_OPCODE(KILL, 5) - -/// EXTRACT_SUBREG - This instruction takes two operands: a register -/// that has subregisters, and a subregister index. It returns the -/// extracted subregister value. This is commonly used to implement -/// truncation operations on target architectures which support it. -HANDLE_TARGET_OPCODE(EXTRACT_SUBREG, 6) - -/// INSERT_SUBREG - This instruction takes three operands: a register that -/// has subregisters, a register providing an insert value, and a -/// subregister index. It returns the value of the first register with the -/// value of the second register inserted. The first register is often -/// defined by an IMPLICIT_DEF, because it is commonly used to implement -/// anyext operations on target architectures which support it. -HANDLE_TARGET_OPCODE(INSERT_SUBREG, 7) - -/// IMPLICIT_DEF - This is the MachineInstr-level equivalent of undef. -HANDLE_TARGET_OPCODE(IMPLICIT_DEF, 8) - -/// SUBREG_TO_REG - This instruction is similar to INSERT_SUBREG except that -/// the first operand is an immediate integer constant. This constant is -/// often zero, because it is commonly used to assert that the instruction -/// defining the register implicitly clears the high bits. -HANDLE_TARGET_OPCODE(SUBREG_TO_REG, 9) - -/// COPY_TO_REGCLASS - This instruction is a placeholder for a plain -/// register-to-register copy into a specific register class. This is only -/// used between instruction selection and MachineInstr creation, before -/// virtual registers have been created for all the instructions, and it's -/// only needed in cases where the register classes implied by the -/// instructions are insufficient. It is emitted as a COPY MachineInstr. -HANDLE_TARGET_OPCODE(COPY_TO_REGCLASS, 10) - -/// DBG_VALUE - a mapping of the llvm.dbg.value intrinsic -HANDLE_TARGET_OPCODE(DBG_VALUE, 11) - -/// REG_SEQUENCE - This variadic instruction is used to form a register that -/// represents a consecutive sequence of sub-registers. It's used as a -/// register coalescing / allocation aid and must be eliminated before code -/// emission. -// In SDNode form, the first operand encodes the register class created by -// the REG_SEQUENCE, while each subsequent pair names a vreg + subreg index -// pair. Once it has been lowered to a MachineInstr, the regclass operand -// is no longer present. -/// e.g. v1027 = REG_SEQUENCE v1024, 3, v1025, 4, v1026, 5 -/// After register coalescing references of v1024 should be replace with -/// v1027:3, v1025 with v1027:4, etc. -HANDLE_TARGET_OPCODE(REG_SEQUENCE, 12) - -/// COPY - Target-independent register copy. This instruction can also be -/// used to copy between subregisters of virtual registers. -HANDLE_TARGET_OPCODE(COPY, 13) - -/// BUNDLE - This instruction represents an instruction bundle. Instructions -/// which immediately follow a BUNDLE instruction which are marked with -/// 'InsideBundle' flag are inside the bundle. -HANDLE_TARGET_OPCODE(BUNDLE, 14) - -/// Lifetime markers. -HANDLE_TARGET_OPCODE(LIFETIME_START, 15) -HANDLE_TARGET_OPCODE(LIFETIME_END, 16) - -/// A Stackmap instruction captures the location of live variables at its -/// position in the instruction stream. It is followed by a shadow of bytes -/// that must lie within the function and not contain another stackmap. -HANDLE_TARGET_OPCODE(STACKMAP, 17) - -/// Patchable call instruction - this instruction represents a call to a -/// constant address, followed by a series of NOPs. It is intended to -/// support optimizations for dynamic languages (such as javascript) that -/// rewrite calls to runtimes with more efficient code sequences. -/// This also implies a stack map. -HANDLE_TARGET_OPCODE(PATCHPOINT, 18) - -/// This pseudo-instruction loads the stack guard value. Targets which need -/// to prevent the stack guard value or address from being spilled to the -/// stack should override TargetLowering::emitLoadStackGuardNode and -/// additionally expand this pseudo after register allocation. -HANDLE_TARGET_OPCODE(LOAD_STACK_GUARD, 19) - -/// Call instruction with associated vm state for deoptimization and list -/// of live pointers for relocation by the garbage collector. It is -/// intended to support garbage collection with fully precise relocating -/// collectors and deoptimizations in either the callee or caller. -HANDLE_TARGET_OPCODE(STATEPOINT, 20) - -/// Instruction that records the offset of a local stack allocation passed to -/// llvm.localescape. It has two arguments: the symbol for the label and the -/// frame index of the local stack allocation. -HANDLE_TARGET_OPCODE(LOCAL_ESCAPE, 21) - -/// Loading instruction that may page fault, bundled with associated -/// information on how to handle such a page fault. It is intended to support -/// "zero cost" null checks in managed languages by allowing LLVM to fold -/// comparisons into existing memory operations. -HANDLE_TARGET_OPCODE(FAULTING_LOAD_OP, 22) - -/// Wraps a machine instruction to add patchability constraints. An -/// instruction wrapped in PATCHABLE_OP has to either have a minimum -/// size or be preceded with a nop of that size. The first operand is -/// an immediate denoting the minimum size of the instruction, the -/// second operand is an immediate denoting the opcode of the original -/// instruction. The rest of the operands are the operands of the -/// original instruction. -HANDLE_TARGET_OPCODE(PATCHABLE_OP, 23) - -/// This is a marker instruction which gets translated into a nop sled, useful -/// for inserting instrumentation instructions at runtime. -HANDLE_TARGET_OPCODE(PATCHABLE_FUNCTION_ENTER, 24) - -/// Wraps a return instruction and its operands to enable adding nop sleds -/// either before or after the return. The nop sleds are useful for inserting -/// instrumentation instructions at runtime. -HANDLE_TARGET_OPCODE(PATCHABLE_RET, 25) - -/// The following generic opcodes are not supposed to appear after ISel. -/// This is something we might want to relax, but for now, this is convenient -/// to produce diagnostics. - -/// Generic ADD instruction. This is an integer add. -HANDLE_TARGET_OPCODE(G_ADD, 26) -HANDLE_TARGET_OPCODE_MARKER(PRE_ISEL_GENERIC_OPCODE_START, G_ADD) - -/// Generic Bitwise-OR instruction. -HANDLE_TARGET_OPCODE(G_OR, 27) - -/// Generic BRANCH instruction. This is an unconditional branch. -HANDLE_TARGET_OPCODE(G_BR, 28) - -// TODO: Add more generic opcodes as we move along. - -/// Marker for the end of the generic opcode. -/// This is used to check if an opcode is in the range of the -/// generic opcodes. -HANDLE_TARGET_OPCODE_MARKER(PRE_ISEL_GENERIC_OPCODE_END, G_BR) - -/// BUILTIN_OP_END - This must be the last enum value in this list. -/// The target-specific post-isel opcode values start here. -HANDLE_TARGET_OPCODE_MARKER(GENERIC_OP_END, PRE_ISEL_GENERIC_OPCODE_END) diff --git a/gnu/llvm/include/llvm/Target/TargetOpcodes.h b/gnu/llvm/include/llvm/Target/TargetOpcodes.h deleted file mode 100644 index db37bdb6258..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetOpcodes.h +++ /dev/null @@ -1,139 +0,0 @@ -//===-- llvm/Target/TargetOpcodes.h - Target Indep Opcodes ------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the target independent instruction opcodes. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETOPCODES_H -#define LLVM_TARGET_TARGETOPCODES_H - -namespace llvm { - -/// Invariant opcodes: All instruction sets have these as their low opcodes. -/// -/// Every instruction defined here must also appear in Target.td and the order -/// must be the same as in CodeGenTarget.cpp. -/// -namespace TargetOpcode { -enum { - PHI = 0, - INLINEASM = 1, - CFI_INSTRUCTION = 2, - EH_LABEL = 3, - GC_LABEL = 4, - - /// KILL - This instruction is a noop that is used only to adjust the - /// liveness of registers. This can be useful when dealing with - /// sub-registers. - KILL = 5, - - /// EXTRACT_SUBREG - This instruction takes two operands: a register - /// that has subregisters, and a subregister index. It returns the - /// extracted subregister value. This is commonly used to implement - /// truncation operations on target architectures which support it. - EXTRACT_SUBREG = 6, - - /// INSERT_SUBREG - This instruction takes three operands: a register that - /// has subregisters, a register providing an insert value, and a - /// subregister index. It returns the value of the first register with the - /// value of the second register inserted. The first register is often - /// defined by an IMPLICIT_DEF, because it is commonly used to implement - /// anyext operations on target architectures which support it. - INSERT_SUBREG = 7, - - /// IMPLICIT_DEF - This is the MachineInstr-level equivalent of undef. - IMPLICIT_DEF = 8, - - /// SUBREG_TO_REG - This instruction is similar to INSERT_SUBREG except that - /// the first operand is an immediate integer constant. This constant is - /// often zero, because it is commonly used to assert that the instruction - /// defining the register implicitly clears the high bits. - SUBREG_TO_REG = 9, - - /// COPY_TO_REGCLASS - This instruction is a placeholder for a plain - /// register-to-register copy into a specific register class. This is only - /// used between instruction selection and MachineInstr creation, before - /// virtual registers have been created for all the instructions, and it's - /// only needed in cases where the register classes implied by the - /// instructions are insufficient. It is emitted as a COPY MachineInstr. - COPY_TO_REGCLASS = 10, - - /// DBG_VALUE - a mapping of the llvm.dbg.value intrinsic - DBG_VALUE = 11, - - /// REG_SEQUENCE - This variadic instruction is used to form a register that - /// represents a consecutive sequence of sub-registers. It's used as a - /// register coalescing / allocation aid and must be eliminated before code - /// emission. - // In SDNode form, the first operand encodes the register class created by - // the REG_SEQUENCE, while each subsequent pair names a vreg + subreg index - // pair. Once it has been lowered to a MachineInstr, the regclass operand - // is no longer present. - /// e.g. v1027 = REG_SEQUENCE v1024, 3, v1025, 4, v1026, 5 - /// After register coalescing references of v1024 should be replace with - /// v1027:3, v1025 with v1027:4, etc. - REG_SEQUENCE = 12, - - /// COPY - Target-independent register copy. This instruction can also be - /// used to copy between subregisters of virtual registers. - COPY = 13, - - /// BUNDLE - This instruction represents an instruction bundle. Instructions - /// which immediately follow a BUNDLE instruction which are marked with - /// 'InsideBundle' flag are inside the bundle. - BUNDLE = 14, - - /// Lifetime markers. - LIFETIME_START = 15, - LIFETIME_END = 16, - - /// A Stackmap instruction captures the location of live variables at its - /// position in the instruction stream. It is followed by a shadow of bytes - /// that must lie within the function and not contain another stackmap. - STACKMAP = 17, - - /// Patchable call instruction - this instruction represents a call to a - /// constant address, followed by a series of NOPs. It is intended to - /// support optimizations for dynamic languages (such as javascript) that - /// rewrite calls to runtimes with more efficient code sequences. - /// This also implies a stack map. - PATCHPOINT = 18, - - /// This pseudo-instruction loads the stack guard value. Targets which need - /// to prevent the stack guard value or address from being spilled to the - /// stack should override TargetLowering::emitLoadStackGuardNode and - /// additionally expand this pseudo after register allocation. - LOAD_STACK_GUARD = 19, - - /// Call instruction with associated vm state for deoptimization and list - /// of live pointers for relocation by the garbage collector. It is - /// intended to support garbage collection with fully precise relocating - /// collectors and deoptimizations in either the callee or caller. - STATEPOINT = 20, - - /// Instruction that records the offset of a local stack allocation passed to - /// llvm.localescape. It has two arguments: the symbol for the label and the - /// frame index of the local stack allocation. - LOCAL_ESCAPE = 21, - - /// Loading instruction that may page fault, bundled with associated - /// information on how to handle such a page fault. It is intended to support - /// "zero cost" null checks in managed languages by allowing LLVM to fold - /// comparisons into existing memory operations. - FAULTING_LOAD_OP = 22, - - /// BUILTIN_OP_END - This must be the last enum value in this list. - /// The target-specific post-isel opcode values start here. - GENERIC_OP_END = FAULTING_LOAD_OP, -}; -} // end namespace TargetOpcode -} // end namespace llvm - -#endif diff --git a/gnu/llvm/include/llvm/Target/TargetRegisterInfo.h b/gnu/llvm/include/llvm/Target/TargetRegisterInfo.h deleted file mode 100644 index fccaad4705d..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetRegisterInfo.h +++ /dev/null @@ -1,982 +0,0 @@ -//=== Target/TargetRegisterInfo.h - Target Register Information -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file describes an abstract interface used to get information about a -// target machines register file. This information is used for a variety of -// purposed, especially register allocation. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETREGISTERINFO_H -#define LLVM_TARGET_TARGETREGISTERINFO_H - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/CodeGen/MachineBasicBlock.h" -#include "llvm/CodeGen/MachineValueType.h" -#include "llvm/IR/CallingConv.h" -#include "llvm/MC/MCRegisterInfo.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Printable.h" -#include <cassert> -#include <functional> - -namespace llvm { - -class BitVector; -class MachineFunction; -class RegScavenger; -template<class T> class SmallVectorImpl; -class VirtRegMap; -class raw_ostream; -class LiveRegMatrix; - -/// A bitmask representing the covering of a register with sub-registers. -/// -/// This is typically used to track liveness at sub-register granularity. -/// Lane masks for sub-register indices are similar to register units for -/// physical registers. The individual bits in a lane mask can't be assigned -/// any specific meaning. They can be used to check if two sub-register -/// indices overlap. -/// -/// Iff the target has a register such that: -/// -/// getSubReg(Reg, A) overlaps getSubReg(Reg, B) -/// -/// then: -/// -/// (getSubRegIndexLaneMask(A) & getSubRegIndexLaneMask(B)) != 0 -typedef unsigned LaneBitmask; - -class TargetRegisterClass { -public: - typedef const MCPhysReg* iterator; - typedef const MCPhysReg* const_iterator; - typedef const MVT::SimpleValueType* vt_iterator; - typedef const TargetRegisterClass* const * sc_iterator; - - // Instance variables filled by tablegen, do not use! - const MCRegisterClass *MC; - const vt_iterator VTs; - const uint32_t *SubClassMask; - const uint16_t *SuperRegIndices; - const LaneBitmask LaneMask; - /// Classes with a higher priority value are assigned first by register - /// allocators using a greedy heuristic. The value is in the range [0,63]. - const uint8_t AllocationPriority; - /// Whether the class supports two (or more) disjunct subregister indices. - const bool HasDisjunctSubRegs; - const sc_iterator SuperClasses; - ArrayRef<MCPhysReg> (*OrderFunc)(const MachineFunction&); - - /// Return the register class ID number. - unsigned getID() const { return MC->getID(); } - - /// begin/end - Return all of the registers in this class. - /// - iterator begin() const { return MC->begin(); } - iterator end() const { return MC->end(); } - - /// Return the number of registers in this class. - unsigned getNumRegs() const { return MC->getNumRegs(); } - - /// Return the specified register in the class. - unsigned getRegister(unsigned i) const { - return MC->getRegister(i); - } - - /// Return true if the specified register is included in this register class. - /// This does not include virtual registers. - bool contains(unsigned Reg) const { - return MC->contains(Reg); - } - - /// Return true if both registers are in this class. - bool contains(unsigned Reg1, unsigned Reg2) const { - return MC->contains(Reg1, Reg2); - } - - /// Return the size of the register in bytes, which is also the size - /// of a stack slot allocated to hold a spilled copy of this register. - unsigned getSize() const { return MC->getSize(); } - - /// Return the minimum required alignment for a register of this class. - unsigned getAlignment() const { return MC->getAlignment(); } - - /// Return the cost of copying a value between two registers in this class. - /// A negative number means the register class is very expensive - /// to copy e.g. status flag register classes. - int getCopyCost() const { return MC->getCopyCost(); } - - /// Return true if this register class may be used to create virtual - /// registers. - bool isAllocatable() const { return MC->isAllocatable(); } - - /// Return true if this TargetRegisterClass has the ValueType vt. - bool hasType(MVT vt) const { - for(int i = 0; VTs[i] != MVT::Other; ++i) - if (MVT(VTs[i]) == vt) - return true; - return false; - } - - /// vt_begin / vt_end - Loop over all of the value types that can be - /// represented by values in this register class. - vt_iterator vt_begin() const { - return VTs; - } - - vt_iterator vt_end() const { - vt_iterator I = VTs; - while (*I != MVT::Other) ++I; - return I; - } - - /// Return true if the specified TargetRegisterClass - /// is a proper sub-class of this TargetRegisterClass. - bool hasSubClass(const TargetRegisterClass *RC) const { - return RC != this && hasSubClassEq(RC); - } - - /// Returns true if RC is a sub-class of or equal to this class. - bool hasSubClassEq(const TargetRegisterClass *RC) const { - unsigned ID = RC->getID(); - return (SubClassMask[ID / 32] >> (ID % 32)) & 1; - } - - /// Return true if the specified TargetRegisterClass is a - /// proper super-class of this TargetRegisterClass. - bool hasSuperClass(const TargetRegisterClass *RC) const { - return RC->hasSubClass(this); - } - - /// Returns true if RC is a super-class of or equal to this class. - bool hasSuperClassEq(const TargetRegisterClass *RC) const { - return RC->hasSubClassEq(this); - } - - /// Returns a bit vector of subclasses, including this one. - /// The vector is indexed by class IDs, see hasSubClassEq() above for how to - /// use it. - const uint32_t *getSubClassMask() const { - return SubClassMask; - } - - /// Returns a 0-terminated list of sub-register indices that project some - /// super-register class into this register class. The list has an entry for - /// each Idx such that: - /// - /// There exists SuperRC where: - /// For all Reg in SuperRC: - /// this->contains(Reg:Idx) - /// - const uint16_t *getSuperRegIndices() const { - return SuperRegIndices; - } - - /// Returns a NULL-terminated list of super-classes. The - /// classes are ordered by ID which is also a topological ordering from large - /// to small classes. The list does NOT include the current class. - sc_iterator getSuperClasses() const { - return SuperClasses; - } - - /// Return true if this TargetRegisterClass is a subset - /// class of at least one other TargetRegisterClass. - bool isASubClass() const { - return SuperClasses[0] != nullptr; - } - - /// Returns the preferred order for allocating registers from this register - /// class in MF. The raw order comes directly from the .td file and may - /// include reserved registers that are not allocatable. - /// Register allocators should also make sure to allocate - /// callee-saved registers only after all the volatiles are used. The - /// RegisterClassInfo class provides filtered allocation orders with - /// callee-saved registers moved to the end. - /// - /// The MachineFunction argument can be used to tune the allocatable - /// registers based on the characteristics of the function, subtarget, or - /// other criteria. - /// - /// By default, this method returns all registers in the class. - /// - ArrayRef<MCPhysReg> getRawAllocationOrder(const MachineFunction &MF) const { - return OrderFunc ? OrderFunc(MF) : makeArrayRef(begin(), getNumRegs()); - } - - /// Returns the combination of all lane masks of register in this class. - /// The lane masks of the registers are the combination of all lane masks - /// of their subregisters. - LaneBitmask getLaneMask() const { - return LaneMask; - } -}; - -/// Extra information, not in MCRegisterDesc, about registers. -/// These are used by codegen, not by MC. -struct TargetRegisterInfoDesc { - unsigned CostPerUse; // Extra cost of instructions using register. - bool inAllocatableClass; // Register belongs to an allocatable regclass. -}; - -/// Each TargetRegisterClass has a per register weight, and weight -/// limit which must be less than the limits of its pressure sets. -struct RegClassWeight { - unsigned RegWeight; - unsigned WeightLimit; -}; - -/// TargetRegisterInfo base class - We assume that the target defines a static -/// array of TargetRegisterDesc objects that represent all of the machine -/// registers that the target has. As such, we simply have to track a pointer -/// to this array so that we can turn register number into a register -/// descriptor. -/// -class TargetRegisterInfo : public MCRegisterInfo { -public: - typedef const TargetRegisterClass * const * regclass_iterator; -private: - const TargetRegisterInfoDesc *InfoDesc; // Extra desc array for codegen - const char *const *SubRegIndexNames; // Names of subreg indexes. - // Pointer to array of lane masks, one per sub-reg index. - const LaneBitmask *SubRegIndexLaneMasks; - - regclass_iterator RegClassBegin, RegClassEnd; // List of regclasses - unsigned CoveringLanes; - -protected: - TargetRegisterInfo(const TargetRegisterInfoDesc *ID, - regclass_iterator RegClassBegin, - regclass_iterator RegClassEnd, - const char *const *SRINames, - const LaneBitmask *SRILaneMasks, - unsigned CoveringLanes); - virtual ~TargetRegisterInfo(); -public: - - // Register numbers can represent physical registers, virtual registers, and - // sometimes stack slots. The unsigned values are divided into these ranges: - // - // 0 Not a register, can be used as a sentinel. - // [1;2^30) Physical registers assigned by TableGen. - // [2^30;2^31) Stack slots. (Rarely used.) - // [2^31;2^32) Virtual registers assigned by MachineRegisterInfo. - // - // Further sentinels can be allocated from the small negative integers. - // DenseMapInfo<unsigned> uses -1u and -2u. - - /// isStackSlot - Sometimes it is useful the be able to store a non-negative - /// frame index in a variable that normally holds a register. isStackSlot() - /// returns true if Reg is in the range used for stack slots. - /// - /// Note that isVirtualRegister() and isPhysicalRegister() cannot handle stack - /// slots, so if a variable may contains a stack slot, always check - /// isStackSlot() first. - /// - static bool isStackSlot(unsigned Reg) { - return int(Reg) >= (1 << 30); - } - - /// Compute the frame index from a register value representing a stack slot. - static int stackSlot2Index(unsigned Reg) { - assert(isStackSlot(Reg) && "Not a stack slot"); - return int(Reg - (1u << 30)); - } - - /// Convert a non-negative frame index to a stack slot register value. - static unsigned index2StackSlot(int FI) { - assert(FI >= 0 && "Cannot hold a negative frame index."); - return FI + (1u << 30); - } - - /// Return true if the specified register number is in - /// the physical register namespace. - static bool isPhysicalRegister(unsigned Reg) { - assert(!isStackSlot(Reg) && "Not a register! Check isStackSlot() first."); - return int(Reg) > 0; - } - - /// Return true if the specified register number is in - /// the virtual register namespace. - static bool isVirtualRegister(unsigned Reg) { - assert(!isStackSlot(Reg) && "Not a register! Check isStackSlot() first."); - return int(Reg) < 0; - } - - /// Convert a virtual register number to a 0-based index. - /// The first virtual register in a function will get the index 0. - static unsigned virtReg2Index(unsigned Reg) { - assert(isVirtualRegister(Reg) && "Not a virtual register"); - return Reg & ~(1u << 31); - } - - /// Convert a 0-based index to a virtual register number. - /// This is the inverse operation of VirtReg2IndexFunctor below. - static unsigned index2VirtReg(unsigned Index) { - return Index | (1u << 31); - } - - /// Returns the Register Class of a physical register of the given type, - /// picking the most sub register class of the right type that contains this - /// physreg. - const TargetRegisterClass * - getMinimalPhysRegClass(unsigned Reg, MVT VT = MVT::Other) const; - - /// Return the maximal subclass of the given register class that is - /// allocatable or NULL. - const TargetRegisterClass * - getAllocatableClass(const TargetRegisterClass *RC) const; - - /// Returns a bitset indexed by register number indicating if a register is - /// allocatable or not. If a register class is specified, returns the subset - /// for the class. - BitVector getAllocatableSet(const MachineFunction &MF, - const TargetRegisterClass *RC = nullptr) const; - - /// Return the additional cost of using this register instead - /// of other registers in its class. - unsigned getCostPerUse(unsigned RegNo) const { - return InfoDesc[RegNo].CostPerUse; - } - - /// Return true if the register is in the allocation of any register class. - bool isInAllocatableClass(unsigned RegNo) const { - return InfoDesc[RegNo].inAllocatableClass; - } - - /// Return the human-readable symbolic target-specific - /// name for the specified SubRegIndex. - const char *getSubRegIndexName(unsigned SubIdx) const { - assert(SubIdx && SubIdx < getNumSubRegIndices() && - "This is not a subregister index"); - return SubRegIndexNames[SubIdx-1]; - } - - /// Return a bitmask representing the parts of a register that are covered by - /// SubIdx \see LaneBitmask. - /// - /// SubIdx == 0 is allowed, it has the lane mask ~0u. - LaneBitmask getSubRegIndexLaneMask(unsigned SubIdx) const { - assert(SubIdx < getNumSubRegIndices() && "This is not a subregister index"); - return SubRegIndexLaneMasks[SubIdx]; - } - - /// The lane masks returned by getSubRegIndexLaneMask() above can only be - /// used to determine if sub-registers overlap - they can't be used to - /// determine if a set of sub-registers completely cover another - /// sub-register. - /// - /// The X86 general purpose registers have two lanes corresponding to the - /// sub_8bit and sub_8bit_hi sub-registers. Both sub_32bit and sub_16bit have - /// lane masks '3', but the sub_16bit sub-register doesn't fully cover the - /// sub_32bit sub-register. - /// - /// On the other hand, the ARM NEON lanes fully cover their registers: The - /// dsub_0 sub-register is completely covered by the ssub_0 and ssub_1 lanes. - /// This is related to the CoveredBySubRegs property on register definitions. - /// - /// This function returns a bit mask of lanes that completely cover their - /// sub-registers. More precisely, given: - /// - /// Covering = getCoveringLanes(); - /// MaskA = getSubRegIndexLaneMask(SubA); - /// MaskB = getSubRegIndexLaneMask(SubB); - /// - /// If (MaskA & ~(MaskB & Covering)) == 0, then SubA is completely covered by - /// SubB. - LaneBitmask getCoveringLanes() const { return CoveringLanes; } - - /// Returns true if the two registers are equal or alias each other. - /// The registers may be virtual registers. - bool regsOverlap(unsigned regA, unsigned regB) const { - if (regA == regB) return true; - if (isVirtualRegister(regA) || isVirtualRegister(regB)) - return false; - - // Regunits are numerically ordered. Find a common unit. - MCRegUnitIterator RUA(regA, this); - MCRegUnitIterator RUB(regB, this); - do { - if (*RUA == *RUB) return true; - if (*RUA < *RUB) ++RUA; - else ++RUB; - } while (RUA.isValid() && RUB.isValid()); - return false; - } - - /// Returns true if Reg contains RegUnit. - bool hasRegUnit(unsigned Reg, unsigned RegUnit) const { - for (MCRegUnitIterator Units(Reg, this); Units.isValid(); ++Units) - if (*Units == RegUnit) - return true; - return false; - } - - /// Return a null-terminated list of all of the callee-saved registers on - /// this target. The register should be in the order of desired callee-save - /// stack frame offset. The first register is closest to the incoming stack - /// pointer if stack grows down, and vice versa. - /// - virtual const MCPhysReg* - getCalleeSavedRegs(const MachineFunction *MF) const = 0; - - virtual const MCPhysReg* - getCalleeSavedRegsViaCopy(const MachineFunction *MF) const { - return nullptr; - } - - /// Return a mask of call-preserved registers for the given calling convention - /// on the current function. The mask should include all call-preserved - /// aliases. This is used by the register allocator to determine which - /// registers can be live across a call. - /// - /// The mask is an array containing (TRI::getNumRegs()+31)/32 entries. - /// A set bit indicates that all bits of the corresponding register are - /// preserved across the function call. The bit mask is expected to be - /// sub-register complete, i.e. if A is preserved, so are all its - /// sub-registers. - /// - /// Bits are numbered from the LSB, so the bit for physical register Reg can - /// be found as (Mask[Reg / 32] >> Reg % 32) & 1. - /// - /// A NULL pointer means that no register mask will be used, and call - /// instructions should use implicit-def operands to indicate call clobbered - /// registers. - /// - virtual const uint32_t *getCallPreservedMask(const MachineFunction &MF, - CallingConv::ID) const { - // The default mask clobbers everything. All targets should override. - return nullptr; - } - - /// Return a register mask that clobbers everything. - virtual const uint32_t *getNoPreservedMask() const { - llvm_unreachable("target does not provide no presered mask"); - } - - /// Return all the call-preserved register masks defined for this target. - virtual ArrayRef<const uint32_t *> getRegMasks() const = 0; - virtual ArrayRef<const char *> getRegMaskNames() const = 0; - - /// Returns a bitset indexed by physical register number indicating if a - /// register is a special register that has particular uses and should be - /// considered unavailable at all times, e.g. SP, RA. This is - /// used by register scavenger to determine what registers are free. - virtual BitVector getReservedRegs(const MachineFunction &MF) const = 0; - - /// Prior to adding the live-out mask to a stackmap or patchpoint - /// instruction, provide the target the opportunity to adjust it (mainly to - /// remove pseudo-registers that should be ignored). - virtual void adjustStackMapLiveOutMask(uint32_t *Mask) const { } - - /// Return a super-register of the specified register - /// Reg so its sub-register of index SubIdx is Reg. - unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx, - const TargetRegisterClass *RC) const { - return MCRegisterInfo::getMatchingSuperReg(Reg, SubIdx, RC->MC); - } - - /// Return a subclass of the specified register - /// class A so that each register in it has a sub-register of the - /// specified sub-register index which is in the specified register class B. - /// - /// TableGen will synthesize missing A sub-classes. - virtual const TargetRegisterClass * - getMatchingSuperRegClass(const TargetRegisterClass *A, - const TargetRegisterClass *B, unsigned Idx) const; - - // For a copy-like instruction that defines a register of class DefRC with - // subreg index DefSubReg, reading from another source with class SrcRC and - // subregister SrcSubReg return true if this is a preferrable copy - // instruction or an earlier use should be used. - virtual bool shouldRewriteCopySrc(const TargetRegisterClass *DefRC, - unsigned DefSubReg, - const TargetRegisterClass *SrcRC, - unsigned SrcSubReg) const; - - /// Returns the largest legal sub-class of RC that - /// supports the sub-register index Idx. - /// If no such sub-class exists, return NULL. - /// If all registers in RC already have an Idx sub-register, return RC. - /// - /// TableGen generates a version of this function that is good enough in most - /// cases. Targets can override if they have constraints that TableGen - /// doesn't understand. For example, the x86 sub_8bit sub-register index is - /// supported by the full GR32 register class in 64-bit mode, but only by the - /// GR32_ABCD regiister class in 32-bit mode. - /// - /// TableGen will synthesize missing RC sub-classes. - virtual const TargetRegisterClass * - getSubClassWithSubReg(const TargetRegisterClass *RC, unsigned Idx) const { - assert(Idx == 0 && "Target has no sub-registers"); - return RC; - } - - /// Return the subregister index you get from composing - /// two subregister indices. - /// - /// The special null sub-register index composes as the identity. - /// - /// If R:a:b is the same register as R:c, then composeSubRegIndices(a, b) - /// returns c. Note that composeSubRegIndices does not tell you about illegal - /// compositions. If R does not have a subreg a, or R:a does not have a subreg - /// b, composeSubRegIndices doesn't tell you. - /// - /// The ARM register Q0 has two D subregs dsub_0:D0 and dsub_1:D1. It also has - /// ssub_0:S0 - ssub_3:S3 subregs. - /// If you compose subreg indices dsub_1, ssub_0 you get ssub_2. - /// - unsigned composeSubRegIndices(unsigned a, unsigned b) const { - if (!a) return b; - if (!b) return a; - return composeSubRegIndicesImpl(a, b); - } - - /// Transforms a LaneMask computed for one subregister to the lanemask that - /// would have been computed when composing the subsubregisters with IdxA - /// first. @sa composeSubRegIndices() - LaneBitmask composeSubRegIndexLaneMask(unsigned IdxA, - LaneBitmask Mask) const { - if (!IdxA) - return Mask; - return composeSubRegIndexLaneMaskImpl(IdxA, Mask); - } - - /// Debugging helper: dump register in human readable form to dbgs() stream. - static void dumpReg(unsigned Reg, unsigned SubRegIndex = 0, - const TargetRegisterInfo* TRI = nullptr); - -protected: - /// Overridden by TableGen in targets that have sub-registers. - virtual unsigned composeSubRegIndicesImpl(unsigned, unsigned) const { - llvm_unreachable("Target has no sub-registers"); - } - - /// Overridden by TableGen in targets that have sub-registers. - virtual LaneBitmask - composeSubRegIndexLaneMaskImpl(unsigned, LaneBitmask) const { - llvm_unreachable("Target has no sub-registers"); - } - -public: - /// Find a common super-register class if it exists. - /// - /// Find a register class, SuperRC and two sub-register indices, PreA and - /// PreB, such that: - /// - /// 1. PreA + SubA == PreB + SubB (using composeSubRegIndices()), and - /// - /// 2. For all Reg in SuperRC: Reg:PreA in RCA and Reg:PreB in RCB, and - /// - /// 3. SuperRC->getSize() >= max(RCA->getSize(), RCB->getSize()). - /// - /// SuperRC will be chosen such that no super-class of SuperRC satisfies the - /// requirements, and there is no register class with a smaller spill size - /// that satisfies the requirements. - /// - /// SubA and SubB must not be 0. Use getMatchingSuperRegClass() instead. - /// - /// Either of the PreA and PreB sub-register indices may be returned as 0. In - /// that case, the returned register class will be a sub-class of the - /// corresponding argument register class. - /// - /// The function returns NULL if no register class can be found. - /// - const TargetRegisterClass* - getCommonSuperRegClass(const TargetRegisterClass *RCA, unsigned SubA, - const TargetRegisterClass *RCB, unsigned SubB, - unsigned &PreA, unsigned &PreB) const; - - //===--------------------------------------------------------------------===// - // Register Class Information - // - - /// Register class iterators - /// - regclass_iterator regclass_begin() const { return RegClassBegin; } - regclass_iterator regclass_end() const { return RegClassEnd; } - - unsigned getNumRegClasses() const { - return (unsigned)(regclass_end()-regclass_begin()); - } - - /// Returns the register class associated with the enumeration value. - /// See class MCOperandInfo. - const TargetRegisterClass *getRegClass(unsigned i) const { - assert(i < getNumRegClasses() && "Register Class ID out of range"); - return RegClassBegin[i]; - } - - /// Returns the name of the register class. - const char *getRegClassName(const TargetRegisterClass *Class) const { - return MCRegisterInfo::getRegClassName(Class->MC); - } - - /// Find the largest common subclass of A and B. - /// Return NULL if there is no common subclass. - /// The common subclass should contain - /// simple value type SVT if it is not the Any type. - const TargetRegisterClass * - getCommonSubClass(const TargetRegisterClass *A, - const TargetRegisterClass *B, - const MVT::SimpleValueType SVT = - MVT::SimpleValueType::Any) const; - - /// Returns a TargetRegisterClass used for pointer values. - /// If a target supports multiple different pointer register classes, - /// kind specifies which one is indicated. - virtual const TargetRegisterClass * - getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const { - llvm_unreachable("Target didn't implement getPointerRegClass!"); - } - - /// Returns a legal register class to copy a register in the specified class - /// to or from. If it is possible to copy the register directly without using - /// a cross register class copy, return the specified RC. Returns NULL if it - /// is not possible to copy between two registers of the specified class. - virtual const TargetRegisterClass * - getCrossCopyRegClass(const TargetRegisterClass *RC) const { - return RC; - } - - /// Returns the largest super class of RC that is legal to use in the current - /// sub-target and has the same spill size. - /// The returned register class can be used to create virtual registers which - /// means that all its registers can be copied and spilled. - virtual const TargetRegisterClass * - getLargestLegalSuperClass(const TargetRegisterClass *RC, - const MachineFunction &) const { - /// The default implementation is very conservative and doesn't allow the - /// register allocator to inflate register classes. - return RC; - } - - /// Return the register pressure "high water mark" for the specific register - /// class. The scheduler is in high register pressure mode (for the specific - /// register class) if it goes over the limit. - /// - /// Note: this is the old register pressure model that relies on a manually - /// specified representative register class per value type. - virtual unsigned getRegPressureLimit(const TargetRegisterClass *RC, - MachineFunction &MF) const { - return 0; - } - - /// Return a heuristic for the machine scheduler to compare the profitability - /// of increasing one register pressure set versus another. The scheduler - /// will prefer increasing the register pressure of the set which returns - /// the largest value for this function. - virtual unsigned getRegPressureSetScore(const MachineFunction &MF, - unsigned PSetID) const { - return PSetID; - } - - /// Get the weight in units of pressure for this register class. - virtual const RegClassWeight &getRegClassWeight( - const TargetRegisterClass *RC) const = 0; - - /// Get the weight in units of pressure for this register unit. - virtual unsigned getRegUnitWeight(unsigned RegUnit) const = 0; - - /// Get the number of dimensions of register pressure. - virtual unsigned getNumRegPressureSets() const = 0; - - /// Get the name of this register unit pressure set. - virtual const char *getRegPressureSetName(unsigned Idx) const = 0; - - /// Get the register unit pressure limit for this dimension. - /// This limit must be adjusted dynamically for reserved registers. - virtual unsigned getRegPressureSetLimit(const MachineFunction &MF, - unsigned Idx) const = 0; - - /// Get the dimensions of register pressure impacted by this register class. - /// Returns a -1 terminated array of pressure set IDs. - virtual const int *getRegClassPressureSets( - const TargetRegisterClass *RC) const = 0; - - /// Get the dimensions of register pressure impacted by this register unit. - /// Returns a -1 terminated array of pressure set IDs. - virtual const int *getRegUnitPressureSets(unsigned RegUnit) const = 0; - - /// Get a list of 'hint' registers that the register allocator should try - /// first when allocating a physical register for the virtual register - /// VirtReg. These registers are effectively moved to the front of the - /// allocation order. - /// - /// The Order argument is the allocation order for VirtReg's register class - /// as returned from RegisterClassInfo::getOrder(). The hint registers must - /// come from Order, and they must not be reserved. - /// - /// The default implementation of this function can resolve - /// target-independent hints provided to MRI::setRegAllocationHint with - /// HintType == 0. Targets that override this function should defer to the - /// default implementation if they have no reason to change the allocation - /// order for VirtReg. There may be target-independent hints. - virtual void getRegAllocationHints(unsigned VirtReg, - ArrayRef<MCPhysReg> Order, - SmallVectorImpl<MCPhysReg> &Hints, - const MachineFunction &MF, - const VirtRegMap *VRM = nullptr, - const LiveRegMatrix *Matrix = nullptr) - const; - - /// A callback to allow target a chance to update register allocation hints - /// when a register is "changed" (e.g. coalesced) to another register. - /// e.g. On ARM, some virtual registers should target register pairs, - /// if one of pair is coalesced to another register, the allocation hint of - /// the other half of the pair should be changed to point to the new register. - virtual void updateRegAllocHint(unsigned Reg, unsigned NewReg, - MachineFunction &MF) const { - // Do nothing. - } - - /// Allow the target to reverse allocation order of local live ranges. This - /// will generally allocate shorter local live ranges first. For targets with - /// many registers, this could reduce regalloc compile time by a large - /// factor. It is disabled by default for three reasons: - /// (1) Top-down allocation is simpler and easier to debug for targets that - /// don't benefit from reversing the order. - /// (2) Bottom-up allocation could result in poor evicition decisions on some - /// targets affecting the performance of compiled code. - /// (3) Bottom-up allocation is no longer guaranteed to optimally color. - virtual bool reverseLocalAssignment() const { return false; } - - /// Allow the target to override the cost of using a callee-saved register for - /// the first time. Default value of 0 means we will use a callee-saved - /// register if it is available. - virtual unsigned getCSRFirstUseCost() const { return 0; } - - /// Returns true if the target requires (and can make use of) the register - /// scavenger. - virtual bool requiresRegisterScavenging(const MachineFunction &MF) const { - return false; - } - - /// Returns true if the target wants to use frame pointer based accesses to - /// spill to the scavenger emergency spill slot. - virtual bool useFPForScavengingIndex(const MachineFunction &MF) const { - return true; - } - - /// Returns true if the target requires post PEI scavenging of registers for - /// materializing frame index constants. - virtual bool requiresFrameIndexScavenging(const MachineFunction &MF) const { - return false; - } - - /// Returns true if the target wants the LocalStackAllocation pass to be run - /// and virtual base registers used for more efficient stack access. - virtual bool requiresVirtualBaseRegisters(const MachineFunction &MF) const { - return false; - } - - /// Return true if target has reserved a spill slot in the stack frame of - /// the given function for the specified register. e.g. On x86, if the frame - /// register is required, the first fixed stack object is reserved as its - /// spill slot. This tells PEI not to create a new stack frame - /// object for the given register. It should be called only after - /// determineCalleeSaves(). - virtual bool hasReservedSpillSlot(const MachineFunction &MF, unsigned Reg, - int &FrameIdx) const { - return false; - } - - /// Returns true if the live-ins should be tracked after register allocation. - virtual bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const { - return false; - } - - /// True if the stack can be realigned for the target. - virtual bool canRealignStack(const MachineFunction &MF) const; - - /// True if storage within the function requires the stack pointer to be - /// aligned more than the normal calling convention calls for. - /// This cannot be overriden by the target, but canRealignStack can be - /// overridden. - bool needsStackRealignment(const MachineFunction &MF) const; - - /// Get the offset from the referenced frame index in the instruction, - /// if there is one. - virtual int64_t getFrameIndexInstrOffset(const MachineInstr *MI, - int Idx) const { - return 0; - } - - /// Returns true if the instruction's frame index reference would be better - /// served by a base register other than FP or SP. - /// Used by LocalStackFrameAllocation to determine which frame index - /// references it should create new base registers for. - virtual bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const { - return false; - } - - /// Insert defining instruction(s) for BaseReg to be a pointer to FrameIdx - /// before insertion point I. - virtual void materializeFrameBaseRegister(MachineBasicBlock *MBB, - unsigned BaseReg, int FrameIdx, - int64_t Offset) const { - llvm_unreachable("materializeFrameBaseRegister does not exist on this " - "target"); - } - - /// Resolve a frame index operand of an instruction - /// to reference the indicated base register plus offset instead. - virtual void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg, - int64_t Offset) const { - llvm_unreachable("resolveFrameIndex does not exist on this target"); - } - - /// Determine whether a given base register plus offset immediate is - /// encodable to resolve a frame index. - virtual bool isFrameOffsetLegal(const MachineInstr *MI, unsigned BaseReg, - int64_t Offset) const { - llvm_unreachable("isFrameOffsetLegal does not exist on this target"); - } - - /// Spill the register so it can be used by the register scavenger. - /// Return true if the register was spilled, false otherwise. - /// If this function does not spill the register, the scavenger - /// will instead spill it to the emergency spill slot. - /// - virtual bool saveScavengerRegister(MachineBasicBlock &MBB, - MachineBasicBlock::iterator I, - MachineBasicBlock::iterator &UseMI, - const TargetRegisterClass *RC, - unsigned Reg) const { - return false; - } - - /// This method must be overriden to eliminate abstract frame indices from - /// instructions which may use them. The instruction referenced by the - /// iterator contains an MO_FrameIndex operand which must be eliminated by - /// this method. This method may modify or replace the specified instruction, - /// as long as it keeps the iterator pointing at the finished product. - /// SPAdj is the SP adjustment due to call frame setup instruction. - /// FIOperandNum is the FI operand number. - virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, - int SPAdj, unsigned FIOperandNum, - RegScavenger *RS = nullptr) const = 0; - - //===--------------------------------------------------------------------===// - /// Subtarget Hooks - - /// \brief SrcRC and DstRC will be morphed into NewRC if this returns true. - virtual bool shouldCoalesce(MachineInstr *MI, - const TargetRegisterClass *SrcRC, - unsigned SubReg, - const TargetRegisterClass *DstRC, - unsigned DstSubReg, - const TargetRegisterClass *NewRC) const - { return true; } - - //===--------------------------------------------------------------------===// - /// Debug information queries. - - /// getFrameRegister - This method should return the register used as a base - /// for values allocated in the current stack frame. - virtual unsigned getFrameRegister(const MachineFunction &MF) const = 0; -}; - - -//===----------------------------------------------------------------------===// -// SuperRegClassIterator -//===----------------------------------------------------------------------===// -// -// Iterate over the possible super-registers for a given register class. The -// iterator will visit a list of pairs (Idx, Mask) corresponding to the -// possible classes of super-registers. -// -// Each bit mask will have at least one set bit, and each set bit in Mask -// corresponds to a SuperRC such that: -// -// For all Reg in SuperRC: Reg:Idx is in RC. -// -// The iterator can include (O, RC->getSubClassMask()) as the first entry which -// also satisfies the above requirement, assuming Reg:0 == Reg. -// -class SuperRegClassIterator { - const unsigned RCMaskWords; - unsigned SubReg; - const uint16_t *Idx; - const uint32_t *Mask; - -public: - /// Create a SuperRegClassIterator that visits all the super-register classes - /// of RC. When IncludeSelf is set, also include the (0, sub-classes) entry. - SuperRegClassIterator(const TargetRegisterClass *RC, - const TargetRegisterInfo *TRI, - bool IncludeSelf = false) - : RCMaskWords((TRI->getNumRegClasses() + 31) / 32), - SubReg(0), - Idx(RC->getSuperRegIndices()), - Mask(RC->getSubClassMask()) { - if (!IncludeSelf) - ++*this; - } - - /// Returns true if this iterator is still pointing at a valid entry. - bool isValid() const { return Idx; } - - /// Returns the current sub-register index. - unsigned getSubReg() const { return SubReg; } - - /// Returns the bit mask if register classes that getSubReg() projects into - /// RC. - const uint32_t *getMask() const { return Mask; } - - /// Advance iterator to the next entry. - void operator++() { - assert(isValid() && "Cannot move iterator past end."); - Mask += RCMaskWords; - SubReg = *Idx++; - if (!SubReg) - Idx = nullptr; - } -}; - -// This is useful when building IndexedMaps keyed on virtual registers -struct VirtReg2IndexFunctor : public std::unary_function<unsigned, unsigned> { - unsigned operator()(unsigned Reg) const { - return TargetRegisterInfo::virtReg2Index(Reg); - } -}; - -/// Prints virtual and physical registers with or without a TRI instance. -/// -/// The format is: -/// %noreg - NoRegister -/// %vreg5 - a virtual register. -/// %vreg5:sub_8bit - a virtual register with sub-register index (with TRI). -/// %EAX - a physical register -/// %physreg17 - a physical register when no TRI instance given. -/// -/// Usage: OS << PrintReg(Reg, TRI) << '\n'; -Printable PrintReg(unsigned Reg, const TargetRegisterInfo *TRI = nullptr, - unsigned SubRegIdx = 0); - -/// Create Printable object to print register units on a \ref raw_ostream. -/// -/// Register units are named after their root registers: -/// -/// AL - Single root. -/// FP0~ST7 - Dual roots. -/// -/// Usage: OS << PrintRegUnit(Unit, TRI) << '\n'; -Printable PrintRegUnit(unsigned Unit, const TargetRegisterInfo *TRI); - -/// \brief Create Printable object to print virtual registers and physical -/// registers on a \ref raw_ostream. -Printable PrintVRegOrUnit(unsigned VRegOrUnit, const TargetRegisterInfo *TRI); - -/// Create Printable object to print LaneBitmasks on a \ref raw_ostream. -Printable PrintLaneMask(LaneBitmask LaneMask); - -} // End llvm namespace - -#endif diff --git a/gnu/llvm/include/llvm/Target/TargetSubtargetInfo.h b/gnu/llvm/include/llvm/Target/TargetSubtargetInfo.h deleted file mode 100644 index d50aa4932f8..00000000000 --- a/gnu/llvm/include/llvm/Target/TargetSubtargetInfo.h +++ /dev/null @@ -1,197 +0,0 @@ -//==-- llvm/Target/TargetSubtargetInfo.h - Target Information ----*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file describes the subtarget options of a Target machine. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETSUBTARGETINFO_H -#define LLVM_TARGET_TARGETSUBTARGETINFO_H - -#include "llvm/CodeGen/PBQPRAConstraint.h" -#include "llvm/CodeGen/SchedulerRegistry.h" -#include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/Support/CodeGen.h" - -namespace llvm { - -class DataLayout; -class MachineFunction; -class MachineInstr; -class SDep; -class SUnit; -class TargetFrameLowering; -class TargetInstrInfo; -class TargetLowering; -class TargetRegisterClass; -class TargetRegisterInfo; -class TargetSchedModel; -class TargetSelectionDAGInfo; -struct MachineSchedPolicy; -template <typename T> class SmallVectorImpl; - -//===----------------------------------------------------------------------===// -/// -/// TargetSubtargetInfo - Generic base class for all target subtargets. All -/// Target-specific options that control code generation and printing should -/// be exposed through a TargetSubtargetInfo-derived class. -/// -class TargetSubtargetInfo : public MCSubtargetInfo { - TargetSubtargetInfo(const TargetSubtargetInfo &) = delete; - void operator=(const TargetSubtargetInfo &) = delete; - TargetSubtargetInfo() = delete; - -protected: // Can only create subclasses... - TargetSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS, - ArrayRef<SubtargetFeatureKV> PF, - ArrayRef<SubtargetFeatureKV> PD, - const SubtargetInfoKV *ProcSched, - const MCWriteProcResEntry *WPR, - const MCWriteLatencyEntry *WL, - const MCReadAdvanceEntry *RA, const InstrStage *IS, - const unsigned *OC, const unsigned *FP); - -public: - // AntiDepBreakMode - Type of anti-dependence breaking that should - // be performed before post-RA scheduling. - typedef enum { ANTIDEP_NONE, ANTIDEP_CRITICAL, ANTIDEP_ALL } AntiDepBreakMode; - typedef SmallVectorImpl<const TargetRegisterClass *> RegClassVector; - - virtual ~TargetSubtargetInfo(); - - // Interfaces to the major aspects of target machine information: - // - // -- Instruction opcode and operand information - // -- Pipelines and scheduling information - // -- Stack frame information - // -- Selection DAG lowering information - // - // N.B. These objects may change during compilation. It's not safe to cache - // them between functions. - virtual const TargetInstrInfo *getInstrInfo() const { return nullptr; } - virtual const TargetFrameLowering *getFrameLowering() const { - return nullptr; - } - virtual const TargetLowering *getTargetLowering() const { return nullptr; } - virtual const TargetSelectionDAGInfo *getSelectionDAGInfo() const { - return nullptr; - } - /// Target can subclass this hook to select a different DAG scheduler. - virtual RegisterScheduler::FunctionPassCtor - getDAGScheduler(CodeGenOpt::Level) const { - return nullptr; - } - - /// getRegisterInfo - If register information is available, return it. If - /// not, return null. This is kept separate from RegInfo until RegInfo has - /// details of graph coloring register allocation removed from it. - /// - virtual const TargetRegisterInfo *getRegisterInfo() const { return nullptr; } - - /// getInstrItineraryData - Returns instruction itinerary data for the target - /// or specific subtarget. - /// - virtual const InstrItineraryData *getInstrItineraryData() const { - return nullptr; - } - - /// Resolve a SchedClass at runtime, where SchedClass identifies an - /// MCSchedClassDesc with the isVariant property. This may return the ID of - /// another variant SchedClass, but repeated invocation must quickly terminate - /// in a nonvariant SchedClass. - virtual unsigned resolveSchedClass(unsigned SchedClass, - const MachineInstr *MI, - const TargetSchedModel *SchedModel) const { - return 0; - } - - /// \brief True if the subtarget should run MachineScheduler after aggressive - /// coalescing. - /// - /// This currently replaces the SelectionDAG scheduler with the "source" order - /// scheduler (though see below for an option to turn this off and use the - /// TargetLowering preference). It does not yet disable the postRA scheduler. - virtual bool enableMachineScheduler() const; - - /// \brief True if the machine scheduler should disable the TLI preference - /// for preRA scheduling with the source level scheduler. - virtual bool enableMachineSchedDefaultSched() const { return true; } - - /// \brief True if the subtarget should enable joining global copies. - /// - /// By default this is enabled if the machine scheduler is enabled, but - /// can be overridden. - virtual bool enableJoinGlobalCopies() const; - - /// True if the subtarget should run a scheduler after register allocation. - /// - /// By default this queries the PostRAScheduling bit in the scheduling model - /// which is the preferred way to influence this. - virtual bool enablePostRAScheduler() const; - - /// \brief True if the subtarget should run the atomic expansion pass. - virtual bool enableAtomicExpand() const; - - /// \brief Override generic scheduling policy within a region. - /// - /// This is a convenient way for targets that don't provide any custom - /// scheduling heuristics (no custom MachineSchedStrategy) to make - /// changes to the generic scheduling policy. - virtual void overrideSchedPolicy(MachineSchedPolicy &Policy, - MachineInstr *begin, MachineInstr *end, - unsigned NumRegionInstrs) const {} - - // \brief Perform target specific adjustments to the latency of a schedule - // dependency. - virtual void adjustSchedDependency(SUnit *def, SUnit *use, SDep &dep) const {} - - // For use with PostRAScheduling: get the anti-dependence breaking that should - // be performed before post-RA scheduling. - virtual AntiDepBreakMode getAntiDepBreakMode() const { return ANTIDEP_NONE; } - - // For use with PostRAScheduling: in CriticalPathRCs, return any register - // classes that should only be considered for anti-dependence breaking if they - // are on the critical path. - virtual void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const { - return CriticalPathRCs.clear(); - } - - // For use with PostRAScheduling: get the minimum optimization level needed - // to enable post-RA scheduling. - virtual CodeGenOpt::Level getOptLevelToEnablePostRAScheduler() const { - return CodeGenOpt::Default; - } - - /// \brief True if the subtarget should run the local reassignment - /// heuristic of the register allocator. - /// This heuristic may be compile time intensive, \p OptLevel provides - /// a finer grain to tune the register allocator. - virtual bool enableRALocalReassignment(CodeGenOpt::Level OptLevel) const; - - /// \brief Enable use of alias analysis during code generation (during MI - /// scheduling, DAGCombine, etc.). - virtual bool useAA() const; - - /// \brief Enable the use of the early if conversion pass. - virtual bool enableEarlyIfConversion() const { return false; } - - /// \brief Return PBQPConstraint(s) for the target. - /// - /// Override to provide custom PBQP constraints. - virtual std::unique_ptr<PBQPRAConstraint> getCustomPBQPConstraints() const { - return nullptr; - } - - /// Enable tracking of subregister liveness in register allocator. - virtual bool enableSubRegLiveness() const { return false; } -}; - -} // End llvm namespace - -#endif diff --git a/gnu/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h b/gnu/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h deleted file mode 100644 index 73c15e42c35..00000000000 --- a/gnu/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h +++ /dev/null @@ -1,65 +0,0 @@ -//===-- CmpInstAnalysis.h - Utils to help fold compare insts ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file holds routines to help analyse compare instructions -// and fold them into constants or other compare instructions -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TRANSFORMS_UTILS_CMPINSTANALYSIS_H -#define LLVM_TRANSFORMS_UTILS_CMPINSTANALYSIS_H - -#include "llvm/IR/InstrTypes.h" - -namespace llvm { - class ICmpInst; - class Value; - - /// getICmpCode - Encode a icmp predicate into a three bit mask. These bits - /// are carefully arranged to allow folding of expressions such as: - /// - /// (A < B) | (A > B) --> (A != B) - /// - /// Note that this is only valid if the first and second predicates have the - /// same sign. Is illegal to do: (A u< B) | (A s> B) - /// - /// Three bits are used to represent the condition, as follows: - /// 0 A > B - /// 1 A == B - /// 2 A < B - /// - /// <=> Value Definition - /// 000 0 Always false - /// 001 1 A > B - /// 010 2 A == B - /// 011 3 A >= B - /// 100 4 A < B - /// 101 5 A != B - /// 110 6 A <= B - /// 111 7 Always true - /// - unsigned getICmpCode(const ICmpInst *ICI, bool InvertPred = false); - - /// getICmpValue - This is the complement of getICmpCode, which turns an - /// opcode and two operands into either a constant true or false, or the - /// predicate for a new ICmp instruction. The sign is passed in to determine - /// which kind of predicate to use in the new icmp instruction. - /// Non-NULL return value will be a true or false constant. - /// NULL return means a new ICmp is needed. The predicate for which is - /// output in NewICmpPred. - Value *getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS, - CmpInst::Predicate &NewICmpPred); - - /// PredicatesFoldable - Return true if both predicates match sign or if at - /// least one of them is an equality comparison (which is signless). - bool PredicatesFoldable(CmpInst::Predicate p1, CmpInst::Predicate p2); - -} // end namespace llvm - -#endif diff --git a/gnu/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/gnu/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp deleted file mode 100644 index e979ba2531e..00000000000 --- a/gnu/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//===- OptimizationDiagnosticInfo.cpp - Optimization Diagnostic -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Optimization diagnostic interfaces. It's packaged as an analysis pass so -// that by using this service passes become dependent on BFI as well. BFI is -// used to compute the "hotness" of the diagnostic message. -//===----------------------------------------------------------------------===// - -#include "llvm/Analysis/OptimizationDiagnosticInfo.h" -#include "llvm/Analysis/LazyBlockFrequencyInfo.h" -#include "llvm/Analysis/LoopInfo.h" -#include "llvm/IR/DiagnosticInfo.h" -#include "llvm/IR/LLVMContext.h" - -using namespace llvm; - -Optional<uint64_t> OptimizationRemarkEmitter::computeHotness(Value *V) { - if (!BFI) - return None; - - return BFI->getBlockProfileCount(cast<BasicBlock>(V)); -} - -void OptimizationRemarkEmitter::emitOptimizationRemarkMissed( - const char *PassName, const DebugLoc &DLoc, Value *V, const Twine &Msg) { - LLVMContext &Ctx = F->getContext(); - Ctx.diagnose(DiagnosticInfoOptimizationRemarkMissed(PassName, *F, DLoc, Msg, - computeHotness(V))); -} - -void OptimizationRemarkEmitter::emitOptimizationRemarkMissed( - const char *PassName, Loop *L, const Twine &Msg) { - emitOptimizationRemarkMissed(PassName, L->getStartLoc(), L->getHeader(), Msg); -} - -OptimizationRemarkEmitterWrapperPass::OptimizationRemarkEmitterWrapperPass() - : FunctionPass(ID) { - initializeOptimizationRemarkEmitterWrapperPassPass( - *PassRegistry::getPassRegistry()); -} - -bool OptimizationRemarkEmitterWrapperPass::runOnFunction(Function &Fn) { - BlockFrequencyInfo *BFI; - - if (Fn.getContext().getDiagnosticHotnessRequested()) - BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI(); - else - BFI = nullptr; - - ORE = llvm::make_unique<OptimizationRemarkEmitter>(&Fn, BFI); - return false; -} - -void OptimizationRemarkEmitterWrapperPass::getAnalysisUsage( - AnalysisUsage &AU) const { - LazyBlockFrequencyInfoPass::getLazyBFIAnalysisUsage(AU); - AU.setPreservesAll(); -} - -char OptimizationRemarkEmitterAnalysis::PassID; - -OptimizationRemarkEmitter -OptimizationRemarkEmitterAnalysis::run(Function &F, AnalysisManager<Function> &AM) { - BlockFrequencyInfo *BFI; - - if (F.getContext().getDiagnosticHotnessRequested()) - BFI = &AM.getResult<BlockFrequencyAnalysis>(F); - else - BFI = nullptr; - - return OptimizationRemarkEmitter(&F, BFI); -} - -char OptimizationRemarkEmitterWrapperPass::ID = 0; -static const char ore_name[] = "Optimization Remark Emitter"; -#define ORE_NAME "opt-remark-emitter" - -INITIALIZE_PASS_BEGIN(OptimizationRemarkEmitterWrapperPass, ORE_NAME, ore_name, - false, true) -INITIALIZE_PASS_DEPENDENCY(LazyBFIPass) -INITIALIZE_PASS_END(OptimizationRemarkEmitterWrapperPass, ORE_NAME, ore_name, - false, true) diff --git a/gnu/llvm/lib/Analysis/SparsePropagation.cpp b/gnu/llvm/lib/Analysis/SparsePropagation.cpp deleted file mode 100644 index f5a927b8052..00000000000 --- a/gnu/llvm/lib/Analysis/SparsePropagation.cpp +++ /dev/null @@ -1,347 +0,0 @@ -//===- SparsePropagation.cpp - Sparse Conditional Property Propagation ----===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements an abstract sparse conditional propagation algorithm, -// modeled after SCCP, but with a customizable lattice function. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Analysis/SparsePropagation.h" -#include "llvm/IR/Constants.h" -#include "llvm/IR/Function.h" -#include "llvm/IR/Instructions.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/raw_ostream.h" -using namespace llvm; - -#define DEBUG_TYPE "sparseprop" - -//===----------------------------------------------------------------------===// -// AbstractLatticeFunction Implementation -//===----------------------------------------------------------------------===// - -AbstractLatticeFunction::~AbstractLatticeFunction() {} - -/// PrintValue - Render the specified lattice value to the specified stream. -void AbstractLatticeFunction::PrintValue(LatticeVal V, raw_ostream &OS) { - if (V == UndefVal) - OS << "undefined"; - else if (V == OverdefinedVal) - OS << "overdefined"; - else if (V == UntrackedVal) - OS << "untracked"; - else - OS << "unknown lattice value"; -} - -//===----------------------------------------------------------------------===// -// SparseSolver Implementation -//===----------------------------------------------------------------------===// - -/// getOrInitValueState - Return the LatticeVal object that corresponds to the -/// value, initializing the value's state if it hasn't been entered into the -/// map yet. This function is necessary because not all values should start -/// out in the underdefined state... Arguments should be overdefined, and -/// constants should be marked as constants. -/// -SparseSolver::LatticeVal SparseSolver::getOrInitValueState(Value *V) { - DenseMap<Value*, LatticeVal>::iterator I = ValueState.find(V); - if (I != ValueState.end()) return I->second; // Common case, in the map - - LatticeVal LV; - if (LatticeFunc->IsUntrackedValue(V)) - return LatticeFunc->getUntrackedVal(); - else if (Constant *C = dyn_cast<Constant>(V)) - LV = LatticeFunc->ComputeConstant(C); - else if (Argument *A = dyn_cast<Argument>(V)) - LV = LatticeFunc->ComputeArgument(A); - else if (!isa<Instruction>(V)) - // All other non-instructions are overdefined. - LV = LatticeFunc->getOverdefinedVal(); - else - // All instructions are underdefined by default. - LV = LatticeFunc->getUndefVal(); - - // If this value is untracked, don't add it to the map. - if (LV == LatticeFunc->getUntrackedVal()) - return LV; - return ValueState[V] = LV; -} - -/// UpdateState - When the state for some instruction is potentially updated, -/// this function notices and adds I to the worklist if needed. -void SparseSolver::UpdateState(Instruction &Inst, LatticeVal V) { - DenseMap<Value*, LatticeVal>::iterator I = ValueState.find(&Inst); - if (I != ValueState.end() && I->second == V) - return; // No change. - - // An update. Visit uses of I. - ValueState[&Inst] = V; - InstWorkList.push_back(&Inst); -} - -/// MarkBlockExecutable - This method can be used by clients to mark all of -/// the blocks that are known to be intrinsically live in the processed unit. -void SparseSolver::MarkBlockExecutable(BasicBlock *BB) { - DEBUG(dbgs() << "Marking Block Executable: " << BB->getName() << "\n"); - BBExecutable.insert(BB); // Basic block is executable! - BBWorkList.push_back(BB); // Add the block to the work list! -} - -/// markEdgeExecutable - Mark a basic block as executable, adding it to the BB -/// work list if it is not already executable... -void SparseSolver::markEdgeExecutable(BasicBlock *Source, BasicBlock *Dest) { - if (!KnownFeasibleEdges.insert(Edge(Source, Dest)).second) - return; // This edge is already known to be executable! - - DEBUG(dbgs() << "Marking Edge Executable: " << Source->getName() - << " -> " << Dest->getName() << "\n"); - - if (BBExecutable.count(Dest)) { - // The destination is already executable, but we just made an edge - // feasible that wasn't before. Revisit the PHI nodes in the block - // because they have potentially new operands. - for (BasicBlock::iterator I = Dest->begin(); isa<PHINode>(I); ++I) - visitPHINode(*cast<PHINode>(I)); - - } else { - MarkBlockExecutable(Dest); - } -} - - -/// getFeasibleSuccessors - Return a vector of booleans to indicate which -/// successors are reachable from a given terminator instruction. -void SparseSolver::getFeasibleSuccessors(TerminatorInst &TI, - SmallVectorImpl<bool> &Succs, - bool AggressiveUndef) { - Succs.resize(TI.getNumSuccessors()); - if (TI.getNumSuccessors() == 0) return; - - if (BranchInst *BI = dyn_cast<BranchInst>(&TI)) { - if (BI->isUnconditional()) { - Succs[0] = true; - return; - } - - LatticeVal BCValue; - if (AggressiveUndef) - BCValue = getOrInitValueState(BI->getCondition()); - else - BCValue = getLatticeState(BI->getCondition()); - - if (BCValue == LatticeFunc->getOverdefinedVal() || - BCValue == LatticeFunc->getUntrackedVal()) { - // Overdefined condition variables can branch either way. - Succs[0] = Succs[1] = true; - return; - } - - // If undefined, neither is feasible yet. - if (BCValue == LatticeFunc->getUndefVal()) - return; - - Constant *C = LatticeFunc->GetConstant(BCValue, BI->getCondition(), *this); - if (!C || !isa<ConstantInt>(C)) { - // Non-constant values can go either way. - Succs[0] = Succs[1] = true; - return; - } - - // Constant condition variables mean the branch can only go a single way - Succs[C->isNullValue()] = true; - return; - } - - if (isa<InvokeInst>(TI)) { - // Invoke instructions successors are always executable. - // TODO: Could ask the lattice function if the value can throw. - Succs[0] = Succs[1] = true; - return; - } - - if (isa<IndirectBrInst>(TI)) { - Succs.assign(Succs.size(), true); - return; - } - - SwitchInst &SI = cast<SwitchInst>(TI); - LatticeVal SCValue; - if (AggressiveUndef) - SCValue = getOrInitValueState(SI.getCondition()); - else - SCValue = getLatticeState(SI.getCondition()); - - if (SCValue == LatticeFunc->getOverdefinedVal() || - SCValue == LatticeFunc->getUntrackedVal()) { - // All destinations are executable! - Succs.assign(TI.getNumSuccessors(), true); - return; - } - - // If undefined, neither is feasible yet. - if (SCValue == LatticeFunc->getUndefVal()) - return; - - Constant *C = LatticeFunc->GetConstant(SCValue, SI.getCondition(), *this); - if (!C || !isa<ConstantInt>(C)) { - // All destinations are executable! - Succs.assign(TI.getNumSuccessors(), true); - return; - } - SwitchInst::CaseIt Case = SI.findCaseValue(cast<ConstantInt>(C)); - Succs[Case.getSuccessorIndex()] = true; -} - - -/// isEdgeFeasible - Return true if the control flow edge from the 'From' -/// basic block to the 'To' basic block is currently feasible... -bool SparseSolver::isEdgeFeasible(BasicBlock *From, BasicBlock *To, - bool AggressiveUndef) { - SmallVector<bool, 16> SuccFeasible; - TerminatorInst *TI = From->getTerminator(); - getFeasibleSuccessors(*TI, SuccFeasible, AggressiveUndef); - - for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) - if (TI->getSuccessor(i) == To && SuccFeasible[i]) - return true; - - return false; -} - -void SparseSolver::visitTerminatorInst(TerminatorInst &TI) { - SmallVector<bool, 16> SuccFeasible; - getFeasibleSuccessors(TI, SuccFeasible, true); - - BasicBlock *BB = TI.getParent(); - - // Mark all feasible successors executable... - for (unsigned i = 0, e = SuccFeasible.size(); i != e; ++i) - if (SuccFeasible[i]) - markEdgeExecutable(BB, TI.getSuccessor(i)); -} - -void SparseSolver::visitPHINode(PHINode &PN) { - // The lattice function may store more information on a PHINode than could be - // computed from its incoming values. For example, SSI form stores its sigma - // functions as PHINodes with a single incoming value. - if (LatticeFunc->IsSpecialCasedPHI(&PN)) { - LatticeVal IV = LatticeFunc->ComputeInstructionState(PN, *this); - if (IV != LatticeFunc->getUntrackedVal()) - UpdateState(PN, IV); - return; - } - - LatticeVal PNIV = getOrInitValueState(&PN); - LatticeVal Overdefined = LatticeFunc->getOverdefinedVal(); - - // If this value is already overdefined (common) just return. - if (PNIV == Overdefined || PNIV == LatticeFunc->getUntrackedVal()) - return; // Quick exit - - // Super-extra-high-degree PHI nodes are unlikely to ever be interesting, - // and slow us down a lot. Just mark them overdefined. - if (PN.getNumIncomingValues() > 64) { - UpdateState(PN, Overdefined); - return; - } - - // Look at all of the executable operands of the PHI node. If any of them - // are overdefined, the PHI becomes overdefined as well. Otherwise, ask the - // transfer function to give us the merge of the incoming values. - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { - // If the edge is not yet known to be feasible, it doesn't impact the PHI. - if (!isEdgeFeasible(PN.getIncomingBlock(i), PN.getParent(), true)) - continue; - - // Merge in this value. - LatticeVal OpVal = getOrInitValueState(PN.getIncomingValue(i)); - if (OpVal != PNIV) - PNIV = LatticeFunc->MergeValues(PNIV, OpVal); - - if (PNIV == Overdefined) - break; // Rest of input values don't matter. - } - - // Update the PHI with the compute value, which is the merge of the inputs. - UpdateState(PN, PNIV); -} - - -void SparseSolver::visitInst(Instruction &I) { - // PHIs are handled by the propagation logic, they are never passed into the - // transfer functions. - if (PHINode *PN = dyn_cast<PHINode>(&I)) - return visitPHINode(*PN); - - // Otherwise, ask the transfer function what the result is. If this is - // something that we care about, remember it. - LatticeVal IV = LatticeFunc->ComputeInstructionState(I, *this); - if (IV != LatticeFunc->getUntrackedVal()) - UpdateState(I, IV); - - if (TerminatorInst *TI = dyn_cast<TerminatorInst>(&I)) - visitTerminatorInst(*TI); -} - -void SparseSolver::Solve(Function &F) { - MarkBlockExecutable(&F.getEntryBlock()); - - // Process the work lists until they are empty! - while (!BBWorkList.empty() || !InstWorkList.empty()) { - // Process the instruction work list. - while (!InstWorkList.empty()) { - Instruction *I = InstWorkList.back(); - InstWorkList.pop_back(); - - DEBUG(dbgs() << "\nPopped off I-WL: " << *I << "\n"); - - // "I" got into the work list because it made a transition. See if any - // users are both live and in need of updating. - for (User *U : I->users()) { - Instruction *UI = cast<Instruction>(U); - if (BBExecutable.count(UI->getParent())) // Inst is executable? - visitInst(*UI); - } - } - - // Process the basic block work list. - while (!BBWorkList.empty()) { - BasicBlock *BB = BBWorkList.back(); - BBWorkList.pop_back(); - - DEBUG(dbgs() << "\nPopped off BBWL: " << *BB); - - // Notify all instructions in this basic block that they are newly - // executable. - for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) - visitInst(*I); - } - } -} - -void SparseSolver::Print(Function &F, raw_ostream &OS) const { - OS << "\nFUNCTION: " << F.getName() << "\n"; - for (auto &BB : F) { - if (!BBExecutable.count(&BB)) - OS << "INFEASIBLE: "; - OS << "\t"; - if (BB.hasName()) - OS << BB.getName() << ":\n"; - else - OS << "; anon bb\n"; - for (auto &I : BB) { - LatticeFunc->PrintValue(getLatticeState(&I), OS); - OS << I << "\n"; - } - - OS << "\n"; - } -} - diff --git a/gnu/llvm/lib/CodeGen/BranchCoalescing.cpp b/gnu/llvm/lib/CodeGen/BranchCoalescing.cpp deleted file mode 100644 index 2c41b597843..00000000000 --- a/gnu/llvm/lib/CodeGen/BranchCoalescing.cpp +++ /dev/null @@ -1,758 +0,0 @@ -//===-- CoalesceBranches.cpp - Coalesce blocks with the same condition ---===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// Coalesce basic blocks guarded by the same branch condition into a single -/// basic block. -/// -//===----------------------------------------------------------------------===// - -#include "llvm/ADT/BitVector.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/CodeGen/MachineDominators.h" -#include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/CodeGen/MachinePostDominators.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/Passes.h" -#include "llvm/Support/Debug.h" -#include "llvm/Target/TargetFrameLowering.h" -#include "llvm/Target/TargetInstrInfo.h" -#include "llvm/Target/TargetSubtargetInfo.h" - -using namespace llvm; - -#define DEBUG_TYPE "branch-coalescing" - -static cl::opt<cl::boolOrDefault> - EnableBranchCoalescing("enable-branch-coalesce", cl::Hidden, - cl::desc("enable coalescing of duplicate branches")); - -STATISTIC(NumBlocksCoalesced, "Number of blocks coalesced"); -STATISTIC(NumPHINotMoved, "Number of PHI Nodes that cannot be merged"); -STATISTIC(NumBlocksNotCoalesced, "Number of blocks not coalesced"); - -//===----------------------------------------------------------------------===// -// BranchCoalescing -//===----------------------------------------------------------------------===// -/// -/// Improve scheduling by coalescing branches that depend on the same condition. -/// This pass looks for blocks that are guarded by the same branch condition -/// and attempts to merge the blocks together. Such opportunities arise from -/// the expansion of select statements in the IR. -/// -/// For example, consider the following LLVM IR: -/// -/// %test = icmp eq i32 %x 0 -/// %tmp1 = select i1 %test, double %a, double 2.000000e-03 -/// %tmp2 = select i1 %test, double %b, double 5.000000e-03 -/// -/// This IR expands to the following machine code on PowerPC: -/// -/// BB#0: derived from LLVM BB %entry -/// Live Ins: %F1 %F3 %X6 -/// <SNIP1> -/// %vreg0<def> = COPY %F1; F8RC:%vreg0 -/// %vreg5<def> = CMPLWI %vreg4<kill>, 0; CRRC:%vreg5 GPRC:%vreg4 -/// %vreg8<def> = LXSDX %ZERO8, %vreg7<kill>, %RM<imp-use>; -/// mem:LD8[ConstantPool] F8RC:%vreg8 G8RC:%vreg7 -/// BCC 76, %vreg5, <BB#2>; CRRC:%vreg5 -/// Successors according to CFG: BB#1(?%) BB#2(?%) -/// -/// BB#1: derived from LLVM BB %entry -/// Predecessors according to CFG: BB#0 -/// Successors according to CFG: BB#2(?%) -/// -/// BB#2: derived from LLVM BB %entry -/// Predecessors according to CFG: BB#0 BB#1 -/// %vreg9<def> = PHI %vreg8, <BB#1>, %vreg0, <BB#0>; -/// F8RC:%vreg9,%vreg8,%vreg0 -/// <SNIP2> -/// BCC 76, %vreg5, <BB#4>; CRRC:%vreg5 -/// Successors according to CFG: BB#3(?%) BB#4(?%) -/// -/// BB#3: derived from LLVM BB %entry -/// Predecessors according to CFG: BB#2 -/// Successors according to CFG: BB#4(?%) -/// -/// BB#4: derived from LLVM BB %entry -/// Predecessors according to CFG: BB#2 BB#3 -/// %vreg13<def> = PHI %vreg12, <BB#3>, %vreg2, <BB#2>; -/// F8RC:%vreg13,%vreg12,%vreg2 -/// <SNIP3> -/// BLR8 %LR8<imp-use>, %RM<imp-use>, %F1<imp-use> -/// -/// When this pattern is detected, branch coalescing will try to collapse -/// it by moving code in BB#2 to BB#0 and/or BB#4 and removing BB#3. -/// -/// If all conditions are meet, IR should collapse to: -/// -/// BB#0: derived from LLVM BB %entry -/// Live Ins: %F1 %F3 %X6 -/// <SNIP1> -/// %vreg0<def> = COPY %F1; F8RC:%vreg0 -/// %vreg5<def> = CMPLWI %vreg4<kill>, 0; CRRC:%vreg5 GPRC:%vreg4 -/// %vreg8<def> = LXSDX %ZERO8, %vreg7<kill>, %RM<imp-use>; -/// mem:LD8[ConstantPool] F8RC:%vreg8 G8RC:%vreg7 -/// <SNIP2> -/// BCC 76, %vreg5, <BB#4>; CRRC:%vreg5 -/// Successors according to CFG: BB#1(0x2aaaaaaa / 0x80000000 = 33.33%) -/// BB#4(0x55555554 / 0x80000000 = 66.67%) -/// -/// BB#1: derived from LLVM BB %entry -/// Predecessors according to CFG: BB#0 -/// Successors according to CFG: BB#4(0x40000000 / 0x80000000 = 50.00%) -/// -/// BB#4: derived from LLVM BB %entry -/// Predecessors according to CFG: BB#0 BB#1 -/// %vreg9<def> = PHI %vreg8, <BB#1>, %vreg0, <BB#0>; -/// F8RC:%vreg9,%vreg8,%vreg0 -/// %vreg13<def> = PHI %vreg12, <BB#1>, %vreg2, <BB#0>; -/// F8RC:%vreg13,%vreg12,%vreg2 -/// <SNIP3> -/// BLR8 %LR8<imp-use>, %RM<imp-use>, %F1<imp-use> -/// -/// Branch Coalescing does not split blocks, it moves everything in the same -/// direction ensuring it does not break use/definition semantics. -/// -/// PHI nodes and its corresponding use instructions are moved to its successor -/// block if there are no uses within the successor block PHI nodes. PHI -/// node ordering cannot be assumed. -/// -/// Non-PHI can be moved up to the predecessor basic block or down to the -/// successor basic block following any PHI instructions. Whether it moves -/// up or down depends on whether the register(s) defined in the instructions -/// are used in current block or in any PHI instructions at the beginning of -/// the successor block. - -namespace { - -class BranchCoalescing : public MachineFunctionPass { - struct CoalescingCandidateInfo { - MachineBasicBlock *BranchBlock; // Block containing the branch - MachineBasicBlock *BranchTargetBlock; // Block branched to - MachineBasicBlock *FallThroughBlock; // Fall-through if branch not taken - SmallVector<MachineOperand, 4> Cond; - bool MustMoveDown; - bool MustMoveUp; - - CoalescingCandidateInfo(); - void clear(); - }; - - MachineDominatorTree *MDT; - MachinePostDominatorTree *MPDT; - const TargetInstrInfo *TII; - MachineRegisterInfo *MRI; - - void initialize(MachineFunction &F); - bool canCoalesceBranch(CoalescingCandidateInfo &Cand); - bool identicalOperands(ArrayRef<MachineOperand> OperandList1, - ArrayRef<MachineOperand> OperandList2) const; - bool validateCandidates(CoalescingCandidateInfo &SourceRegion, - CoalescingCandidateInfo &TargetRegion) const; - - static bool isBranchCoalescingEnabled() { - return EnableBranchCoalescing == cl::BOU_TRUE; - } - -public: - static char ID; - - BranchCoalescing() : MachineFunctionPass(ID) { - initializeBranchCoalescingPass(*PassRegistry::getPassRegistry()); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.addRequired<MachineDominatorTree>(); - AU.addRequired<MachinePostDominatorTree>(); - MachineFunctionPass::getAnalysisUsage(AU); - } - - StringRef getPassName() const override { return "Branch Coalescing"; } - - bool mergeCandidates(CoalescingCandidateInfo &SourceRegion, - CoalescingCandidateInfo &TargetRegion); - bool canMoveToBeginning(const MachineInstr &MI, - const MachineBasicBlock &MBB) const; - bool canMoveToEnd(const MachineInstr &MI, - const MachineBasicBlock &MBB) const; - bool canMerge(CoalescingCandidateInfo &SourceRegion, - CoalescingCandidateInfo &TargetRegion) const; - void moveAndUpdatePHIs(MachineBasicBlock *SourceRegionMBB, - MachineBasicBlock *TargetRegionMBB); - bool runOnMachineFunction(MachineFunction &MF) override; -}; -} // End anonymous namespace. - -char BranchCoalescing::ID = 0; -char &llvm::BranchCoalescingID = BranchCoalescing::ID; - -INITIALIZE_PASS_BEGIN(BranchCoalescing, DEBUG_TYPE, - "Branch Coalescing", false, false) -INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree) -INITIALIZE_PASS_DEPENDENCY(MachinePostDominatorTree) -INITIALIZE_PASS_END(BranchCoalescing, DEBUG_TYPE, "Branch Coalescing", - false, false) - -BranchCoalescing::CoalescingCandidateInfo::CoalescingCandidateInfo() - : BranchBlock(nullptr), BranchTargetBlock(nullptr), - FallThroughBlock(nullptr), MustMoveDown(false), MustMoveUp(false) {} - -void BranchCoalescing::CoalescingCandidateInfo::clear() { - BranchBlock = nullptr; - BranchTargetBlock = nullptr; - FallThroughBlock = nullptr; - Cond.clear(); - MustMoveDown = false; - MustMoveUp = false; -} - -void BranchCoalescing::initialize(MachineFunction &MF) { - MDT = &getAnalysis<MachineDominatorTree>(); - MPDT = &getAnalysis<MachinePostDominatorTree>(); - TII = MF.getSubtarget().getInstrInfo(); - MRI = &MF.getRegInfo(); -} - -/// -/// Analyze the branch statement to determine if it can be coalesced. This -/// method analyses the branch statement for the given candidate to determine -/// if it can be coalesced. If the branch can be coalesced, then the -/// BranchTargetBlock and the FallThroughBlock are recorded in the specified -/// Candidate. -/// -///\param[in,out] Cand The coalescing candidate to analyze -///\return true if and only if the branch can be coalesced, false otherwise -/// -bool BranchCoalescing::canCoalesceBranch(CoalescingCandidateInfo &Cand) { - DEBUG(dbgs() << "Determine if branch block " << Cand.BranchBlock->getNumber() - << " can be coalesced:"); - MachineBasicBlock *FalseMBB = nullptr; - - if (TII->analyzeBranch(*Cand.BranchBlock, Cand.BranchTargetBlock, FalseMBB, - Cand.Cond)) { - DEBUG(dbgs() << "TII unable to Analyze Branch - skip\n"); - return false; - } - - for (auto &I : Cand.BranchBlock->terminators()) { - DEBUG(dbgs() << "Looking at terminator : " << I << "\n"); - if (!I.isBranch()) - continue; - - if (I.getNumOperands() != I.getNumExplicitOperands()) { - DEBUG(dbgs() << "Terminator contains implicit operands - skip : " << I - << "\n"); - return false; - } - } - - if (Cand.BranchBlock->isEHPad() || Cand.BranchBlock->hasEHPadSuccessor()) { - DEBUG(dbgs() << "EH Pad - skip\n"); - return false; - } - - // For now only consider triangles (i.e, BranchTargetBlock is set, - // FalseMBB is null, and BranchTargetBlock is a successor to BranchBlock) - if (!Cand.BranchTargetBlock || FalseMBB || - !Cand.BranchBlock->isSuccessor(Cand.BranchTargetBlock)) { - DEBUG(dbgs() << "Does not form a triangle - skip\n"); - return false; - } - - // Ensure there are only two successors - if (Cand.BranchBlock->succ_size() != 2) { - DEBUG(dbgs() << "Does not have 2 successors - skip\n"); - return false; - } - - // Sanity check - the block must be able to fall through - assert(Cand.BranchBlock->canFallThrough() && - "Expecting the block to fall through!"); - - // We have already ensured there are exactly two successors to - // BranchBlock and that BranchTargetBlock is a successor to BranchBlock. - // Ensure the single fall though block is empty. - MachineBasicBlock *Succ = - (*Cand.BranchBlock->succ_begin() == Cand.BranchTargetBlock) - ? *Cand.BranchBlock->succ_rbegin() - : *Cand.BranchBlock->succ_begin(); - - assert(Succ && "Expecting a valid fall-through block\n"); - - if (!Succ->empty()) { - DEBUG(dbgs() << "Fall-through block contains code -- skip\n"); - return false; - } - - if (!Succ->isSuccessor(Cand.BranchTargetBlock)) { - DEBUG(dbgs() - << "Successor of fall through block is not branch taken block\n"); - return false; - } - - Cand.FallThroughBlock = Succ; - DEBUG(dbgs() << "Valid Candidate\n"); - return true; -} - -/// -/// Determine if the two operand lists are identical -/// -/// \param[in] OpList1 operand list -/// \param[in] OpList2 operand list -/// \return true if and only if the operands lists are identical -/// -bool BranchCoalescing::identicalOperands( - ArrayRef<MachineOperand> OpList1, ArrayRef<MachineOperand> OpList2) const { - - if (OpList1.size() != OpList2.size()) { - DEBUG(dbgs() << "Operand list is different size\n"); - return false; - } - - for (unsigned i = 0; i < OpList1.size(); ++i) { - const MachineOperand &Op1 = OpList1[i]; - const MachineOperand &Op2 = OpList2[i]; - - DEBUG(dbgs() << "Op1: " << Op1 << "\n" - << "Op2: " << Op2 << "\n"); - - if (Op1.isIdenticalTo(Op2)) { - DEBUG(dbgs() << "Op1 and Op2 are identical!\n"); - continue; - } - - // If the operands are not identical, but are registers, check to see if the - // definition of the register produces the same value. If they produce the - // same value, consider them to be identical. - if (Op1.isReg() && Op2.isReg() && - TargetRegisterInfo::isVirtualRegister(Op1.getReg()) && - TargetRegisterInfo::isVirtualRegister(Op2.getReg())) { - MachineInstr *Op1Def = MRI->getVRegDef(Op1.getReg()); - MachineInstr *Op2Def = MRI->getVRegDef(Op2.getReg()); - if (TII->produceSameValue(*Op1Def, *Op2Def, MRI)) { - DEBUG(dbgs() << "Op1Def: " << *Op1Def << " and " << *Op2Def - << " produce the same value!\n"); - } else { - DEBUG(dbgs() << "Operands produce different values\n"); - return false; - } - } else { - DEBUG(dbgs() << "The operands are not provably identical.\n"); - return false; - } - } - return true; -} - -/// -/// Moves ALL PHI instructions in SourceMBB to beginning of TargetMBB -/// and update them to refer to the new block. PHI node ordering -/// cannot be assumed so it does not matter where the PHI instructions -/// are moved to in TargetMBB. -/// -/// \param[in] SourceMBB block to move PHI instructions from -/// \param[in] TargetMBB block to move PHI instructions to -/// -void BranchCoalescing::moveAndUpdatePHIs(MachineBasicBlock *SourceMBB, - MachineBasicBlock *TargetMBB) { - - MachineBasicBlock::iterator MI = SourceMBB->begin(); - MachineBasicBlock::iterator ME = SourceMBB->getFirstNonPHI(); - - if (MI == ME) { - DEBUG(dbgs() << "SourceMBB contains no PHI instructions.\n"); - return; - } - - // Update all PHI instructions in SourceMBB and move to top of TargetMBB - for (MachineBasicBlock::iterator Iter = MI; Iter != ME; Iter++) { - MachineInstr &PHIInst = *Iter; - for (unsigned i = 2, e = PHIInst.getNumOperands() + 1; i != e; i += 2) { - MachineOperand &MO = PHIInst.getOperand(i); - if (MO.getMBB() == SourceMBB) - MO.setMBB(TargetMBB); - } - } - TargetMBB->splice(TargetMBB->begin(), SourceMBB, MI, ME); -} - -/// -/// This function checks if MI can be moved to the beginning of the TargetMBB -/// following PHI instructions. A MI instruction can be moved to beginning of -/// the TargetMBB if there are no uses of it within the TargetMBB PHI nodes. -/// -/// \param[in] MI the machine instruction to move. -/// \param[in] TargetMBB the machine basic block to move to -/// \return true if it is safe to move MI to beginning of TargetMBB, -/// false otherwise. -/// -bool BranchCoalescing::canMoveToBeginning(const MachineInstr &MI, - const MachineBasicBlock &TargetMBB - ) const { - - DEBUG(dbgs() << "Checking if " << MI << " can move to beginning of " - << TargetMBB.getNumber() << "\n"); - - for (auto &Def : MI.defs()) { // Looking at Def - for (auto &Use : MRI->use_instructions(Def.getReg())) { - if (Use.isPHI() && Use.getParent() == &TargetMBB) { - DEBUG(dbgs() << " *** used in a PHI -- cannot move ***\n"); - return false; - } - } - } - - DEBUG(dbgs() << " Safe to move to the beginning.\n"); - return true; -} - -/// -/// This function checks if MI can be moved to the end of the TargetMBB, -/// immediately before the first terminator. A MI instruction can be moved -/// to then end of the TargetMBB if no PHI node defines what MI uses within -/// it's own MBB. -/// -/// \param[in] MI the machine instruction to move. -/// \param[in] TargetMBB the machine basic block to move to -/// \return true if it is safe to move MI to end of TargetMBB, -/// false otherwise. -/// -bool BranchCoalescing::canMoveToEnd(const MachineInstr &MI, - const MachineBasicBlock &TargetMBB - ) const { - - DEBUG(dbgs() << "Checking if " << MI << " can move to end of " - << TargetMBB.getNumber() << "\n"); - - for (auto &Use : MI.uses()) { - if (Use.isReg() && TargetRegisterInfo::isVirtualRegister(Use.getReg())) { - MachineInstr *DefInst = MRI->getVRegDef(Use.getReg()); - if (DefInst->isPHI() && DefInst->getParent() == MI.getParent()) { - DEBUG(dbgs() << " *** Cannot move this instruction ***\n"); - return false; - } else { - DEBUG(dbgs() << " *** def is in another block -- safe to move!\n"); - } - } - } - - DEBUG(dbgs() << " Safe to move to the end.\n"); - return true; -} - -/// -/// This method checks to ensure the two coalescing candidates follows the -/// expected pattern required for coalescing. -/// -/// \param[in] SourceRegion The candidate to move statements from -/// \param[in] TargetRegion The candidate to move statements to -/// \return true if all instructions in SourceRegion.BranchBlock can be merged -/// into a block in TargetRegion; false otherwise. -/// -bool BranchCoalescing::validateCandidates( - CoalescingCandidateInfo &SourceRegion, - CoalescingCandidateInfo &TargetRegion) const { - - if (TargetRegion.BranchTargetBlock != SourceRegion.BranchBlock) - llvm_unreachable("Expecting SourceRegion to immediately follow TargetRegion"); - else if (!MDT->dominates(TargetRegion.BranchBlock, SourceRegion.BranchBlock)) - llvm_unreachable("Expecting TargetRegion to dominate SourceRegion"); - else if (!MPDT->dominates(SourceRegion.BranchBlock, TargetRegion.BranchBlock)) - llvm_unreachable("Expecting SourceRegion to post-dominate TargetRegion"); - else if (!TargetRegion.FallThroughBlock->empty() || - !SourceRegion.FallThroughBlock->empty()) - llvm_unreachable("Expecting fall-through blocks to be empty"); - - return true; -} - -/// -/// This method determines whether the two coalescing candidates can be merged. -/// In order to be merged, all instructions must be able to -/// 1. Move to the beginning of the SourceRegion.BranchTargetBlock; -/// 2. Move to the end of the TargetRegion.BranchBlock. -/// Merging involves moving the instructions in the -/// TargetRegion.BranchTargetBlock (also SourceRegion.BranchBlock). -/// -/// This function first try to move instructions from the -/// TargetRegion.BranchTargetBlock down, to the beginning of the -/// SourceRegion.BranchTargetBlock. This is not possible if any register defined -/// in TargetRegion.BranchTargetBlock is used in a PHI node in the -/// SourceRegion.BranchTargetBlock. In this case, check whether the statement -/// can be moved up, to the end of the TargetRegion.BranchBlock (immediately -/// before the branch statement). If it cannot move, then these blocks cannot -/// be merged. -/// -/// Note that there is no analysis for moving instructions past the fall-through -/// blocks because they are confirmed to be empty. An assert is thrown if they -/// are not. -/// -/// \param[in] SourceRegion The candidate to move statements from -/// \param[in] TargetRegion The candidate to move statements to -/// \return true if all instructions in SourceRegion.BranchBlock can be merged -/// into a block in TargetRegion, false otherwise. -/// -bool BranchCoalescing::canMerge(CoalescingCandidateInfo &SourceRegion, - CoalescingCandidateInfo &TargetRegion) const { - if (!validateCandidates(SourceRegion, TargetRegion)) - return false; - - // Walk through PHI nodes first and see if they force the merge into the - // SourceRegion.BranchTargetBlock. - for (MachineBasicBlock::iterator - I = SourceRegion.BranchBlock->instr_begin(), - E = SourceRegion.BranchBlock->getFirstNonPHI(); - I != E; ++I) { - for (auto &Def : I->defs()) - for (auto &Use : MRI->use_instructions(Def.getReg())) { - if (Use.isPHI() && Use.getParent() == SourceRegion.BranchTargetBlock) { - DEBUG(dbgs() << "PHI " << *I << " defines register used in another " - "PHI within branch target block -- can't merge\n"); - NumPHINotMoved++; - return false; - } - if (Use.getParent() == SourceRegion.BranchBlock) { - DEBUG(dbgs() << "PHI " << *I - << " defines register used in this " - "block -- all must move down\n"); - SourceRegion.MustMoveDown = true; - } - } - } - - // Walk through the MI to see if they should be merged into - // TargetRegion.BranchBlock (up) or SourceRegion.BranchTargetBlock (down) - for (MachineBasicBlock::iterator - I = SourceRegion.BranchBlock->getFirstNonPHI(), - E = SourceRegion.BranchBlock->end(); - I != E; ++I) { - if (!canMoveToBeginning(*I, *SourceRegion.BranchTargetBlock)) { - DEBUG(dbgs() << "Instruction " << *I - << " cannot move down - must move up!\n"); - SourceRegion.MustMoveUp = true; - } - if (!canMoveToEnd(*I, *TargetRegion.BranchBlock)) { - DEBUG(dbgs() << "Instruction " << *I - << " cannot move up - must move down!\n"); - SourceRegion.MustMoveDown = true; - } - } - - return (SourceRegion.MustMoveUp && SourceRegion.MustMoveDown) ? false : true; -} - -/// Merge the instructions from SourceRegion.BranchBlock, -/// SourceRegion.BranchTargetBlock, and SourceRegion.FallThroughBlock into -/// TargetRegion.BranchBlock, TargetRegion.BranchTargetBlock and -/// TargetRegion.FallThroughBlock respectively. -/// -/// The successors for blocks in TargetRegion will be updated to use the -/// successors from blocks in SourceRegion. Finally, the blocks in SourceRegion -/// will be removed from the function. -/// -/// A region consists of a BranchBlock, a FallThroughBlock, and a -/// BranchTargetBlock. Branch coalesce works on patterns where the -/// TargetRegion's BranchTargetBlock must also be the SourceRegions's -/// BranchBlock. -/// -/// Before mergeCandidates: -/// -/// +---------------------------+ -/// | TargetRegion.BranchBlock | -/// +---------------------------+ -/// / | -/// / +--------------------------------+ -/// | | TargetRegion.FallThroughBlock | -/// \ +--------------------------------+ -/// \ | -/// +----------------------------------+ -/// | TargetRegion.BranchTargetBlock | -/// | SourceRegion.BranchBlock | -/// +----------------------------------+ -/// / | -/// / +--------------------------------+ -/// | | SourceRegion.FallThroughBlock | -/// \ +--------------------------------+ -/// \ | -/// +----------------------------------+ -/// | SourceRegion.BranchTargetBlock | -/// +----------------------------------+ -/// -/// After mergeCandidates: -/// -/// +-----------------------------+ -/// | TargetRegion.BranchBlock | -/// | SourceRegion.BranchBlock | -/// +-----------------------------+ -/// / | -/// / +---------------------------------+ -/// | | TargetRegion.FallThroughBlock | -/// | | SourceRegion.FallThroughBlock | -/// \ +---------------------------------+ -/// \ | -/// +----------------------------------+ -/// | SourceRegion.BranchTargetBlock | -/// +----------------------------------+ -/// -/// \param[in] SourceRegion The candidate to move blocks from -/// \param[in] TargetRegion The candidate to move blocks to -/// -bool BranchCoalescing::mergeCandidates(CoalescingCandidateInfo &SourceRegion, - CoalescingCandidateInfo &TargetRegion) { - - if (SourceRegion.MustMoveUp && SourceRegion.MustMoveDown) { - llvm_unreachable("Cannot have both MustMoveDown and MustMoveUp set!"); - return false; - } - - if (!validateCandidates(SourceRegion, TargetRegion)) - return false; - - // Start the merging process by first handling the BranchBlock. - // Move any PHIs in SourceRegion.BranchBlock down to the branch-taken block - moveAndUpdatePHIs(SourceRegion.BranchBlock, SourceRegion.BranchTargetBlock); - - // Move remaining instructions in SourceRegion.BranchBlock into - // TargetRegion.BranchBlock - MachineBasicBlock::iterator firstInstr = - SourceRegion.BranchBlock->getFirstNonPHI(); - MachineBasicBlock::iterator lastInstr = - SourceRegion.BranchBlock->getFirstTerminator(); - - MachineBasicBlock *Source = SourceRegion.MustMoveDown - ? SourceRegion.BranchTargetBlock - : TargetRegion.BranchBlock; - - MachineBasicBlock::iterator Target = - SourceRegion.MustMoveDown - ? SourceRegion.BranchTargetBlock->getFirstNonPHI() - : TargetRegion.BranchBlock->getFirstTerminator(); - - Source->splice(Target, SourceRegion.BranchBlock, firstInstr, lastInstr); - - // Once PHI and instructions have been moved we need to clean up the - // control flow. - - // Remove SourceRegion.FallThroughBlock before transferring successors of - // SourceRegion.BranchBlock to TargetRegion.BranchBlock. - SourceRegion.BranchBlock->removeSuccessor(SourceRegion.FallThroughBlock); - TargetRegion.BranchBlock->transferSuccessorsAndUpdatePHIs( - SourceRegion.BranchBlock); - // Update branch in TargetRegion.BranchBlock to jump to - // SourceRegion.BranchTargetBlock - // In this case, TargetRegion.BranchTargetBlock == SourceRegion.BranchBlock. - TargetRegion.BranchBlock->ReplaceUsesOfBlockWith( - SourceRegion.BranchBlock, SourceRegion.BranchTargetBlock); - // Remove the branch statement(s) in SourceRegion.BranchBlock - MachineBasicBlock::iterator I = - SourceRegion.BranchBlock->terminators().begin(); - while (I != SourceRegion.BranchBlock->terminators().end()) { - MachineInstr &CurrInst = *I; - ++I; - if (CurrInst.isBranch()) - CurrInst.eraseFromParent(); - } - - // Fall-through block should be empty since this is part of the condition - // to coalesce the branches. - assert(TargetRegion.FallThroughBlock->empty() && - "FallThroughBlocks should be empty!"); - - // Transfer successor information and move PHIs down to the - // branch-taken block. - TargetRegion.FallThroughBlock->transferSuccessorsAndUpdatePHIs( - SourceRegion.FallThroughBlock); - TargetRegion.FallThroughBlock->removeSuccessor(SourceRegion.BranchBlock); - - // Remove the blocks from the function. - assert(SourceRegion.BranchBlock->empty() && - "Expecting branch block to be empty!"); - SourceRegion.BranchBlock->eraseFromParent(); - - assert(SourceRegion.FallThroughBlock->empty() && - "Expecting fall-through block to be empty!\n"); - SourceRegion.FallThroughBlock->eraseFromParent(); - - NumBlocksCoalesced++; - return true; -} - -bool BranchCoalescing::runOnMachineFunction(MachineFunction &MF) { - - if (skipFunction(*MF.getFunction()) || MF.empty() || - !isBranchCoalescingEnabled()) - return false; - - bool didSomething = false; - - DEBUG(dbgs() << "******** Branch Coalescing ********\n"); - initialize(MF); - - DEBUG(dbgs() << "Function: "; MF.dump(); dbgs() << "\n"); - - CoalescingCandidateInfo Cand1, Cand2; - // Walk over blocks and find candidates to merge - // Continue trying to merge with the first candidate found, as long as merging - // is successfull. - for (MachineBasicBlock &MBB : MF) { - bool MergedCandidates = false; - do { - MergedCandidates = false; - Cand1.clear(); - Cand2.clear(); - - Cand1.BranchBlock = &MBB; - - // If unable to coalesce the branch, then continue to next block - if (!canCoalesceBranch(Cand1)) - break; - - Cand2.BranchBlock = Cand1.BranchTargetBlock; - if (!canCoalesceBranch(Cand2)) - break; - - // Sanity check - // The branch-taken block of the second candidate should post-dominate the - // first candidate - assert(MPDT->dominates(Cand2.BranchTargetBlock, Cand1.BranchBlock) && - "Branch-taken block should post-dominate first candidate"); - - if (!identicalOperands(Cand1.Cond, Cand2.Cond)) { - DEBUG(dbgs() << "Blocks " << Cand1.BranchBlock->getNumber() << " and " - << Cand2.BranchBlock->getNumber() - << " have different branches\n"); - break; - } - if (!canMerge(Cand2, Cand1)) { - DEBUG(dbgs() << "Cannot merge blocks " << Cand1.BranchBlock->getNumber() - << " and " << Cand2.BranchBlock->getNumber() << "\n"); - NumBlocksNotCoalesced++; - continue; - } - DEBUG(dbgs() << "Merging blocks " << Cand1.BranchBlock->getNumber() - << " and " << Cand1.BranchTargetBlock->getNumber() << "\n"); - MergedCandidates = mergeCandidates(Cand2, Cand1); - if (MergedCandidates) - didSomething = true; - - DEBUG(dbgs() << "Function after merging: "; MF.dump(); dbgs() << "\n"); - } while (MergedCandidates); - } - -#ifndef NDEBUG - // Verify MF is still valid after branch coalescing - if (didSomething) - MF.verify(nullptr, "Error in code produced by branch coalescing"); -#endif // NDEBUG - - DEBUG(dbgs() << "Finished Branch Coalescing\n"); - return didSomething; -} diff --git a/gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp b/gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp deleted file mode 100644 index 1e46a7a99e7..00000000000 --- a/gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===- CountingFunctionInserter.cpp - Insert mcount-like function calls ---===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Insert calls to counter functions, such as mcount, intended to be called -// once per function, at the beginning of each function. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Analysis/GlobalsModRef.h" -#include "llvm/CodeGen/Passes.h" -#include "llvm/IR/Function.h" -#include "llvm/IR/Instructions.h" -#include "llvm/IR/Module.h" -#include "llvm/IR/Type.h" -#include "llvm/Pass.h" -using namespace llvm; - -namespace { - struct CountingFunctionInserter : public FunctionPass { - static char ID; // Pass identification, replacement for typeid - CountingFunctionInserter() : FunctionPass(ID) { - initializeCountingFunctionInserterPass(*PassRegistry::getPassRegistry()); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.addPreserved<GlobalsAAWrapperPass>(); - } - - bool runOnFunction(Function &F) override { - std::string CountingFunctionName = - F.getFnAttribute("counting-function").getValueAsString(); - if (CountingFunctionName.empty()) - return false; - - Type *VoidTy = Type::getVoidTy(F.getContext()); - Constant *CountingFn = - F.getParent()->getOrInsertFunction(CountingFunctionName, - VoidTy, nullptr); - CallInst::Create(CountingFn, "", &*F.begin()->getFirstInsertionPt()); - return true; - } - }; - - char CountingFunctionInserter::ID = 0; -} - -INITIALIZE_PASS(CountingFunctionInserter, "cfinserter", - "Inserts calls to mcount-like functions", false, false) - -//===----------------------------------------------------------------------===// -// -// CountingFunctionInserter - Give any unnamed non-void instructions "tmp" names. -// -FunctionPass *llvm::createCountingFunctionInserterPass() { - return new CountingFunctionInserter(); -} diff --git a/gnu/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/gnu/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp deleted file mode 100644 index a506e0571c0..00000000000 --- a/gnu/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ /dev/null @@ -1,1461 +0,0 @@ -//===-- LiveIntervalAnalysis.cpp - Live Interval Analysis -----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the LiveInterval analysis pass which is used -// by the Linear Scan Register allocator. This pass linearizes the -// basic blocks of the function in DFS order and uses the -// LiveVariables pass to conservatively compute live intervals for -// each virtual and physical register. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CodeGen/LiveIntervalAnalysis.h" -#include "LiveRangeCalc.h" -#include "llvm/ADT/DenseSet.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/CodeGen/LiveVariables.h" -#include "llvm/CodeGen/MachineBlockFrequencyInfo.h" -#include "llvm/CodeGen/MachineDominators.h" -#include "llvm/CodeGen/MachineInstr.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/Passes.h" -#include "llvm/CodeGen/VirtRegMap.h" -#include "llvm/IR/Value.h" -#include "llvm/Support/BlockFrequency.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Target/TargetInstrInfo.h" -#include "llvm/Target/TargetRegisterInfo.h" -#include "llvm/Target/TargetSubtargetInfo.h" -#include <algorithm> -#include <cmath> -#include <limits> -using namespace llvm; - -#define DEBUG_TYPE "regalloc" - -char LiveIntervals::ID = 0; -char &llvm::LiveIntervalsID = LiveIntervals::ID; -INITIALIZE_PASS_BEGIN(LiveIntervals, "liveintervals", - "Live Interval Analysis", false, false) -INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LiveVariables) -INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree) -INITIALIZE_PASS_DEPENDENCY(SlotIndexes) -INITIALIZE_PASS_END(LiveIntervals, "liveintervals", - "Live Interval Analysis", false, false) - -#ifndef NDEBUG -static cl::opt<bool> EnablePrecomputePhysRegs( - "precompute-phys-liveness", cl::Hidden, - cl::desc("Eagerly compute live intervals for all physreg units.")); -#else -static bool EnablePrecomputePhysRegs = false; -#endif // NDEBUG - -static cl::opt<bool> EnableSubRegLiveness( - "enable-subreg-liveness", cl::Hidden, cl::init(true), - cl::desc("Enable subregister liveness tracking.")); - -namespace llvm { -cl::opt<bool> UseSegmentSetForPhysRegs( - "use-segment-set-for-physregs", cl::Hidden, cl::init(true), - cl::desc( - "Use segment set for the computation of the live ranges of physregs.")); -} - -void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesCFG(); - AU.addRequired<AAResultsWrapperPass>(); - AU.addPreserved<AAResultsWrapperPass>(); - // LiveVariables isn't really required by this analysis, it is only required - // here to make sure it is live during TwoAddressInstructionPass and - // PHIElimination. This is temporary. - AU.addRequired<LiveVariables>(); - AU.addPreserved<LiveVariables>(); - AU.addPreservedID(MachineLoopInfoID); - AU.addRequiredTransitiveID(MachineDominatorsID); - AU.addPreservedID(MachineDominatorsID); - AU.addPreserved<SlotIndexes>(); - AU.addRequiredTransitive<SlotIndexes>(); - MachineFunctionPass::getAnalysisUsage(AU); -} - -LiveIntervals::LiveIntervals() : MachineFunctionPass(ID), - DomTree(nullptr), LRCalc(nullptr) { - initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); -} - -LiveIntervals::~LiveIntervals() { - delete LRCalc; -} - -void LiveIntervals::releaseMemory() { - // Free the live intervals themselves. - for (unsigned i = 0, e = VirtRegIntervals.size(); i != e; ++i) - delete VirtRegIntervals[TargetRegisterInfo::index2VirtReg(i)]; - VirtRegIntervals.clear(); - RegMaskSlots.clear(); - RegMaskBits.clear(); - RegMaskBlocks.clear(); - - for (unsigned i = 0, e = RegUnitRanges.size(); i != e; ++i) - delete RegUnitRanges[i]; - RegUnitRanges.clear(); - - // Release VNInfo memory regions, VNInfo objects don't need to be dtor'd. - VNInfoAllocator.Reset(); -} - -/// runOnMachineFunction - calculates LiveIntervals -/// -bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) { - MF = &fn; - MRI = &MF->getRegInfo(); - TRI = MF->getSubtarget().getRegisterInfo(); - TII = MF->getSubtarget().getInstrInfo(); - AA = &getAnalysis<AAResultsWrapperPass>().getAAResults(); - Indexes = &getAnalysis<SlotIndexes>(); - DomTree = &getAnalysis<MachineDominatorTree>(); - - if (EnableSubRegLiveness && MF->getSubtarget().enableSubRegLiveness()) - MRI->enableSubRegLiveness(true); - - if (!LRCalc) - LRCalc = new LiveRangeCalc(); - - // Allocate space for all virtual registers. - VirtRegIntervals.resize(MRI->getNumVirtRegs()); - - computeVirtRegs(); - computeRegMasks(); - computeLiveInRegUnits(); - - if (EnablePrecomputePhysRegs) { - // For stress testing, precompute live ranges of all physical register - // units, including reserved registers. - for (unsigned i = 0, e = TRI->getNumRegUnits(); i != e; ++i) - getRegUnit(i); - } - DEBUG(dump()); - return true; -} - -/// print - Implement the dump method. -void LiveIntervals::print(raw_ostream &OS, const Module* ) const { - OS << "********** INTERVALS **********\n"; - - // Dump the regunits. - for (unsigned i = 0, e = RegUnitRanges.size(); i != e; ++i) - if (LiveRange *LR = RegUnitRanges[i]) - OS << PrintRegUnit(i, TRI) << ' ' << *LR << '\n'; - - // Dump the virtregs. - for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) { - unsigned Reg = TargetRegisterInfo::index2VirtReg(i); - if (hasInterval(Reg)) - OS << getInterval(Reg) << '\n'; - } - - OS << "RegMasks:"; - for (unsigned i = 0, e = RegMaskSlots.size(); i != e; ++i) - OS << ' ' << RegMaskSlots[i]; - OS << '\n'; - - printInstrs(OS); -} - -void LiveIntervals::printInstrs(raw_ostream &OS) const { - OS << "********** MACHINEINSTRS **********\n"; - MF->print(OS, Indexes); -} - -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) -void LiveIntervals::dumpInstrs() const { - printInstrs(dbgs()); -} -#endif - -LiveInterval* LiveIntervals::createInterval(unsigned reg) { - float Weight = TargetRegisterInfo::isPhysicalRegister(reg) ? - llvm::huge_valf : 0.0F; - return new LiveInterval(reg, Weight); -} - - -/// computeVirtRegInterval - Compute the live interval of a virtual register, -/// based on defs and uses. -void LiveIntervals::computeVirtRegInterval(LiveInterval &LI) { - assert(LRCalc && "LRCalc not initialized."); - assert(LI.empty() && "Should only compute empty intervals."); - bool ShouldTrackSubRegLiveness = MRI->shouldTrackSubRegLiveness(LI.reg); - LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator()); - LRCalc->calculate(LI, ShouldTrackSubRegLiveness); - bool SeparatedComponents = computeDeadValues(LI, nullptr); - if (SeparatedComponents) { - assert(ShouldTrackSubRegLiveness - && "Separated components should only occur for unused subreg defs"); - SmallVector<LiveInterval*, 8> SplitLIs; - splitSeparateComponents(LI, SplitLIs); - } -} - -void LiveIntervals::computeVirtRegs() { - for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) { - unsigned Reg = TargetRegisterInfo::index2VirtReg(i); - if (MRI->reg_nodbg_empty(Reg)) - continue; - createAndComputeVirtRegInterval(Reg); - } -} - -void LiveIntervals::computeRegMasks() { - RegMaskBlocks.resize(MF->getNumBlockIDs()); - - // Find all instructions with regmask operands. - for (MachineBasicBlock &MBB : *MF) { - std::pair<unsigned, unsigned> &RMB = RegMaskBlocks[MBB.getNumber()]; - RMB.first = RegMaskSlots.size(); - - // Some block starts, such as EH funclets, create masks. - if (const uint32_t *Mask = MBB.getBeginClobberMask(TRI)) { - RegMaskSlots.push_back(Indexes->getMBBStartIdx(&MBB)); - RegMaskBits.push_back(Mask); - } - - for (MachineInstr &MI : MBB) { - for (const MachineOperand &MO : MI.operands()) { - if (!MO.isRegMask()) - continue; - RegMaskSlots.push_back(Indexes->getInstructionIndex(&MI).getRegSlot()); - RegMaskBits.push_back(MO.getRegMask()); - } - } - - // Some block ends, such as funclet returns, create masks. - if (const uint32_t *Mask = MBB.getEndClobberMask(TRI)) { - RegMaskSlots.push_back(Indexes->getMBBEndIdx(&MBB)); - RegMaskBits.push_back(Mask); - } - - // Compute the number of register mask instructions in this block. - RMB.second = RegMaskSlots.size() - RMB.first; - } -} - -//===----------------------------------------------------------------------===// -// Register Unit Liveness -//===----------------------------------------------------------------------===// -// -// Fixed interference typically comes from ABI boundaries: Function arguments -// and return values are passed in fixed registers, and so are exception -// pointers entering landing pads. Certain instructions require values to be -// present in specific registers. That is also represented through fixed -// interference. -// - -/// computeRegUnitInterval - Compute the live range of a register unit, based -/// on the uses and defs of aliasing registers. The range should be empty, -/// or contain only dead phi-defs from ABI blocks. -void LiveIntervals::computeRegUnitRange(LiveRange &LR, unsigned Unit) { - assert(LRCalc && "LRCalc not initialized."); - LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator()); - - // The physregs aliasing Unit are the roots and their super-registers. - // Create all values as dead defs before extending to uses. Note that roots - // may share super-registers. That's OK because createDeadDefs() is - // idempotent. It is very rare for a register unit to have multiple roots, so - // uniquing super-registers is probably not worthwhile. - for (MCRegUnitRootIterator Roots(Unit, TRI); Roots.isValid(); ++Roots) { - for (MCSuperRegIterator Supers(*Roots, TRI, /*IncludeSelf=*/true); - Supers.isValid(); ++Supers) { - if (!MRI->reg_empty(*Supers)) - LRCalc->createDeadDefs(LR, *Supers); - } - } - - // Now extend LR to reach all uses. - // Ignore uses of reserved registers. We only track defs of those. - for (MCRegUnitRootIterator Roots(Unit, TRI); Roots.isValid(); ++Roots) { - for (MCSuperRegIterator Supers(*Roots, TRI, /*IncludeSelf=*/true); - Supers.isValid(); ++Supers) { - unsigned Reg = *Supers; - if (!MRI->isReserved(Reg) && !MRI->reg_empty(Reg)) - LRCalc->extendToUses(LR, Reg); - } - } - - // Flush the segment set to the segment vector. - if (UseSegmentSetForPhysRegs) - LR.flushSegmentSet(); -} - - -/// computeLiveInRegUnits - Precompute the live ranges of any register units -/// that are live-in to an ABI block somewhere. Register values can appear -/// without a corresponding def when entering the entry block or a landing pad. -/// -void LiveIntervals::computeLiveInRegUnits() { - RegUnitRanges.resize(TRI->getNumRegUnits()); - DEBUG(dbgs() << "Computing live-in reg-units in ABI blocks.\n"); - - // Keep track of the live range sets allocated. - SmallVector<unsigned, 8> NewRanges; - - // Check all basic blocks for live-ins. - for (MachineFunction::const_iterator MFI = MF->begin(), MFE = MF->end(); - MFI != MFE; ++MFI) { - const MachineBasicBlock *MBB = &*MFI; - - // We only care about ABI blocks: Entry + landing pads. - if ((MFI != MF->begin() && !MBB->isEHPad()) || MBB->livein_empty()) - continue; - - // Create phi-defs at Begin for all live-in registers. - SlotIndex Begin = Indexes->getMBBStartIdx(MBB); - DEBUG(dbgs() << Begin << "\tBB#" << MBB->getNumber()); - for (const auto &LI : MBB->liveins()) { - for (MCRegUnitIterator Units(LI.PhysReg, TRI); Units.isValid(); ++Units) { - unsigned Unit = *Units; - LiveRange *LR = RegUnitRanges[Unit]; - if (!LR) { - // Use segment set to speed-up initial computation of the live range. - LR = RegUnitRanges[Unit] = new LiveRange(UseSegmentSetForPhysRegs); - NewRanges.push_back(Unit); - } - VNInfo *VNI = LR->createDeadDef(Begin, getVNInfoAllocator()); - (void)VNI; - DEBUG(dbgs() << ' ' << PrintRegUnit(Unit, TRI) << '#' << VNI->id); - } - } - DEBUG(dbgs() << '\n'); - } - DEBUG(dbgs() << "Created " << NewRanges.size() << " new intervals.\n"); - - // Compute the 'normal' part of the ranges. - for (unsigned i = 0, e = NewRanges.size(); i != e; ++i) { - unsigned Unit = NewRanges[i]; - computeRegUnitRange(*RegUnitRanges[Unit], Unit); - } -} - - -static void createSegmentsForValues(LiveRange &LR, - iterator_range<LiveInterval::vni_iterator> VNIs) { - for (auto VNI : VNIs) { - if (VNI->isUnused()) - continue; - SlotIndex Def = VNI->def; - LR.addSegment(LiveRange::Segment(Def, Def.getDeadSlot(), VNI)); - } -} - -typedef SmallVector<std::pair<SlotIndex, VNInfo*>, 16> ShrinkToUsesWorkList; - -static void extendSegmentsToUses(LiveRange &LR, const SlotIndexes &Indexes, - ShrinkToUsesWorkList &WorkList, - const LiveRange &OldRange) { - // Keep track of the PHIs that are in use. - SmallPtrSet<VNInfo*, 8> UsedPHIs; - // Blocks that have already been added to WorkList as live-out. - SmallPtrSet<MachineBasicBlock*, 16> LiveOut; - - // Extend intervals to reach all uses in WorkList. - while (!WorkList.empty()) { - SlotIndex Idx = WorkList.back().first; - VNInfo *VNI = WorkList.back().second; - WorkList.pop_back(); - const MachineBasicBlock *MBB = Indexes.getMBBFromIndex(Idx.getPrevSlot()); - SlotIndex BlockStart = Indexes.getMBBStartIdx(MBB); - - // Extend the live range for VNI to be live at Idx. - if (VNInfo *ExtVNI = LR.extendInBlock(BlockStart, Idx)) { - assert(ExtVNI == VNI && "Unexpected existing value number"); - (void)ExtVNI; - // Is this a PHIDef we haven't seen before? - if (!VNI->isPHIDef() || VNI->def != BlockStart || - !UsedPHIs.insert(VNI).second) - continue; - // The PHI is live, make sure the predecessors are live-out. - for (auto &Pred : MBB->predecessors()) { - if (!LiveOut.insert(Pred).second) - continue; - SlotIndex Stop = Indexes.getMBBEndIdx(Pred); - // A predecessor is not required to have a live-out value for a PHI. - if (VNInfo *PVNI = OldRange.getVNInfoBefore(Stop)) - WorkList.push_back(std::make_pair(Stop, PVNI)); - } - continue; - } - - // VNI is live-in to MBB. - DEBUG(dbgs() << " live-in at " << BlockStart << '\n'); - LR.addSegment(LiveRange::Segment(BlockStart, Idx, VNI)); - - // Make sure VNI is live-out from the predecessors. - for (auto &Pred : MBB->predecessors()) { - if (!LiveOut.insert(Pred).second) - continue; - SlotIndex Stop = Indexes.getMBBEndIdx(Pred); - assert(OldRange.getVNInfoBefore(Stop) == VNI && - "Wrong value out of predecessor"); - WorkList.push_back(std::make_pair(Stop, VNI)); - } - } -} - -bool LiveIntervals::shrinkToUses(LiveInterval *li, - SmallVectorImpl<MachineInstr*> *dead) { - DEBUG(dbgs() << "Shrink: " << *li << '\n'); - assert(TargetRegisterInfo::isVirtualRegister(li->reg) - && "Can only shrink virtual registers"); - - // Shrink subregister live ranges. - bool NeedsCleanup = false; - for (LiveInterval::SubRange &S : li->subranges()) { - shrinkToUses(S, li->reg); - if (S.empty()) - NeedsCleanup = true; - } - if (NeedsCleanup) - li->removeEmptySubRanges(); - - // Find all the values used, including PHI kills. - ShrinkToUsesWorkList WorkList; - - // Visit all instructions reading li->reg. - for (MachineRegisterInfo::reg_instr_iterator - I = MRI->reg_instr_begin(li->reg), E = MRI->reg_instr_end(); - I != E; ) { - MachineInstr *UseMI = &*(I++); - if (UseMI->isDebugValue() || !UseMI->readsVirtualRegister(li->reg)) - continue; - SlotIndex Idx = getInstructionIndex(UseMI).getRegSlot(); - LiveQueryResult LRQ = li->Query(Idx); - VNInfo *VNI = LRQ.valueIn(); - if (!VNI) { - // This shouldn't happen: readsVirtualRegister returns true, but there is - // no live value. It is likely caused by a target getting <undef> flags - // wrong. - DEBUG(dbgs() << Idx << '\t' << *UseMI - << "Warning: Instr claims to read non-existent value in " - << *li << '\n'); - continue; - } - // Special case: An early-clobber tied operand reads and writes the - // register one slot early. - if (VNInfo *DefVNI = LRQ.valueDefined()) - Idx = DefVNI->def; - - WorkList.push_back(std::make_pair(Idx, VNI)); - } - - // Create new live ranges with only minimal live segments per def. - LiveRange NewLR; - createSegmentsForValues(NewLR, make_range(li->vni_begin(), li->vni_end())); - extendSegmentsToUses(NewLR, *Indexes, WorkList, *li); - - // Move the trimmed segments back. - li->segments.swap(NewLR.segments); - - // Handle dead values. - bool CanSeparate = computeDeadValues(*li, dead); - DEBUG(dbgs() << "Shrunk: " << *li << '\n'); - return CanSeparate; -} - -bool LiveIntervals::computeDeadValues(LiveInterval &LI, - SmallVectorImpl<MachineInstr*> *dead) { - bool MayHaveSplitComponents = false; - for (auto VNI : LI.valnos) { - if (VNI->isUnused()) - continue; - SlotIndex Def = VNI->def; - LiveRange::iterator I = LI.FindSegmentContaining(Def); - assert(I != LI.end() && "Missing segment for VNI"); - - // Is the register live before? Otherwise we may have to add a read-undef - // flag for subregister defs. - bool DeadBeforeDef = false; - unsigned VReg = LI.reg; - if (MRI->shouldTrackSubRegLiveness(VReg)) { - if ((I == LI.begin() || std::prev(I)->end < Def) && !VNI->isPHIDef()) { - MachineInstr *MI = getInstructionFromIndex(Def); - MI->setRegisterDefReadUndef(VReg); - DeadBeforeDef = true; - } - } - - if (I->end != Def.getDeadSlot()) - continue; - if (VNI->isPHIDef()) { - // This is a dead PHI. Remove it. - VNI->markUnused(); - LI.removeSegment(I); - DEBUG(dbgs() << "Dead PHI at " << Def << " may separate interval\n"); - MayHaveSplitComponents = true; - } else { - // This is a dead def. Make sure the instruction knows. - MachineInstr *MI = getInstructionFromIndex(Def); - assert(MI && "No instruction defining live value"); - MI->addRegisterDead(VReg, TRI); - - // If we have a dead def that is completely separate from the rest of - // the liverange then we rewrite it to use a different VReg to not violate - // the rule that the liveness of a virtual register forms a connected - // component. This should only happen if subregister liveness is tracked. - if (DeadBeforeDef) - MayHaveSplitComponents = true; - - if (dead && MI->allDefsAreDead()) { - DEBUG(dbgs() << "All defs dead: " << Def << '\t' << *MI); - dead->push_back(MI); - } - } - } - return MayHaveSplitComponents; -} - -void LiveIntervals::shrinkToUses(LiveInterval::SubRange &SR, unsigned Reg) -{ - DEBUG(dbgs() << "Shrink: " << SR << '\n'); - assert(TargetRegisterInfo::isVirtualRegister(Reg) - && "Can only shrink virtual registers"); - // Find all the values used, including PHI kills. - ShrinkToUsesWorkList WorkList; - - // Visit all instructions reading Reg. - SlotIndex LastIdx; - for (MachineOperand &MO : MRI->reg_operands(Reg)) { - MachineInstr *UseMI = MO.getParent(); - if (UseMI->isDebugValue()) - continue; - // Maybe the operand is for a subregister we don't care about. - unsigned SubReg = MO.getSubReg(); - if (SubReg != 0) { - LaneBitmask LaneMask = TRI->getSubRegIndexLaneMask(SubReg); - if ((LaneMask & SR.LaneMask) == 0) - continue; - } - // We only need to visit each instruction once. - SlotIndex Idx = getInstructionIndex(UseMI).getRegSlot(); - if (Idx == LastIdx) - continue; - LastIdx = Idx; - - LiveQueryResult LRQ = SR.Query(Idx); - VNInfo *VNI = LRQ.valueIn(); - // For Subranges it is possible that only undef values are left in that - // part of the subregister, so there is no real liverange at the use - if (!VNI) - continue; - - // Special case: An early-clobber tied operand reads and writes the - // register one slot early. - if (VNInfo *DefVNI = LRQ.valueDefined()) - Idx = DefVNI->def; - - WorkList.push_back(std::make_pair(Idx, VNI)); - } - - // Create a new live ranges with only minimal live segments per def. - LiveRange NewLR; - createSegmentsForValues(NewLR, make_range(SR.vni_begin(), SR.vni_end())); - extendSegmentsToUses(NewLR, *Indexes, WorkList, SR); - - // Move the trimmed ranges back. - SR.segments.swap(NewLR.segments); - - // Remove dead PHI value numbers - for (auto VNI : SR.valnos) { - if (VNI->isUnused()) - continue; - const LiveRange::Segment *Segment = SR.getSegmentContaining(VNI->def); - assert(Segment != nullptr && "Missing segment for VNI"); - if (Segment->end != VNI->def.getDeadSlot()) - continue; - if (VNI->isPHIDef()) { - // This is a dead PHI. Remove it. - VNI->markUnused(); - SR.removeSegment(*Segment); - DEBUG(dbgs() << "Dead PHI at " << VNI->def << " may separate interval\n"); - } - } - - DEBUG(dbgs() << "Shrunk: " << SR << '\n'); -} - -void LiveIntervals::extendToIndices(LiveRange &LR, - ArrayRef<SlotIndex> Indices) { - assert(LRCalc && "LRCalc not initialized."); - LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator()); - for (unsigned i = 0, e = Indices.size(); i != e; ++i) - LRCalc->extend(LR, Indices[i]); -} - -void LiveIntervals::pruneValue(LiveRange &LR, SlotIndex Kill, - SmallVectorImpl<SlotIndex> *EndPoints) { - LiveQueryResult LRQ = LR.Query(Kill); - VNInfo *VNI = LRQ.valueOutOrDead(); - if (!VNI) - return; - - MachineBasicBlock *KillMBB = Indexes->getMBBFromIndex(Kill); - SlotIndex MBBEnd = Indexes->getMBBEndIdx(KillMBB); - - // If VNI isn't live out from KillMBB, the value is trivially pruned. - if (LRQ.endPoint() < MBBEnd) { - LR.removeSegment(Kill, LRQ.endPoint()); - if (EndPoints) EndPoints->push_back(LRQ.endPoint()); - return; - } - - // VNI is live out of KillMBB. - LR.removeSegment(Kill, MBBEnd); - if (EndPoints) EndPoints->push_back(MBBEnd); - - // Find all blocks that are reachable from KillMBB without leaving VNI's live - // range. It is possible that KillMBB itself is reachable, so start a DFS - // from each successor. - typedef SmallPtrSet<MachineBasicBlock*, 9> VisitedTy; - VisitedTy Visited; - for (MachineBasicBlock::succ_iterator - SuccI = KillMBB->succ_begin(), SuccE = KillMBB->succ_end(); - SuccI != SuccE; ++SuccI) { - for (df_ext_iterator<MachineBasicBlock*, VisitedTy> - I = df_ext_begin(*SuccI, Visited), E = df_ext_end(*SuccI, Visited); - I != E;) { - MachineBasicBlock *MBB = *I; - - // Check if VNI is live in to MBB. - SlotIndex MBBStart, MBBEnd; - std::tie(MBBStart, MBBEnd) = Indexes->getMBBRange(MBB); - LiveQueryResult LRQ = LR.Query(MBBStart); - if (LRQ.valueIn() != VNI) { - // This block isn't part of the VNI segment. Prune the search. - I.skipChildren(); - continue; - } - - // Prune the search if VNI is killed in MBB. - if (LRQ.endPoint() < MBBEnd) { - LR.removeSegment(MBBStart, LRQ.endPoint()); - if (EndPoints) EndPoints->push_back(LRQ.endPoint()); - I.skipChildren(); - continue; - } - - // VNI is live through MBB. - LR.removeSegment(MBBStart, MBBEnd); - if (EndPoints) EndPoints->push_back(MBBEnd); - ++I; - } - } -} - -//===----------------------------------------------------------------------===// -// Register allocator hooks. -// - -void LiveIntervals::addKillFlags(const VirtRegMap *VRM) { - // Keep track of regunit ranges. - SmallVector<std::pair<const LiveRange*, LiveRange::const_iterator>, 8> RU; - // Keep track of subregister ranges. - SmallVector<std::pair<const LiveInterval::SubRange*, - LiveRange::const_iterator>, 4> SRs; - - for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) { - unsigned Reg = TargetRegisterInfo::index2VirtReg(i); - if (MRI->reg_nodbg_empty(Reg)) - continue; - const LiveInterval &LI = getInterval(Reg); - if (LI.empty()) - continue; - - // Find the regunit intervals for the assigned register. They may overlap - // the virtual register live range, cancelling any kills. - RU.clear(); - for (MCRegUnitIterator Units(VRM->getPhys(Reg), TRI); Units.isValid(); - ++Units) { - const LiveRange &RURange = getRegUnit(*Units); - if (RURange.empty()) - continue; - RU.push_back(std::make_pair(&RURange, RURange.find(LI.begin()->end))); - } - - if (MRI->subRegLivenessEnabled()) { - SRs.clear(); - for (const LiveInterval::SubRange &SR : LI.subranges()) { - SRs.push_back(std::make_pair(&SR, SR.find(LI.begin()->end))); - } - } - - // Every instruction that kills Reg corresponds to a segment range end - // point. - for (LiveInterval::const_iterator RI = LI.begin(), RE = LI.end(); RI != RE; - ++RI) { - // A block index indicates an MBB edge. - if (RI->end.isBlock()) - continue; - MachineInstr *MI = getInstructionFromIndex(RI->end); - if (!MI) - continue; - - // Check if any of the regunits are live beyond the end of RI. That could - // happen when a physreg is defined as a copy of a virtreg: - // - // %EAX = COPY %vreg5 - // FOO %vreg5 <--- MI, cancel kill because %EAX is live. - // BAR %EAX<kill> - // - // There should be no kill flag on FOO when %vreg5 is rewritten as %EAX. - for (auto &RUP : RU) { - const LiveRange &RURange = *RUP.first; - LiveRange::const_iterator &I = RUP.second; - if (I == RURange.end()) - continue; - I = RURange.advanceTo(I, RI->end); - if (I == RURange.end() || I->start >= RI->end) - continue; - // I is overlapping RI. - goto CancelKill; - } - - if (MRI->subRegLivenessEnabled()) { - // When reading a partial undefined value we must not add a kill flag. - // The regalloc might have used the undef lane for something else. - // Example: - // %vreg1 = ... ; R32: %vreg1 - // %vreg2:high16 = ... ; R64: %vreg2 - // = read %vreg2<kill> ; R64: %vreg2 - // = read %vreg1 ; R32: %vreg1 - // The <kill> flag is correct for %vreg2, but the register allocator may - // assign R0L to %vreg1, and R0 to %vreg2 because the low 32bits of R0 - // are actually never written by %vreg2. After assignment the <kill> - // flag at the read instruction is invalid. - LaneBitmask DefinedLanesMask; - if (!SRs.empty()) { - // Compute a mask of lanes that are defined. - DefinedLanesMask = 0; - for (auto &SRP : SRs) { - const LiveInterval::SubRange &SR = *SRP.first; - LiveRange::const_iterator &I = SRP.second; - if (I == SR.end()) - continue; - I = SR.advanceTo(I, RI->end); - if (I == SR.end() || I->start >= RI->end) - continue; - // I is overlapping RI - DefinedLanesMask |= SR.LaneMask; - } - } else - DefinedLanesMask = ~0u; - - bool IsFullWrite = false; - for (const MachineOperand &MO : MI->operands()) { - if (!MO.isReg() || MO.getReg() != Reg) - continue; - if (MO.isUse()) { - // Reading any undefined lanes? - LaneBitmask UseMask = TRI->getSubRegIndexLaneMask(MO.getSubReg()); - if ((UseMask & ~DefinedLanesMask) != 0) - goto CancelKill; - } else if (MO.getSubReg() == 0) { - // Writing to the full register? - assert(MO.isDef()); - IsFullWrite = true; - } - } - - // If an instruction writes to a subregister, a new segment starts in - // the LiveInterval. But as this is only overriding part of the register - // adding kill-flags is not correct here after registers have been - // assigned. - if (!IsFullWrite) { - // Next segment has to be adjacent in the subregister write case. - LiveRange::const_iterator N = std::next(RI); - if (N != LI.end() && N->start == RI->end) - goto CancelKill; - } - } - - MI->addRegisterKilled(Reg, nullptr); - continue; -CancelKill: - MI->clearRegisterKills(Reg, nullptr); - } - } -} - -MachineBasicBlock* -LiveIntervals::intervalIsInOneMBB(const LiveInterval &LI) const { - // A local live range must be fully contained inside the block, meaning it is - // defined and killed at instructions, not at block boundaries. It is not - // live in or or out of any block. - // - // It is technically possible to have a PHI-defined live range identical to a - // single block, but we are going to return false in that case. - - SlotIndex Start = LI.beginIndex(); - if (Start.isBlock()) - return nullptr; - - SlotIndex Stop = LI.endIndex(); - if (Stop.isBlock()) - return nullptr; - - // getMBBFromIndex doesn't need to search the MBB table when both indexes - // belong to proper instructions. - MachineBasicBlock *MBB1 = Indexes->getMBBFromIndex(Start); - MachineBasicBlock *MBB2 = Indexes->getMBBFromIndex(Stop); - return MBB1 == MBB2 ? MBB1 : nullptr; -} - -bool -LiveIntervals::hasPHIKill(const LiveInterval &LI, const VNInfo *VNI) const { - for (const VNInfo *PHI : LI.valnos) { - if (PHI->isUnused() || !PHI->isPHIDef()) - continue; - const MachineBasicBlock *PHIMBB = getMBBFromIndex(PHI->def); - // Conservatively return true instead of scanning huge predecessor lists. - if (PHIMBB->pred_size() > 100) - return true; - for (MachineBasicBlock::const_pred_iterator - PI = PHIMBB->pred_begin(), PE = PHIMBB->pred_end(); PI != PE; ++PI) - if (VNI == LI.getVNInfoBefore(Indexes->getMBBEndIdx(*PI))) - return true; - } - return false; -} - -float -LiveIntervals::getSpillWeight(bool isDef, bool isUse, - const MachineBlockFrequencyInfo *MBFI, - const MachineInstr *MI) { - BlockFrequency Freq = MBFI->getBlockFreq(MI->getParent()); - const float Scale = 1.0f / MBFI->getEntryFreq(); - return (isDef + isUse) * (Freq.getFrequency() * Scale); -} - -LiveRange::Segment -LiveIntervals::addSegmentToEndOfBlock(unsigned reg, MachineInstr* startInst) { - LiveInterval& Interval = createEmptyInterval(reg); - VNInfo* VN = Interval.getNextValue( - SlotIndex(getInstructionIndex(startInst).getRegSlot()), - getVNInfoAllocator()); - LiveRange::Segment S( - SlotIndex(getInstructionIndex(startInst).getRegSlot()), - getMBBEndIdx(startInst->getParent()), VN); - Interval.addSegment(S); - - return S; -} - - -//===----------------------------------------------------------------------===// -// Register mask functions -//===----------------------------------------------------------------------===// - -bool LiveIntervals::checkRegMaskInterference(LiveInterval &LI, - BitVector &UsableRegs) { - if (LI.empty()) - return false; - LiveInterval::iterator LiveI = LI.begin(), LiveE = LI.end(); - - // Use a smaller arrays for local live ranges. - ArrayRef<SlotIndex> Slots; - ArrayRef<const uint32_t*> Bits; - if (MachineBasicBlock *MBB = intervalIsInOneMBB(LI)) { - Slots = getRegMaskSlotsInBlock(MBB->getNumber()); - Bits = getRegMaskBitsInBlock(MBB->getNumber()); - } else { - Slots = getRegMaskSlots(); - Bits = getRegMaskBits(); - } - - // We are going to enumerate all the register mask slots contained in LI. - // Start with a binary search of RegMaskSlots to find a starting point. - ArrayRef<SlotIndex>::iterator SlotI = - std::lower_bound(Slots.begin(), Slots.end(), LiveI->start); - ArrayRef<SlotIndex>::iterator SlotE = Slots.end(); - - // No slots in range, LI begins after the last call. - if (SlotI == SlotE) - return false; - - bool Found = false; - for (;;) { - assert(*SlotI >= LiveI->start); - // Loop over all slots overlapping this segment. - while (*SlotI < LiveI->end) { - // *SlotI overlaps LI. Collect mask bits. - if (!Found) { - // This is the first overlap. Initialize UsableRegs to all ones. - UsableRegs.clear(); - UsableRegs.resize(TRI->getNumRegs(), true); - Found = true; - } - // Remove usable registers clobbered by this mask. - UsableRegs.clearBitsNotInMask(Bits[SlotI-Slots.begin()]); - if (++SlotI == SlotE) - return Found; - } - // *SlotI is beyond the current LI segment. - LiveI = LI.advanceTo(LiveI, *SlotI); - if (LiveI == LiveE) - return Found; - // Advance SlotI until it overlaps. - while (*SlotI < LiveI->start) - if (++SlotI == SlotE) - return Found; - } -} - -//===----------------------------------------------------------------------===// -// IntervalUpdate class. -//===----------------------------------------------------------------------===// - -// HMEditor is a toolkit used by handleMove to trim or extend live intervals. -class LiveIntervals::HMEditor { -private: - LiveIntervals& LIS; - const MachineRegisterInfo& MRI; - const TargetRegisterInfo& TRI; - SlotIndex OldIdx; - SlotIndex NewIdx; - SmallPtrSet<LiveRange*, 8> Updated; - bool UpdateFlags; - -public: - HMEditor(LiveIntervals& LIS, const MachineRegisterInfo& MRI, - const TargetRegisterInfo& TRI, - SlotIndex OldIdx, SlotIndex NewIdx, bool UpdateFlags) - : LIS(LIS), MRI(MRI), TRI(TRI), OldIdx(OldIdx), NewIdx(NewIdx), - UpdateFlags(UpdateFlags) {} - - // FIXME: UpdateFlags is a workaround that creates live intervals for all - // physregs, even those that aren't needed for regalloc, in order to update - // kill flags. This is wasteful. Eventually, LiveVariables will strip all kill - // flags, and postRA passes will use a live register utility instead. - LiveRange *getRegUnitLI(unsigned Unit) { - if (UpdateFlags) - return &LIS.getRegUnit(Unit); - return LIS.getCachedRegUnit(Unit); - } - - /// Update all live ranges touched by MI, assuming a move from OldIdx to - /// NewIdx. - void updateAllRanges(MachineInstr *MI) { - DEBUG(dbgs() << "handleMove " << OldIdx << " -> " << NewIdx << ": " << *MI); - bool hasRegMask = false; - for (MachineOperand &MO : MI->operands()) { - if (MO.isRegMask()) - hasRegMask = true; - if (!MO.isReg()) - continue; - // Aggressively clear all kill flags. - // They are reinserted by VirtRegRewriter. - if (MO.isUse()) - MO.setIsKill(false); - - unsigned Reg = MO.getReg(); - if (!Reg) - continue; - if (TargetRegisterInfo::isVirtualRegister(Reg)) { - LiveInterval &LI = LIS.getInterval(Reg); - if (LI.hasSubRanges()) { - unsigned SubReg = MO.getSubReg(); - LaneBitmask LaneMask = TRI.getSubRegIndexLaneMask(SubReg); - for (LiveInterval::SubRange &S : LI.subranges()) { - if ((S.LaneMask & LaneMask) == 0) - continue; - updateRange(S, Reg, S.LaneMask); - } - } - updateRange(LI, Reg, 0); - continue; - } - - // For physregs, only update the regunits that actually have a - // precomputed live range. - for (MCRegUnitIterator Units(Reg, &TRI); Units.isValid(); ++Units) - if (LiveRange *LR = getRegUnitLI(*Units)) - updateRange(*LR, *Units, 0); - } - if (hasRegMask) - updateRegMaskSlots(); - } - -private: - /// Update a single live range, assuming an instruction has been moved from - /// OldIdx to NewIdx. - void updateRange(LiveRange &LR, unsigned Reg, LaneBitmask LaneMask) { - if (!Updated.insert(&LR).second) - return; - DEBUG({ - dbgs() << " "; - if (TargetRegisterInfo::isVirtualRegister(Reg)) { - dbgs() << PrintReg(Reg); - if (LaneMask != 0) - dbgs() << " L" << PrintLaneMask(LaneMask); - } else { - dbgs() << PrintRegUnit(Reg, &TRI); - } - dbgs() << ":\t" << LR << '\n'; - }); - if (SlotIndex::isEarlierInstr(OldIdx, NewIdx)) - handleMoveDown(LR); - else - handleMoveUp(LR, Reg, LaneMask); - DEBUG(dbgs() << " -->\t" << LR << '\n'); - LR.verify(); - } - - /// Update LR to reflect an instruction has been moved downwards from OldIdx - /// to NewIdx. - /// - /// 1. Live def at OldIdx: - /// Move def to NewIdx, assert endpoint after NewIdx. - /// - /// 2. Live def at OldIdx, killed at NewIdx: - /// Change to dead def at NewIdx. - /// (Happens when bundling def+kill together). - /// - /// 3. Dead def at OldIdx: - /// Move def to NewIdx, possibly across another live value. - /// - /// 4. Def at OldIdx AND at NewIdx: - /// Remove segment [OldIdx;NewIdx) and value defined at OldIdx. - /// (Happens when bundling multiple defs together). - /// - /// 5. Value read at OldIdx, killed before NewIdx: - /// Extend kill to NewIdx. - /// - void handleMoveDown(LiveRange &LR) { - // First look for a kill at OldIdx. - LiveRange::iterator I = LR.find(OldIdx.getBaseIndex()); - LiveRange::iterator E = LR.end(); - // Is LR even live at OldIdx? - if (I == E || SlotIndex::isEarlierInstr(OldIdx, I->start)) - return; - - // Handle a live-in value. - if (!SlotIndex::isSameInstr(I->start, OldIdx)) { - bool isKill = SlotIndex::isSameInstr(OldIdx, I->end); - // If the live-in value already extends to NewIdx, there is nothing to do. - if (!SlotIndex::isEarlierInstr(I->end, NewIdx)) - return; - // Aggressively remove all kill flags from the old kill point. - // Kill flags shouldn't be used while live intervals exist, they will be - // reinserted by VirtRegRewriter. - if (MachineInstr *KillMI = LIS.getInstructionFromIndex(I->end)) - for (MIBundleOperands MO(KillMI); MO.isValid(); ++MO) - if (MO->isReg() && MO->isUse()) - MO->setIsKill(false); - // Adjust I->end to reach NewIdx. This may temporarily make LR invalid by - // overlapping ranges. Case 5 above. - I->end = NewIdx.getRegSlot(I->end.isEarlyClobber()); - // If this was a kill, there may also be a def. Otherwise we're done. - if (!isKill) - return; - ++I; - } - - // Check for a def at OldIdx. - if (I == E || !SlotIndex::isSameInstr(OldIdx, I->start)) - return; - // We have a def at OldIdx. - VNInfo *DefVNI = I->valno; - assert(DefVNI->def == I->start && "Inconsistent def"); - DefVNI->def = NewIdx.getRegSlot(I->start.isEarlyClobber()); - // If the defined value extends beyond NewIdx, just move the def down. - // This is case 1 above. - if (SlotIndex::isEarlierInstr(NewIdx, I->end)) { - I->start = DefVNI->def; - return; - } - // The remaining possibilities are now: - // 2. Live def at OldIdx, killed at NewIdx: isSameInstr(I->end, NewIdx). - // 3. Dead def at OldIdx: I->end = OldIdx.getDeadSlot(). - // In either case, it is possible that there is an existing def at NewIdx. - assert((I->end == OldIdx.getDeadSlot() || - SlotIndex::isSameInstr(I->end, NewIdx)) && - "Cannot move def below kill"); - LiveRange::iterator NewI = LR.advanceTo(I, NewIdx.getRegSlot()); - if (NewI != E && SlotIndex::isSameInstr(NewI->start, NewIdx)) { - // There is an existing def at NewIdx, case 4 above. The def at OldIdx is - // coalesced into that value. - assert(NewI->valno != DefVNI && "Multiple defs of value?"); - LR.removeValNo(DefVNI); - return; - } - // There was no existing def at NewIdx. Turn *I into a dead def at NewIdx. - // If the def at OldIdx was dead, we allow it to be moved across other LR - // values. The new range should be placed immediately before NewI, move any - // intermediate ranges up. - assert(NewI != I && "Inconsistent iterators"); - std::copy(std::next(I), NewI, I); - *std::prev(NewI) - = LiveRange::Segment(DefVNI->def, NewIdx.getDeadSlot(), DefVNI); - } - - /// Update LR to reflect an instruction has been moved upwards from OldIdx - /// to NewIdx. - /// - /// 1. Live def at OldIdx: - /// Hoist def to NewIdx. - /// - /// 2. Dead def at OldIdx: - /// Hoist def+end to NewIdx, possibly move across other values. - /// - /// 3. Dead def at OldIdx AND existing def at NewIdx: - /// Remove value defined at OldIdx, coalescing it with existing value. - /// - /// 4. Live def at OldIdx AND existing def at NewIdx: - /// Remove value defined at NewIdx, hoist OldIdx def to NewIdx. - /// (Happens when bundling multiple defs together). - /// - /// 5. Value killed at OldIdx: - /// Hoist kill to NewIdx, then scan for last kill between NewIdx and - /// OldIdx. - /// - void handleMoveUp(LiveRange &LR, unsigned Reg, LaneBitmask LaneMask) { - // First look for a kill at OldIdx. - LiveRange::iterator I = LR.find(OldIdx.getBaseIndex()); - LiveRange::iterator E = LR.end(); - // Is LR even live at OldIdx? - if (I == E || SlotIndex::isEarlierInstr(OldIdx, I->start)) - return; - - // Handle a live-in value. - if (!SlotIndex::isSameInstr(I->start, OldIdx)) { - // If the live-in value isn't killed here, there is nothing to do. - if (!SlotIndex::isSameInstr(OldIdx, I->end)) - return; - // Adjust I->end to end at NewIdx. If we are hoisting a kill above - // another use, we need to search for that use. Case 5 above. - I->end = NewIdx.getRegSlot(I->end.isEarlyClobber()); - ++I; - // If OldIdx also defines a value, there couldn't have been another use. - if (I == E || !SlotIndex::isSameInstr(I->start, OldIdx)) { - // No def, search for the new kill. - // This can never be an early clobber kill since there is no def. - std::prev(I)->end = findLastUseBefore(Reg, LaneMask).getRegSlot(); - return; - } - } - - // Now deal with the def at OldIdx. - assert(I != E && SlotIndex::isSameInstr(I->start, OldIdx) && "No def?"); - VNInfo *DefVNI = I->valno; - assert(DefVNI->def == I->start && "Inconsistent def"); - DefVNI->def = NewIdx.getRegSlot(I->start.isEarlyClobber()); - - // Check for an existing def at NewIdx. - LiveRange::iterator NewI = LR.find(NewIdx.getRegSlot()); - if (SlotIndex::isSameInstr(NewI->start, NewIdx)) { - assert(NewI->valno != DefVNI && "Same value defined more than once?"); - // There is an existing def at NewIdx. - if (I->end.isDead()) { - // Case 3: Remove the dead def at OldIdx. - LR.removeValNo(DefVNI); - return; - } - // Case 4: Replace def at NewIdx with live def at OldIdx. - I->start = DefVNI->def; - LR.removeValNo(NewI->valno); - return; - } - - // There is no existing def at NewIdx. Hoist DefVNI. - if (!I->end.isDead()) { - // Leave the end point of a live def. - I->start = DefVNI->def; - return; - } - - // DefVNI is a dead def. It may have been moved across other values in LR, - // so move I up to NewI. Slide [NewI;I) down one position. - std::copy_backward(NewI, I, std::next(I)); - *NewI = LiveRange::Segment(DefVNI->def, NewIdx.getDeadSlot(), DefVNI); - } - - void updateRegMaskSlots() { - SmallVectorImpl<SlotIndex>::iterator RI = - std::lower_bound(LIS.RegMaskSlots.begin(), LIS.RegMaskSlots.end(), - OldIdx); - assert(RI != LIS.RegMaskSlots.end() && *RI == OldIdx.getRegSlot() && - "No RegMask at OldIdx."); - *RI = NewIdx.getRegSlot(); - assert((RI == LIS.RegMaskSlots.begin() || - SlotIndex::isEarlierInstr(*std::prev(RI), *RI)) && - "Cannot move regmask instruction above another call"); - assert((std::next(RI) == LIS.RegMaskSlots.end() || - SlotIndex::isEarlierInstr(*RI, *std::next(RI))) && - "Cannot move regmask instruction below another call"); - } - - // Return the last use of reg between NewIdx and OldIdx. - SlotIndex findLastUseBefore(unsigned Reg, LaneBitmask LaneMask) { - - if (TargetRegisterInfo::isVirtualRegister(Reg)) { - SlotIndex LastUse = NewIdx; - for (MachineOperand &MO : MRI.use_nodbg_operands(Reg)) { - unsigned SubReg = MO.getSubReg(); - if (SubReg != 0 && LaneMask != 0 - && (TRI.getSubRegIndexLaneMask(SubReg) & LaneMask) == 0) - continue; - - const MachineInstr *MI = MO.getParent(); - SlotIndex InstSlot = LIS.getSlotIndexes()->getInstructionIndex(MI); - if (InstSlot > LastUse && InstSlot < OldIdx) - LastUse = InstSlot; - } - return LastUse; - } - - // This is a regunit interval, so scanning the use list could be very - // expensive. Scan upwards from OldIdx instead. - assert(NewIdx < OldIdx && "Expected upwards move"); - SlotIndexes *Indexes = LIS.getSlotIndexes(); - MachineBasicBlock *MBB = Indexes->getMBBFromIndex(NewIdx); - - // OldIdx may not correspond to an instruction any longer, so set MII to - // point to the next instruction after OldIdx, or MBB->end(). - MachineBasicBlock::iterator MII = MBB->end(); - if (MachineInstr *MI = Indexes->getInstructionFromIndex( - Indexes->getNextNonNullIndex(OldIdx))) - if (MI->getParent() == MBB) - MII = MI; - - MachineBasicBlock::iterator Begin = MBB->begin(); - while (MII != Begin) { - if ((--MII)->isDebugValue()) - continue; - SlotIndex Idx = Indexes->getInstructionIndex(MII); - - // Stop searching when NewIdx is reached. - if (!SlotIndex::isEarlierInstr(NewIdx, Idx)) - return NewIdx; - - // Check if MII uses Reg. - for (MIBundleOperands MO(MII); MO.isValid(); ++MO) - if (MO->isReg() && - TargetRegisterInfo::isPhysicalRegister(MO->getReg()) && - TRI.hasRegUnit(MO->getReg(), Reg)) - return Idx; - } - // Didn't reach NewIdx. It must be the first instruction in the block. - return NewIdx; - } -}; - -void LiveIntervals::handleMove(MachineInstr* MI, bool UpdateFlags) { - assert(!MI->isBundled() && "Can't handle bundled instructions yet."); - SlotIndex OldIndex = Indexes->getInstructionIndex(MI); - Indexes->removeMachineInstrFromMaps(MI); - SlotIndex NewIndex = Indexes->insertMachineInstrInMaps(MI); - assert(getMBBStartIdx(MI->getParent()) <= OldIndex && - OldIndex < getMBBEndIdx(MI->getParent()) && - "Cannot handle moves across basic block boundaries."); - - HMEditor HME(*this, *MRI, *TRI, OldIndex, NewIndex, UpdateFlags); - HME.updateAllRanges(MI); -} - -void LiveIntervals::handleMoveIntoBundle(MachineInstr* MI, - MachineInstr* BundleStart, - bool UpdateFlags) { - SlotIndex OldIndex = Indexes->getInstructionIndex(MI); - SlotIndex NewIndex = Indexes->getInstructionIndex(BundleStart); - HMEditor HME(*this, *MRI, *TRI, OldIndex, NewIndex, UpdateFlags); - HME.updateAllRanges(MI); -} - -void LiveIntervals::repairOldRegInRange(const MachineBasicBlock::iterator Begin, - const MachineBasicBlock::iterator End, - const SlotIndex endIdx, - LiveRange &LR, const unsigned Reg, - LaneBitmask LaneMask) { - LiveInterval::iterator LII = LR.find(endIdx); - SlotIndex lastUseIdx; - if (LII != LR.end() && LII->start < endIdx) - lastUseIdx = LII->end; - else - --LII; - - for (MachineBasicBlock::iterator I = End; I != Begin;) { - --I; - MachineInstr *MI = I; - if (MI->isDebugValue()) - continue; - - SlotIndex instrIdx = getInstructionIndex(MI); - bool isStartValid = getInstructionFromIndex(LII->start); - bool isEndValid = getInstructionFromIndex(LII->end); - - // FIXME: This doesn't currently handle early-clobber or multiple removed - // defs inside of the region to repair. - for (MachineInstr::mop_iterator OI = MI->operands_begin(), - OE = MI->operands_end(); OI != OE; ++OI) { - const MachineOperand &MO = *OI; - if (!MO.isReg() || MO.getReg() != Reg) - continue; - - unsigned SubReg = MO.getSubReg(); - LaneBitmask Mask = TRI->getSubRegIndexLaneMask(SubReg); - if ((Mask & LaneMask) == 0) - continue; - - if (MO.isDef()) { - if (!isStartValid) { - if (LII->end.isDead()) { - SlotIndex prevStart; - if (LII != LR.begin()) - prevStart = std::prev(LII)->start; - - // FIXME: This could be more efficient if there was a - // removeSegment method that returned an iterator. - LR.removeSegment(*LII, true); - if (prevStart.isValid()) - LII = LR.find(prevStart); - else - LII = LR.begin(); - } else { - LII->start = instrIdx.getRegSlot(); - LII->valno->def = instrIdx.getRegSlot(); - if (MO.getSubReg() && !MO.isUndef()) - lastUseIdx = instrIdx.getRegSlot(); - else - lastUseIdx = SlotIndex(); - continue; - } - } - - if (!lastUseIdx.isValid()) { - VNInfo *VNI = LR.getNextValue(instrIdx.getRegSlot(), VNInfoAllocator); - LiveRange::Segment S(instrIdx.getRegSlot(), - instrIdx.getDeadSlot(), VNI); - LII = LR.addSegment(S); - } else if (LII->start != instrIdx.getRegSlot()) { - VNInfo *VNI = LR.getNextValue(instrIdx.getRegSlot(), VNInfoAllocator); - LiveRange::Segment S(instrIdx.getRegSlot(), lastUseIdx, VNI); - LII = LR.addSegment(S); - } - - if (MO.getSubReg() && !MO.isUndef()) - lastUseIdx = instrIdx.getRegSlot(); - else - lastUseIdx = SlotIndex(); - } else if (MO.isUse()) { - // FIXME: This should probably be handled outside of this branch, - // either as part of the def case (for defs inside of the region) or - // after the loop over the region. - if (!isEndValid && !LII->end.isBlock()) - LII->end = instrIdx.getRegSlot(); - if (!lastUseIdx.isValid()) - lastUseIdx = instrIdx.getRegSlot(); - } - } - } -} - -void -LiveIntervals::repairIntervalsInRange(MachineBasicBlock *MBB, - MachineBasicBlock::iterator Begin, - MachineBasicBlock::iterator End, - ArrayRef<unsigned> OrigRegs) { - // Find anchor points, which are at the beginning/end of blocks or at - // instructions that already have indexes. - while (Begin != MBB->begin() && !Indexes->hasIndex(Begin)) - --Begin; - while (End != MBB->end() && !Indexes->hasIndex(End)) - ++End; - - SlotIndex endIdx; - if (End == MBB->end()) - endIdx = getMBBEndIdx(MBB).getPrevSlot(); - else - endIdx = getInstructionIndex(End); - - Indexes->repairIndexesInRange(MBB, Begin, End); - - for (MachineBasicBlock::iterator I = End; I != Begin;) { - --I; - MachineInstr *MI = I; - if (MI->isDebugValue()) - continue; - for (MachineInstr::const_mop_iterator MOI = MI->operands_begin(), - MOE = MI->operands_end(); MOI != MOE; ++MOI) { - if (MOI->isReg() && - TargetRegisterInfo::isVirtualRegister(MOI->getReg()) && - !hasInterval(MOI->getReg())) { - createAndComputeVirtRegInterval(MOI->getReg()); - } - } - } - - for (unsigned i = 0, e = OrigRegs.size(); i != e; ++i) { - unsigned Reg = OrigRegs[i]; - if (!TargetRegisterInfo::isVirtualRegister(Reg)) - continue; - - LiveInterval &LI = getInterval(Reg); - // FIXME: Should we support undefs that gain defs? - if (!LI.hasAtLeastOneValue()) - continue; - - for (LiveInterval::SubRange &S : LI.subranges()) { - repairOldRegInRange(Begin, End, endIdx, S, Reg, S.LaneMask); - } - repairOldRegInRange(Begin, End, endIdx, LI, Reg); - } -} - -void LiveIntervals::removePhysRegDefAt(unsigned Reg, SlotIndex Pos) { - for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units) { - if (LiveRange *LR = getCachedRegUnit(*Units)) - if (VNInfo *VNI = LR->getVNInfoAt(Pos)) - LR->removeValNo(VNI); - } -} - -void LiveIntervals::removeVRegDefAt(LiveInterval &LI, SlotIndex Pos) { - VNInfo *VNI = LI.getVNInfoAt(Pos); - if (VNI == nullptr) - return; - LI.removeValNo(VNI); - - // Also remove the value in subranges. - for (LiveInterval::SubRange &S : LI.subranges()) { - if (VNInfo *SVNI = S.getVNInfoAt(Pos)) - S.removeValNo(SVNI); - } - LI.removeEmptySubRanges(); -} - -void LiveIntervals::splitSeparateComponents(LiveInterval &LI, - SmallVectorImpl<LiveInterval*> &SplitLIs) { - ConnectedVNInfoEqClasses ConEQ(*this); - unsigned NumComp = ConEQ.Classify(LI); - if (NumComp <= 1) - return; - DEBUG(dbgs() << " Split " << NumComp << " components: " << LI << '\n'); - unsigned Reg = LI.reg; - const TargetRegisterClass *RegClass = MRI->getRegClass(Reg); - for (unsigned I = 1; I < NumComp; ++I) { - unsigned NewVReg = MRI->createVirtualRegister(RegClass); - LiveInterval &NewLI = createEmptyInterval(NewVReg); - SplitLIs.push_back(&NewLI); - } - ConEQ.Distribute(LI, SplitLIs.data(), *MRI); -} diff --git a/gnu/llvm/lib/CodeGen/LiveStackAnalysis.cpp b/gnu/llvm/lib/CodeGen/LiveStackAnalysis.cpp deleted file mode 100644 index 5c9c679e97b..00000000000 --- a/gnu/llvm/lib/CodeGen/LiveStackAnalysis.cpp +++ /dev/null @@ -1,90 +0,0 @@ -//===-- LiveStackAnalysis.cpp - Live Stack Slot Analysis ------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the live stack slot analysis pass. It is analogous to -// live interval analysis except it's analyzing liveness of stack slots rather -// than registers. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CodeGen/LiveStackAnalysis.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/CodeGen/LiveIntervalAnalysis.h" -#include "llvm/CodeGen/Passes.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Target/TargetRegisterInfo.h" -#include "llvm/Target/TargetSubtargetInfo.h" -#include <limits> -using namespace llvm; - -#define DEBUG_TYPE "livestacks" - -char LiveStacks::ID = 0; -INITIALIZE_PASS_BEGIN(LiveStacks, "livestacks", - "Live Stack Slot Analysis", false, false) -INITIALIZE_PASS_DEPENDENCY(SlotIndexes) -INITIALIZE_PASS_END(LiveStacks, "livestacks", - "Live Stack Slot Analysis", false, false) - -char &llvm::LiveStacksID = LiveStacks::ID; - -void LiveStacks::getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - AU.addPreserved<SlotIndexes>(); - AU.addRequiredTransitive<SlotIndexes>(); - MachineFunctionPass::getAnalysisUsage(AU); -} - -void LiveStacks::releaseMemory() { - // Release VNInfo memory regions, VNInfo objects don't need to be dtor'd. - VNInfoAllocator.Reset(); - S2IMap.clear(); - S2RCMap.clear(); -} - -bool LiveStacks::runOnMachineFunction(MachineFunction &MF) { - TRI = MF.getSubtarget().getRegisterInfo(); - // FIXME: No analysis is being done right now. We are relying on the - // register allocators to provide the information. - return false; -} - -LiveInterval & -LiveStacks::getOrCreateInterval(int Slot, const TargetRegisterClass *RC) { - assert(Slot >= 0 && "Spill slot indice must be >= 0"); - SS2IntervalMap::iterator I = S2IMap.find(Slot); - if (I == S2IMap.end()) { - I = S2IMap.emplace(std::piecewise_construct, std::forward_as_tuple(Slot), - std::forward_as_tuple( - TargetRegisterInfo::index2StackSlot(Slot), 0.0F)) - .first; - S2RCMap.insert(std::make_pair(Slot, RC)); - } else { - // Use the largest common subclass register class. - const TargetRegisterClass *OldRC = S2RCMap[Slot]; - S2RCMap[Slot] = TRI->getCommonSubClass(OldRC, RC); - } - return I->second; -} - -/// print - Implement the dump method. -void LiveStacks::print(raw_ostream &OS, const Module*) const { - - OS << "********** INTERVALS **********\n"; - for (const_iterator I = begin(), E = end(); I != E; ++I) { - I->second.print(OS); - int Slot = I->first; - const TargetRegisterClass *RC = getIntervalRegClass(Slot); - if (RC) - OS << " [" << TRI->getRegClassName(RC) << "]\n"; - else - OS << " [Unknown]\n"; - } -} diff --git a/gnu/llvm/lib/DebugInfo/CodeView/TypeName.cpp b/gnu/llvm/lib/DebugInfo/CodeView/TypeName.cpp deleted file mode 100644 index 2eb8b81862f..00000000000 --- a/gnu/llvm/lib/DebugInfo/CodeView/TypeName.cpp +++ /dev/null @@ -1,243 +0,0 @@ -//===- TypeName.cpp ------------------------------------------- *- C++ --*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/DebugInfo/CodeView/TypeName.h" - -#include "llvm/ADT/SmallString.h" -#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" -#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h" -#include "llvm/Support/FormatVariadic.h" - -using namespace llvm; -using namespace llvm::codeview; - -namespace { -class TypeNameComputer : public TypeVisitorCallbacks { - /// The type collection. Used to calculate names of nested types. - TypeCollection &Types; - TypeIndex CurrentTypeIndex = TypeIndex::None(); - - /// Name of the current type. Only valid before visitTypeEnd. - SmallString<256> Name; - -public: - explicit TypeNameComputer(TypeCollection &Types) : Types(Types) {} - - StringRef name() const { return Name; } - - /// Paired begin/end actions for all types. Receives all record data, - /// including the fixed-length record prefix. - Error visitTypeBegin(CVType &Record) override; - Error visitTypeBegin(CVType &Record, TypeIndex Index) override; - Error visitTypeEnd(CVType &Record) override; - -#define TYPE_RECORD(EnumName, EnumVal, Name) \ - Error visitKnownRecord(CVType &CVR, Name##Record &Record) override; -#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) -#define MEMBER_RECORD(EnumName, EnumVal, Name) -#include "llvm/DebugInfo/CodeView/CodeViewTypes.def" -}; -} // namespace - -Error TypeNameComputer::visitTypeBegin(CVType &Record) { - llvm_unreachable("Must call visitTypeBegin with a TypeIndex!"); - return Error::success(); -} - -Error TypeNameComputer::visitTypeBegin(CVType &Record, TypeIndex Index) { - // Reset Name to the empty string. If the visitor sets it, we know it. - Name = ""; - CurrentTypeIndex = Index; - return Error::success(); -} - -Error TypeNameComputer::visitTypeEnd(CVType &CVR) { return Error::success(); } - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, - FieldListRecord &FieldList) { - Name = "<field list>"; - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVRecord<TypeLeafKind> &CVR, - StringIdRecord &String) { - Name = String.getString(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, ArgListRecord &Args) { - auto Indices = Args.getIndices(); - uint32_t Size = Indices.size(); - Name = "("; - for (uint32_t I = 0; I < Size; ++I) { - assert(Indices[I] < CurrentTypeIndex); - - Name.append(Types.getTypeName(Indices[I])); - if (I + 1 != Size) - Name.append(", "); - } - Name.push_back(')'); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, - StringListRecord &Strings) { - auto Indices = Strings.getIndices(); - uint32_t Size = Indices.size(); - Name = "\""; - for (uint32_t I = 0; I < Size; ++I) { - Name.append(Types.getTypeName(Indices[I])); - if (I + 1 != Size) - Name.append("\" \""); - } - Name.push_back('\"'); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, ClassRecord &Class) { - Name = Class.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, UnionRecord &Union) { - Name = Union.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, EnumRecord &Enum) { - Name = Enum.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, ArrayRecord &AT) { - Name = AT.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, VFTableRecord &VFT) { - Name = VFT.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, MemberFuncIdRecord &Id) { - Name = Id.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, ProcedureRecord &Proc) { - StringRef Ret = Types.getTypeName(Proc.getReturnType()); - StringRef Params = Types.getTypeName(Proc.getArgumentList()); - Name = formatv("{0} {1}", Ret, Params).sstr<256>(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, - MemberFunctionRecord &MF) { - StringRef Ret = Types.getTypeName(MF.getReturnType()); - StringRef Class = Types.getTypeName(MF.getClassType()); - StringRef Params = Types.getTypeName(MF.getArgumentList()); - Name = formatv("{0} {1}::{2}", Ret, Class, Params).sstr<256>(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, FuncIdRecord &Func) { - Name = Func.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, TypeServer2Record &TS) { - Name = TS.getName(); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, PointerRecord &Ptr) { - - if (Ptr.isPointerToMember()) { - const MemberPointerInfo &MI = Ptr.getMemberInfo(); - - StringRef Pointee = Types.getTypeName(Ptr.getReferentType()); - StringRef Class = Types.getTypeName(MI.getContainingType()); - Name = formatv("{0} {1}::*", Pointee, Class); - } else { - if (Ptr.isConst()) - Name.append("const "); - if (Ptr.isVolatile()) - Name.append("volatile "); - if (Ptr.isUnaligned()) - Name.append("__unaligned "); - - Name.append(Types.getTypeName(Ptr.getReferentType())); - - if (Ptr.getMode() == PointerMode::LValueReference) - Name.append("&"); - else if (Ptr.getMode() == PointerMode::RValueReference) - Name.append("&&"); - else if (Ptr.getMode() == PointerMode::Pointer) - Name.append("*"); - } - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, ModifierRecord &Mod) { - uint16_t Mods = static_cast<uint16_t>(Mod.getModifiers()); - - SmallString<256> TypeName; - if (Mods & uint16_t(ModifierOptions::Const)) - Name.append("const "); - if (Mods & uint16_t(ModifierOptions::Volatile)) - Name.append("volatile "); - if (Mods & uint16_t(ModifierOptions::Unaligned)) - Name.append("__unaligned "); - Name.append(Types.getTypeName(Mod.getModifiedType())); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, - VFTableShapeRecord &Shape) { - Name = formatv("<vftable {0} methods>", Shape.getEntryCount()); - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord( - CVType &CVR, UdtModSourceLineRecord &ModSourceLine) { - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, - UdtSourceLineRecord &SourceLine) { - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, BitFieldRecord &BF) { - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, - MethodOverloadListRecord &Overloads) { - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, BuildInfoRecord &BI) { - return Error::success(); -} - -Error TypeNameComputer::visitKnownRecord(CVType &CVR, LabelRecord &R) { - return Error::success(); -} - -std::string llvm::codeview::computeTypeName(TypeCollection &Types, - TypeIndex Index) { - TypeNameComputer Computer(Types); - CVType Record = Types.getType(Index); - if (auto EC = visitTypeRecord(Record, Index, Computer)) { - consumeError(std::move(EC)); - return "<unknown UDT>"; - } - return Computer.name(); -} diff --git a/gnu/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp b/gnu/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp deleted file mode 100644 index f24fcff8627..00000000000 --- a/gnu/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp +++ /dev/null @@ -1,243 +0,0 @@ -//===- TypeSerialzier.cpp ---------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/DebugInfo/CodeView/TypeSerializer.h" - -#include "llvm/DebugInfo/MSF/StreamWriter.h" - -#include <string.h> - -using namespace llvm; -using namespace llvm::codeview; - -bool TypeSerializer::isInFieldList() const { - return TypeKind.hasValue() && *TypeKind == TypeLeafKind::LF_FIELDLIST; -} - -TypeIndex TypeSerializer::calcNextTypeIndex() const { - if (LastTypeIndex.isNoneType()) - return TypeIndex(TypeIndex::FirstNonSimpleIndex); - else - return TypeIndex(LastTypeIndex.getIndex() + 1); -} - -TypeIndex TypeSerializer::incrementTypeIndex() { - TypeIndex Previous = LastTypeIndex; - LastTypeIndex = calcNextTypeIndex(); - return Previous; -} - -MutableArrayRef<uint8_t> TypeSerializer::getCurrentSubRecordData() { - assert(isInFieldList()); - return getCurrentRecordData().drop_front(CurrentSegment.length()); -} - -MutableArrayRef<uint8_t> TypeSerializer::getCurrentRecordData() { - return MutableArrayRef<uint8_t>(RecordBuffer).take_front(Writer.getOffset()); -} - -Error TypeSerializer::writeRecordPrefix(TypeLeafKind Kind) { - RecordPrefix Prefix; - Prefix.RecordKind = Kind; - Prefix.RecordLen = 0; - if (auto EC = Writer.writeObject(Prefix)) - return EC; - return Error::success(); -} - -TypeIndex -TypeSerializer::insertRecordBytesPrivate(MutableArrayRef<uint8_t> Record) { - assert(Record.size() % 4 == 0 && "Record is not aligned to 4 bytes!"); - - StringRef S(reinterpret_cast<const char *>(Record.data()), Record.size()); - - TypeIndex NextTypeIndex = calcNextTypeIndex(); - auto Result = HashedRecords.try_emplace(S, NextTypeIndex); - if (Result.second) { - LastTypeIndex = NextTypeIndex; - SeenRecords.push_back(Record); - } - return Result.first->getValue(); -} - -Expected<MutableArrayRef<uint8_t>> -TypeSerializer::addPadding(MutableArrayRef<uint8_t> Record) { - uint32_t Align = Record.size() % 4; - if (Align == 0) - return Record; - - int PaddingBytes = 4 - Align; - int N = PaddingBytes; - while (PaddingBytes > 0) { - uint8_t Pad = static_cast<uint8_t>(LF_PAD0 + PaddingBytes); - if (auto EC = Writer.writeInteger(Pad)) - return std::move(EC); - --PaddingBytes; - } - return MutableArrayRef<uint8_t>(Record.data(), Record.size() + N); -} - -TypeSerializer::TypeSerializer(BumpPtrAllocator &Storage) - : RecordStorage(Storage), LastTypeIndex(), - RecordBuffer(MaxRecordLength * 2), Stream(RecordBuffer), Writer(Stream), - Mapping(Writer) { - // RecordBuffer needs to be able to hold enough data so that if we are 1 - // byte short of MaxRecordLen, and then we try to write MaxRecordLen bytes, - // we won't overflow. -} - -ArrayRef<MutableArrayRef<uint8_t>> TypeSerializer::records() const { - return SeenRecords; -} - -TypeIndex TypeSerializer::getLastTypeIndex() const { return LastTypeIndex; } - -TypeIndex TypeSerializer::insertRecordBytes(MutableArrayRef<uint8_t> Record) { - assert(!TypeKind.hasValue() && "Already in a type mapping!"); - assert(Writer.getOffset() == 0 && "Stream has data already!"); - - return insertRecordBytesPrivate(Record); -} - -Error TypeSerializer::visitTypeBegin(CVType &Record) { - assert(!TypeKind.hasValue() && "Already in a type mapping!"); - assert(Writer.getOffset() == 0 && "Stream has data already!"); - - if (auto EC = writeRecordPrefix(Record.kind())) - return EC; - - TypeKind = Record.kind(); - if (auto EC = Mapping.visitTypeBegin(Record)) - return EC; - - return Error::success(); -} - -Expected<TypeIndex> TypeSerializer::visitTypeEndGetIndex(CVType &Record) { - assert(TypeKind.hasValue() && "Not in a type mapping!"); - if (auto EC = Mapping.visitTypeEnd(Record)) - return std::move(EC); - - // Update the record's length and fill out the CVType members to point to - // the stable memory holding the record's data. - auto ThisRecordData = getCurrentRecordData(); - auto ExpectedData = addPadding(ThisRecordData); - if (!ExpectedData) - return ExpectedData.takeError(); - ThisRecordData = *ExpectedData; - - RecordPrefix *Prefix = - reinterpret_cast<RecordPrefix *>(ThisRecordData.data()); - Prefix->RecordLen = ThisRecordData.size() - sizeof(uint16_t); - - uint8_t *Copy = RecordStorage.Allocate<uint8_t>(ThisRecordData.size()); - ::memcpy(Copy, ThisRecordData.data(), ThisRecordData.size()); - ThisRecordData = MutableArrayRef<uint8_t>(Copy, ThisRecordData.size()); - Record = CVType(*TypeKind, ThisRecordData); - TypeIndex InsertedTypeIndex = insertRecordBytesPrivate(ThisRecordData); - - // Write out each additional segment in reverse order, and update each - // record's continuation index to point to the previous one. - for (auto X : reverse(FieldListSegments)) { - auto CIBytes = X.take_back(sizeof(uint32_t)); - support::ulittle32_t *CI = - reinterpret_cast<support::ulittle32_t *>(CIBytes.data()); - assert(*CI == 0xB0C0B0C0 && "Invalid TypeIndex placeholder"); - *CI = InsertedTypeIndex.getIndex(); - InsertedTypeIndex = insertRecordBytesPrivate(X); - } - - TypeKind.reset(); - Writer.setOffset(0); - FieldListSegments.clear(); - CurrentSegment.SubRecords.clear(); - - return InsertedTypeIndex; -} - -Error TypeSerializer::visitTypeEnd(CVType &Record) { - auto ExpectedIndex = visitTypeEndGetIndex(Record); - if (!ExpectedIndex) - return ExpectedIndex.takeError(); - return Error::success(); -} - -Error TypeSerializer::visitMemberBegin(CVMemberRecord &Record) { - assert(isInFieldList() && "Not in a field list!"); - assert(!MemberKind.hasValue() && "Already in a member record!"); - MemberKind = Record.Kind; - - if (auto EC = Mapping.visitMemberBegin(Record)) - return EC; - - return Error::success(); -} - -Error TypeSerializer::visitMemberEnd(CVMemberRecord &Record) { - if (auto EC = Mapping.visitMemberEnd(Record)) - return EC; - - // Check if this subrecord makes the current segment not fit in 64K minus - // the space for a continuation record (8 bytes). If the segment does not - // fit, insert a continuation record. - if (Writer.getOffset() > MaxRecordLength - ContinuationLength) { - MutableArrayRef<uint8_t> Data = getCurrentRecordData(); - SubRecord LastSubRecord = CurrentSegment.SubRecords.back(); - uint32_t CopySize = CurrentSegment.length() - LastSubRecord.Size; - auto CopyData = Data.take_front(CopySize); - auto LeftOverData = Data.drop_front(CopySize); - assert(LastSubRecord.Size == LeftOverData.size()); - - // Allocate stable storage for the record and copy the old record plus - // continuation over. - uint16_t LengthWithSize = CopySize + ContinuationLength; - assert(LengthWithSize <= MaxRecordLength); - RecordPrefix *Prefix = reinterpret_cast<RecordPrefix *>(CopyData.data()); - Prefix->RecordLen = LengthWithSize - sizeof(uint16_t); - - uint8_t *SegmentBytes = RecordStorage.Allocate<uint8_t>(LengthWithSize); - auto SavedSegment = MutableArrayRef<uint8_t>(SegmentBytes, LengthWithSize); - msf::MutableByteStream CS(SavedSegment); - msf::StreamWriter CW(CS); - if (auto EC = CW.writeBytes(CopyData)) - return EC; - if (auto EC = CW.writeEnum(TypeLeafKind::LF_INDEX)) - return EC; - if (auto EC = CW.writeInteger(uint16_t(0))) - return EC; - if (auto EC = CW.writeInteger(uint32_t(0xB0C0B0C0))) - return EC; - FieldListSegments.push_back(SavedSegment); - - // Write a new placeholder record prefix to mark the start of this new - // top-level record. - Writer.setOffset(0); - if (auto EC = writeRecordPrefix(TypeLeafKind::LF_FIELDLIST)) - return EC; - - // Then move over the subrecord that overflowed the old segment to the - // beginning of this segment. Note that we have to use memmove here - // instead of Writer.writeBytes(), because the new and old locations - // could overlap. - ::memmove(Stream.data().data() + sizeof(RecordPrefix), LeftOverData.data(), - LeftOverData.size()); - // And point the segment writer at the end of that subrecord. - Writer.setOffset(LeftOverData.size() + sizeof(RecordPrefix)); - - CurrentSegment.SubRecords.clear(); - CurrentSegment.SubRecords.push_back(LastSubRecord); - } - - // Update the CVMemberRecord since we may have shifted around or gotten - // padded. - Record.Data = getCurrentSubRecordData(); - - MemberKind.reset(); - return Error::success(); -} diff --git a/gnu/llvm/lib/DebugInfo/PDB/Native/GSI.cpp b/gnu/llvm/lib/DebugInfo/PDB/Native/GSI.cpp deleted file mode 100644 index b219fe275f7..00000000000 --- a/gnu/llvm/lib/DebugInfo/PDB/Native/GSI.cpp +++ /dev/null @@ -1,93 +0,0 @@ -//===- GSI.cpp - Common Functions for GlobalsStream and PublicsStream ----===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "GSI.h" - -#include "llvm/DebugInfo/PDB/Native/RawError.h" -#include "llvm/DebugInfo/PDB/Native/RawTypes.h" -#include "llvm/Support/BinaryStreamArray.h" -#include "llvm/Support/BinaryStreamReader.h" - -#include "llvm/Support/Error.h" - -namespace llvm { -namespace pdb { - -static Error checkHashHdrVersion(const GSIHashHeader *HashHdr) { - if (HashHdr->VerHdr != GSIHashHeader::HdrVersion) - return make_error<RawError>( - raw_error_code::feature_unsupported, - "Encountered unsupported globals stream version."); - - return Error::success(); -} - -Error readGSIHashBuckets(FixedStreamArray<support::ulittle32_t> &HashBuckets, - const GSIHashHeader *HashHdr, - BinaryStreamReader &Reader) { - if (auto EC = checkHashHdrVersion(HashHdr)) - return EC; - - // Before the actual hash buckets, there is a bitmap of length determined by - // IPHR_HASH. - ArrayRef<uint8_t> Bitmap; - size_t BitmapSizeInBits = alignTo(IPHR_HASH + 1, 32); - uint32_t NumBitmapEntries = BitmapSizeInBits / 8; - if (auto EC = Reader.readBytes(Bitmap, NumBitmapEntries)) - return joinErrors(std::move(EC), - make_error<RawError>(raw_error_code::corrupt_file, - "Could not read a bitmap.")); - uint32_t NumBuckets = 0; - for (uint8_t B : Bitmap) - NumBuckets += countPopulation(B); - - // Hash buckets follow. - if (auto EC = Reader.readArray(HashBuckets, NumBuckets)) - return joinErrors(std::move(EC), - make_error<RawError>(raw_error_code::corrupt_file, - "Hash buckets corrupted.")); - - return Error::success(); -} - -Error readGSIHashHeader(const GSIHashHeader *&HashHdr, - BinaryStreamReader &Reader) { - if (Reader.readObject(HashHdr)) - return make_error<RawError>(raw_error_code::corrupt_file, - "Stream does not contain a GSIHashHeader."); - - if (HashHdr->VerSignature != GSIHashHeader::HdrSignature) - return make_error<RawError>( - raw_error_code::feature_unsupported, - "GSIHashHeader signature (0xffffffff) not found."); - - return Error::success(); -} - -Error readGSIHashRecords(FixedStreamArray<PSHashRecord> &HashRecords, - const GSIHashHeader *HashHdr, - BinaryStreamReader &Reader) { - if (auto EC = checkHashHdrVersion(HashHdr)) - return EC; - - // HashHdr->HrSize specifies the number of bytes of PSHashRecords we have. - // Verify that we can read them all. - if (HashHdr->HrSize % sizeof(PSHashRecord)) - return make_error<RawError>(raw_error_code::corrupt_file, - "Invalid HR array size."); - uint32_t NumHashRecords = HashHdr->HrSize / sizeof(PSHashRecord); - if (auto EC = Reader.readArray(HashRecords, NumHashRecords)) - return joinErrors(std::move(EC), - make_error<RawError>(raw_error_code::corrupt_file, - "Error reading hash records.")); - - return Error::success(); -} -} -} diff --git a/gnu/llvm/lib/DebugInfo/PDB/Native/GSI.h b/gnu/llvm/lib/DebugInfo/PDB/Native/GSI.h deleted file mode 100644 index 9e63bc83548..00000000000 --- a/gnu/llvm/lib/DebugInfo/PDB/Native/GSI.h +++ /dev/null @@ -1,68 +0,0 @@ -//===- GSI.h - Common Declarations for GlobalsStream and PublicsStream ----===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// The data structures defined in this file are based on the reference -// implementation which is available at -// https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h -// -// When you are reading the reference source code, you'd find the -// information below useful. -// -// - ppdb1->m_fMinimalDbgInfo seems to be always true. -// - SMALLBUCKETS macro is defined. -// -// The reference doesn't compile, so I learned just by reading code. -// It's not guaranteed to be correct. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_LIB_DEBUGINFO_PDB_RAW_GSI_H -#define LLVM_LIB_DEBUGINFO_PDB_RAW_GSI_H - -#include "llvm/DebugInfo/PDB/Native/RawTypes.h" -#include "llvm/Support/BinaryStreamArray.h" - -#include "llvm/Support/Endian.h" -#include "llvm/Support/Error.h" - -namespace llvm { - -class BinaryStreamReader; - -namespace pdb { - -/// From https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.cpp -static const unsigned IPHR_HASH = 4096; - -/// Header of the hash tables found in the globals and publics sections. -/// Based on GSIHashHeader in -/// https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h -struct GSIHashHeader { - enum : unsigned { - HdrSignature = ~0U, - HdrVersion = 0xeffe0000 + 19990810, - }; - support::ulittle32_t VerSignature; - support::ulittle32_t VerHdr; - support::ulittle32_t HrSize; - support::ulittle32_t NumBuckets; -}; - -Error readGSIHashBuckets(FixedStreamArray<support::ulittle32_t> &HashBuckets, - const GSIHashHeader *HashHdr, - BinaryStreamReader &Reader); -Error readGSIHashHeader(const GSIHashHeader *&HashHdr, - BinaryStreamReader &Reader); -Error readGSIHashRecords(FixedStreamArray<PSHashRecord> &HashRecords, - const GSIHashHeader *HashHdr, - BinaryStreamReader &Reader); -} -} - -#endif diff --git a/gnu/llvm/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp b/gnu/llvm/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp deleted file mode 100644 index 28c4a8fc35d..00000000000 --- a/gnu/llvm/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp +++ /dev/null @@ -1,89 +0,0 @@ -//===- DbiStreamBuilder.cpp - PDB Dbi Stream Creation -----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.h" - -#include "llvm/DebugInfo/MSF/MSFBuilder.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" - -#include "GSI.h" - -using namespace llvm; -using namespace llvm::msf; -using namespace llvm::pdb; - -PublicsStreamBuilder::PublicsStreamBuilder(msf::MSFBuilder &Msf) : Msf(Msf) {} - -PublicsStreamBuilder::~PublicsStreamBuilder() {} - -uint32_t PublicsStreamBuilder::calculateSerializedLength() const { - uint32_t Size = 0; - Size += sizeof(PublicsStreamHeader); - Size += sizeof(GSIHashHeader); - Size += HashRecords.size() * sizeof(PSHashRecord); - size_t BitmapSizeInBits = alignTo(IPHR_HASH + 1, 32); - uint32_t NumBitmapEntries = BitmapSizeInBits / 8; - Size += NumBitmapEntries; - - // FIXME: Account for hash buckets. For now since we we write a zero-bitmap - // indicating that no hash buckets are valid, we also write zero byets of hash - // bucket data. - Size += 0; - return Size; -} - -Error PublicsStreamBuilder::finalizeMsfLayout() { - Expected<uint32_t> Idx = Msf.addStream(calculateSerializedLength()); - if (!Idx) - return Idx.takeError(); - StreamIdx = *Idx; - - Expected<uint32_t> RecordIdx = Msf.addStream(0); - if (!RecordIdx) - return RecordIdx.takeError(); - RecordStreamIdx = *RecordIdx; - return Error::success(); -} - -Error PublicsStreamBuilder::commit(BinaryStreamWriter &PublicsWriter) { - PublicsStreamHeader PSH; - GSIHashHeader GSH; - - // FIXME: Figure out what to put for these values. - PSH.AddrMap = 0; - PSH.ISectThunkTable = 0; - PSH.NumSections = 0; - PSH.NumThunks = 0; - PSH.OffThunkTable = 0; - PSH.SizeOfThunk = 0; - PSH.SymHash = 0; - - GSH.VerSignature = GSIHashHeader::HdrSignature; - GSH.VerHdr = GSIHashHeader::HdrVersion; - GSH.HrSize = 0; - GSH.NumBuckets = 0; - - if (auto EC = PublicsWriter.writeObject(PSH)) - return EC; - if (auto EC = PublicsWriter.writeObject(GSH)) - return EC; - if (auto EC = PublicsWriter.writeArray(makeArrayRef(HashRecords))) - return EC; - - size_t BitmapSizeInBits = alignTo(IPHR_HASH + 1, 32); - uint32_t NumBitmapEntries = BitmapSizeInBits / 8; - std::vector<uint8_t> BitmapData(NumBitmapEntries); - // FIXME: Build an actual bitmap - if (auto EC = PublicsWriter.writeBytes(makeArrayRef(BitmapData))) - return EC; - - // FIXME: Write actual hash buckets. - return Error::success(); -} diff --git a/gnu/llvm/lib/Fuzzer/CMakeLists.txt b/gnu/llvm/lib/Fuzzer/CMakeLists.txt deleted file mode 100644 index d4d85041d21..00000000000 --- a/gnu/llvm/lib/Fuzzer/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS_RELEASE}") -# Disable the coverage and sanitizer instrumentation for the fuzzer itself. -set(CMAKE_CXX_FLAGS_RELEASE "${LIBFUZZER_FLAGS_BASE} -O2 -fno-sanitize=all") -if( LLVM_USE_SANITIZE_COVERAGE ) - add_library(LLVMFuzzerNoMainObjects OBJECT - FuzzerCrossOver.cpp - FuzzerInterface.cpp - FuzzerTraceState.cpp - FuzzerDriver.cpp - FuzzerIO.cpp - FuzzerLoop.cpp - FuzzerMutate.cpp - FuzzerSanitizerOptions.cpp - FuzzerSHA1.cpp - FuzzerUtil.cpp - ) - add_library(LLVMFuzzerNoMain STATIC - $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects> - ) - if( HAVE_LIBPTHREAD ) - target_link_libraries(LLVMFuzzerNoMain pthread) - endif() - add_library(LLVMFuzzer STATIC - FuzzerMain.cpp - $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects> - ) - if( HAVE_LIBPTHREAD ) - target_link_libraries(LLVMFuzzer pthread) - endif() - - if( LLVM_INCLUDE_TESTS ) - add_subdirectory(test) - endif() -endif() diff --git a/gnu/llvm/lib/Fuzzer/FuzzerCorpus.h b/gnu/llvm/lib/Fuzzer/FuzzerCorpus.h deleted file mode 100644 index 468d5e5ddc7..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerCorpus.h +++ /dev/null @@ -1,224 +0,0 @@ -//===- FuzzerCorpus.h - Internal header for the Fuzzer ----------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// fuzzer::InputCorpus -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_CORPUS -#define LLVM_FUZZER_CORPUS - -#include "FuzzerDefs.h" -#include "FuzzerIO.h" -#include "FuzzerRandom.h" -#include "FuzzerSHA1.h" -#include "FuzzerTracePC.h" -#include <algorithm> -#include <numeric> -#include <random> -#include <unordered_set> - -namespace fuzzer { - -struct InputInfo { - Unit U; // The actual input data. - uint8_t Sha1[kSHA1NumBytes]; // Checksum. - // Number of features that this input has and no smaller input has. - size_t NumFeatures = 0; - size_t Tmp = 0; // Used by ValidateFeatureSet. - // Stats. - size_t NumExecutedMutations = 0; - size_t NumSuccessfullMutations = 0; - bool MayDeleteFile = false; -}; - -class InputCorpus { - public: - static const size_t kFeatureSetSize = 1 << 16; - InputCorpus(const std::string &OutputCorpus) : OutputCorpus(OutputCorpus) { - memset(InputSizesPerFeature, 0, sizeof(InputSizesPerFeature)); - memset(SmallestElementPerFeature, 0, sizeof(SmallestElementPerFeature)); - } - ~InputCorpus() { - for (auto II : Inputs) - delete II; - } - size_t size() const { return Inputs.size(); } - size_t SizeInBytes() const { - size_t Res = 0; - for (auto II : Inputs) - Res += II->U.size(); - return Res; - } - size_t NumActiveUnits() const { - size_t Res = 0; - for (auto II : Inputs) - Res += !II->U.empty(); - return Res; - } - size_t MaxInputSize() const { - size_t Res = 0; - for (auto II : Inputs) - Res = std::max(Res, II->U.size()); - return Res; - } - bool empty() const { return Inputs.empty(); } - const Unit &operator[] (size_t Idx) const { return Inputs[Idx]->U; } - void AddToCorpus(const Unit &U, size_t NumFeatures, bool MayDeleteFile = false) { - assert(!U.empty()); - uint8_t Hash[kSHA1NumBytes]; - if (FeatureDebug) - Printf("ADD_TO_CORPUS %zd NF %zd\n", Inputs.size(), NumFeatures); - ComputeSHA1(U.data(), U.size(), Hash); - Hashes.insert(Sha1ToString(Hash)); - Inputs.push_back(new InputInfo()); - InputInfo &II = *Inputs.back(); - II.U = U; - II.NumFeatures = NumFeatures; - II.MayDeleteFile = MayDeleteFile; - memcpy(II.Sha1, Hash, kSHA1NumBytes); - UpdateCorpusDistribution(); - ValidateFeatureSet(); - } - - bool HasUnit(const Unit &U) { return Hashes.count(Hash(U)); } - bool HasUnit(const std::string &H) { return Hashes.count(H); } - InputInfo &ChooseUnitToMutate(Random &Rand) { - InputInfo &II = *Inputs[ChooseUnitIdxToMutate(Rand)]; - assert(!II.U.empty()); - return II; - }; - - // Returns an index of random unit from the corpus to mutate. - // Hypothesis: units added to the corpus last are more likely to be - // interesting. This function gives more weight to the more recent units. - size_t ChooseUnitIdxToMutate(Random &Rand) { - size_t Idx = static_cast<size_t>(CorpusDistribution(Rand.Get_mt19937())); - assert(Idx < Inputs.size()); - return Idx; - } - - void PrintStats() { - for (size_t i = 0; i < Inputs.size(); i++) { - const auto &II = *Inputs[i]; - Printf(" [%zd %s]\tsz: %zd\truns: %zd\tsucc: %zd\n", i, - Sha1ToString(II.Sha1).c_str(), II.U.size(), - II.NumExecutedMutations, II.NumSuccessfullMutations); - } - } - - void PrintFeatureSet() { - for (size_t i = 0; i < kFeatureSetSize; i++) { - if(size_t Sz = GetFeature(i)) - Printf("[%zd: id %zd sz%zd] ", i, SmallestElementPerFeature[i], Sz); - } - Printf("\n\t"); - for (size_t i = 0; i < Inputs.size(); i++) - if (size_t N = Inputs[i]->NumFeatures) - Printf(" %zd=>%zd ", i, N); - Printf("\n"); - } - - void DeleteInput(size_t Idx) { - InputInfo &II = *Inputs[Idx]; - if (!OutputCorpus.empty() && II.MayDeleteFile) - RemoveFile(DirPlusFile(OutputCorpus, Sha1ToString(II.Sha1))); - Unit().swap(II.U); - if (FeatureDebug) - Printf("EVICTED %zd\n", Idx); - } - - bool AddFeature(size_t Idx, uint32_t NewSize, bool Shrink) { - assert(NewSize); - Idx = Idx % kFeatureSetSize; - uint32_t OldSize = GetFeature(Idx); - if (OldSize == 0 || (Shrink && OldSize > NewSize)) { - if (OldSize > 0) { - size_t OldIdx = SmallestElementPerFeature[Idx]; - InputInfo &II = *Inputs[OldIdx]; - assert(II.NumFeatures > 0); - II.NumFeatures--; - if (II.NumFeatures == 0) - DeleteInput(OldIdx); - } - if (FeatureDebug) - Printf("ADD FEATURE %zd sz %d\n", Idx, NewSize); - SmallestElementPerFeature[Idx] = Inputs.size(); - InputSizesPerFeature[Idx] = NewSize; - CountingFeatures = true; - return true; - } - return false; - } - - size_t NumFeatures() const { - size_t Res = 0; - for (size_t i = 0; i < kFeatureSetSize; i++) - Res += GetFeature(i) != 0; - return Res; - } - - void ResetFeatureSet() { - assert(Inputs.empty()); - memset(InputSizesPerFeature, 0, sizeof(InputSizesPerFeature)); - memset(SmallestElementPerFeature, 0, sizeof(SmallestElementPerFeature)); - } - -private: - - static const bool FeatureDebug = false; - - size_t GetFeature(size_t Idx) const { return InputSizesPerFeature[Idx]; } - - void ValidateFeatureSet() { - if (!CountingFeatures) return; - if (FeatureDebug) - PrintFeatureSet(); - for (size_t Idx = 0; Idx < kFeatureSetSize; Idx++) - if (GetFeature(Idx)) - Inputs[SmallestElementPerFeature[Idx]]->Tmp++; - for (auto II: Inputs) { - if (II->Tmp != II->NumFeatures) - Printf("ZZZ %zd %zd\n", II->Tmp, II->NumFeatures); - assert(II->Tmp == II->NumFeatures); - II->Tmp = 0; - } - } - - // Updates the probability distribution for the units in the corpus. - // Must be called whenever the corpus or unit weights are changed. - void UpdateCorpusDistribution() { - size_t N = Inputs.size(); - Intervals.resize(N + 1); - Weights.resize(N); - std::iota(Intervals.begin(), Intervals.end(), 0); - if (CountingFeatures) - for (size_t i = 0; i < N; i++) - Weights[i] = Inputs[i]->NumFeatures * (i + 1); - else - std::iota(Weights.begin(), Weights.end(), 1); - CorpusDistribution = std::piecewise_constant_distribution<double>( - Intervals.begin(), Intervals.end(), Weights.begin()); - } - std::piecewise_constant_distribution<double> CorpusDistribution; - - std::vector<double> Intervals; - std::vector<double> Weights; - - std::unordered_set<std::string> Hashes; - std::vector<InputInfo*> Inputs; - - bool CountingFeatures = false; - uint32_t InputSizesPerFeature[kFeatureSetSize]; - uint32_t SmallestElementPerFeature[kFeatureSetSize]; - - std::string OutputCorpus; -}; - -} // namespace fuzzer - -#endif // LLVM_FUZZER_CORPUS diff --git a/gnu/llvm/lib/Fuzzer/FuzzerCrossOver.cpp b/gnu/llvm/lib/Fuzzer/FuzzerCrossOver.cpp deleted file mode 100644 index 5203deaf912..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerCrossOver.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===- FuzzerCrossOver.cpp - Cross over two test inputs -------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Cross over test inputs. -//===----------------------------------------------------------------------===// - -#include <cstring> - -#include "FuzzerInternal.h" - -namespace fuzzer { - -// Cross Data1 and Data2, store the result (up to MaxOutSize bytes) in Out. -size_t MutationDispatcher::CrossOver(const uint8_t *Data1, size_t Size1, - const uint8_t *Data2, size_t Size2, - uint8_t *Out, size_t MaxOutSize) { - assert(Size1 || Size2); - MaxOutSize = Rand(MaxOutSize) + 1; - size_t OutPos = 0; - size_t Pos1 = 0; - size_t Pos2 = 0; - size_t *InPos = &Pos1; - size_t InSize = Size1; - const uint8_t *Data = Data1; - bool CurrentlyUsingFirstData = true; - while (OutPos < MaxOutSize && (Pos1 < Size1 || Pos2 < Size2)) { - // Merge a part of Data into Out. - size_t OutSizeLeft = MaxOutSize - OutPos; - if (*InPos < InSize) { - size_t InSizeLeft = InSize - *InPos; - size_t MaxExtraSize = std::min(OutSizeLeft, InSizeLeft); - size_t ExtraSize = Rand(MaxExtraSize) + 1; - memcpy(Out + OutPos, Data + *InPos, ExtraSize); - OutPos += ExtraSize; - (*InPos) += ExtraSize; - } - // Use the other input data on the next iteration. - InPos = CurrentlyUsingFirstData ? &Pos2 : &Pos1; - InSize = CurrentlyUsingFirstData ? Size2 : Size1; - Data = CurrentlyUsingFirstData ? Data2 : Data1; - CurrentlyUsingFirstData = !CurrentlyUsingFirstData; - } - return OutPos; -} - -} // namespace fuzzer diff --git a/gnu/llvm/lib/Fuzzer/FuzzerDefs.h b/gnu/llvm/lib/Fuzzer/FuzzerDefs.h deleted file mode 100644 index 0f5b8a7cf21..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerDefs.h +++ /dev/null @@ -1,89 +0,0 @@ -//===- FuzzerDefs.h - Internal header for the Fuzzer ------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Basic definitions. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_DEFS_H -#define LLVM_FUZZER_DEFS_H - -#include <cassert> -#include <cstddef> -#include <cstdint> -#include <cstring> -#include <string> -#include <vector> - -// Platform detection. -#ifdef __linux__ -#define LIBFUZZER_APPLE 0 -#define LIBFUZZER_LINUX 1 -#define LIBFUZZER_WINDOWS 0 -#elif __APPLE__ -#define LIBFUZZER_APPLE 1 -#define LIBFUZZER_LINUX 0 -#define LIBFUZZER_WINDOWS 0 -#elif _WIN32 -#define LIBFUZZER_APPLE 0 -#define LIBFUZZER_LINUX 0 -#define LIBFUZZER_WINDOWS 1 -#else -#error "Support for your platform has not been implemented" -#endif - -#define LIBFUZZER_POSIX LIBFUZZER_APPLE || LIBFUZZER_LINUX - -#ifdef __x86_64 -#define ATTRIBUTE_TARGET_POPCNT __attribute__((target("popcnt"))) -#else -#define ATTRIBUTE_TARGET_POPCNT -#endif - - -#ifdef __clang__ // avoid gcc warning. -# define ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory"))) -#else -# define ATTRIBUTE_NO_SANITIZE_MEMORY -#endif - -namespace fuzzer { - -template <class T> T Min(T a, T b) { return a < b ? a : b; } -template <class T> T Max(T a, T b) { return a > b ? a : b; } - -class Random; -class Dictionary; -class DictionaryEntry; -class MutationDispatcher; -struct FuzzingOptions; -class InputCorpus; -struct InputInfo; -struct ExternalFunctions; - -// Global interface to functions that may or may not be available. -extern ExternalFunctions *EF; - -typedef std::vector<uint8_t> Unit; -typedef std::vector<Unit> UnitVector; -typedef int (*UserCallback)(const uint8_t *Data, size_t Size); - -int FuzzerDriver(int *argc, char ***argv, UserCallback Callback); - -struct ScopedDoingMyOwnMemmem { - ScopedDoingMyOwnMemmem(); - ~ScopedDoingMyOwnMemmem(); -}; - -inline uint8_t Bswap(uint8_t x) { return x; } -inline uint16_t Bswap(uint16_t x) { return __builtin_bswap16(x); } -inline uint32_t Bswap(uint32_t x) { return __builtin_bswap32(x); } -inline uint64_t Bswap(uint64_t x) { return __builtin_bswap64(x); } - -} // namespace fuzzer - -#endif // LLVM_FUZZER_DEFS_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerDictionary.h b/gnu/llvm/lib/Fuzzer/FuzzerDictionary.h deleted file mode 100644 index eba0eabb683..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerDictionary.h +++ /dev/null @@ -1,124 +0,0 @@ -//===- FuzzerDictionary.h - Internal header for the Fuzzer ------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// fuzzer::Dictionary -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_DICTIONARY_H -#define LLVM_FUZZER_DICTIONARY_H - -#include "FuzzerDefs.h" -#include "FuzzerIO.h" -#include "FuzzerUtil.h" -#include <algorithm> -#include <limits> - -namespace fuzzer { -// A simple POD sized array of bytes. -template <size_t kMaxSize> class FixedWord { -public: - FixedWord() {} - FixedWord(const uint8_t *B, uint8_t S) { Set(B, S); } - - void Set(const uint8_t *B, uint8_t S) { - assert(S <= kMaxSize); - memcpy(Data, B, S); - Size = S; - } - - bool operator==(const FixedWord<kMaxSize> &w) const { - return Size == w.Size && 0 == memcmp(Data, w.Data, Size); - } - - bool operator<(const FixedWord<kMaxSize> &w) const { - if (Size != w.Size) - return Size < w.Size; - return memcmp(Data, w.Data, Size) < 0; - } - - static size_t GetMaxSize() { return kMaxSize; } - const uint8_t *data() const { return Data; } - uint8_t size() const { return Size; } - -private: - uint8_t Size = 0; - uint8_t Data[kMaxSize]; -}; - -typedef FixedWord<27> Word; // 28 bytes. - -class DictionaryEntry { - public: - DictionaryEntry() {} - DictionaryEntry(Word W) : W(W) {} - DictionaryEntry(Word W, size_t PositionHint) : W(W), PositionHint(PositionHint) {} - const Word &GetW() const { return W; } - - bool HasPositionHint() const { return PositionHint != std::numeric_limits<size_t>::max(); } - size_t GetPositionHint() const { - assert(HasPositionHint()); - return PositionHint; - } - void IncUseCount() { UseCount++; } - void IncSuccessCount() { SuccessCount++; } - size_t GetUseCount() const { return UseCount; } - size_t GetSuccessCount() const {return SuccessCount; } - - void Print(const char *PrintAfter = "\n") { - PrintASCII(W.data(), W.size()); - if (HasPositionHint()) - Printf("@%zd", GetPositionHint()); - Printf("%s", PrintAfter); - } - -private: - Word W; - size_t PositionHint = std::numeric_limits<size_t>::max(); - size_t UseCount = 0; - size_t SuccessCount = 0; -}; - -class Dictionary { - public: - static const size_t kMaxDictSize = 1 << 14; - - bool ContainsWord(const Word &W) const { - return std::any_of(begin(), end(), [&](const DictionaryEntry &DE) { - return DE.GetW() == W; - }); - } - const DictionaryEntry *begin() const { return &DE[0]; } - const DictionaryEntry *end() const { return begin() + Size; } - DictionaryEntry & operator[] (size_t Idx) { - assert(Idx < Size); - return DE[Idx]; - } - void push_back(DictionaryEntry DE) { - if (Size < kMaxDictSize) - this->DE[Size++] = DE; - } - void clear() { Size = 0; } - bool empty() const { return Size == 0; } - size_t size() const { return Size; } - -private: - DictionaryEntry DE[kMaxDictSize]; - size_t Size = 0; -}; - -// Parses one dictionary entry. -// If successfull, write the enty to Unit and returns true, -// otherwise returns false. -bool ParseOneDictionaryEntry(const std::string &Str, Unit *U); -// Parses the dictionary file, fills Units, returns true iff all lines -// were parsed succesfully. -bool ParseDictionaryFile(const std::string &Text, std::vector<Unit> *Units); - -} // namespace fuzzer - -#endif // LLVM_FUZZER_DICTIONARY_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerDriver.cpp b/gnu/llvm/lib/Fuzzer/FuzzerDriver.cpp deleted file mode 100644 index 66e46dbf3aa..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerDriver.cpp +++ /dev/null @@ -1,336 +0,0 @@ -//===- FuzzerDriver.cpp - FuzzerDriver function and flags -----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// FuzzerDriver and flag parsing. -//===----------------------------------------------------------------------===// - -#include "FuzzerInterface.h" -#include "FuzzerInternal.h" - -#include <cstring> -#include <chrono> -#include <unistd.h> -#include <thread> -#include <atomic> -#include <mutex> -#include <string> -#include <sstream> -#include <algorithm> -#include <iterator> - -namespace fuzzer { - -// Program arguments. -struct FlagDescription { - const char *Name; - const char *Description; - int Default; - int *IntFlag; - const char **StrFlag; - unsigned int *UIntFlag; -}; - -struct { -#define FUZZER_FLAG_INT(Name, Default, Description) int Name; -#define FUZZER_FLAG_UNSIGNED(Name, Default, Description) unsigned int Name; -#define FUZZER_FLAG_STRING(Name, Description) const char *Name; -#include "FuzzerFlags.def" -#undef FUZZER_FLAG_INT -#undef FUZZER_FLAG_UNSIGNED -#undef FUZZER_FLAG_STRING -} Flags; - -static const FlagDescription FlagDescriptions [] { -#define FUZZER_FLAG_INT(Name, Default, Description) \ - {#Name, Description, Default, &Flags.Name, nullptr, nullptr}, -#define FUZZER_FLAG_UNSIGNED(Name, Default, Description) \ - {#Name, Description, static_cast<int>(Default), \ - nullptr, nullptr, &Flags.Name}, -#define FUZZER_FLAG_STRING(Name, Description) \ - {#Name, Description, 0, nullptr, &Flags.Name, nullptr}, -#include "FuzzerFlags.def" -#undef FUZZER_FLAG_INT -#undef FUZZER_FLAG_UNSIGNED -#undef FUZZER_FLAG_STRING -}; - -static const size_t kNumFlags = - sizeof(FlagDescriptions) / sizeof(FlagDescriptions[0]); - -static std::vector<std::string> *Inputs; -static std::string *ProgName; - -static void PrintHelp() { - Printf("Usage: %s [-flag1=val1 [-flag2=val2 ...] ] [dir1 [dir2 ...] ]\n", - ProgName->c_str()); - Printf("\nFlags: (strictly in form -flag=value)\n"); - size_t MaxFlagLen = 0; - for (size_t F = 0; F < kNumFlags; F++) - MaxFlagLen = std::max(strlen(FlagDescriptions[F].Name), MaxFlagLen); - - for (size_t F = 0; F < kNumFlags; F++) { - const auto &D = FlagDescriptions[F]; - Printf(" %s", D.Name); - for (size_t i = 0, n = MaxFlagLen - strlen(D.Name); i < n; i++) - Printf(" "); - Printf("\t"); - Printf("%d\t%s\n", D.Default, D.Description); - } - Printf("\nFlags starting with '--' will be ignored and " - "will be passed verbatim to subprocesses.\n"); -} - -static const char *FlagValue(const char *Param, const char *Name) { - size_t Len = strlen(Name); - if (Param[0] == '-' && strstr(Param + 1, Name) == Param + 1 && - Param[Len + 1] == '=') - return &Param[Len + 2]; - return nullptr; -} - -static bool ParseOneFlag(const char *Param) { - if (Param[0] != '-') return false; - if (Param[1] == '-') { - static bool PrintedWarning = false; - if (!PrintedWarning) { - PrintedWarning = true; - Printf("WARNING: libFuzzer ignores flags that start with '--'\n"); - } - return true; - } - for (size_t F = 0; F < kNumFlags; F++) { - const char *Name = FlagDescriptions[F].Name; - const char *Str = FlagValue(Param, Name); - if (Str) { - if (FlagDescriptions[F].IntFlag) { - int Val = std::stol(Str); - *FlagDescriptions[F].IntFlag = Val; - if (Flags.verbosity >= 2) - Printf("Flag: %s %d\n", Name, Val);; - return true; - } else if (FlagDescriptions[F].UIntFlag) { - unsigned int Val = std::stoul(Str); - *FlagDescriptions[F].UIntFlag = Val; - if (Flags.verbosity >= 2) - Printf("Flag: %s %u\n", Name, Val); - return true; - } else if (FlagDescriptions[F].StrFlag) { - *FlagDescriptions[F].StrFlag = Str; - if (Flags.verbosity >= 2) - Printf("Flag: %s %s\n", Name, Str); - return true; - } - } - } - PrintHelp(); - exit(1); -} - -// We don't use any library to minimize dependencies. -static void ParseFlags(const std::vector<std::string> &Args) { - for (size_t F = 0; F < kNumFlags; F++) { - if (FlagDescriptions[F].IntFlag) - *FlagDescriptions[F].IntFlag = FlagDescriptions[F].Default; - if (FlagDescriptions[F].UIntFlag) - *FlagDescriptions[F].UIntFlag = - static_cast<unsigned int>(FlagDescriptions[F].Default); - if (FlagDescriptions[F].StrFlag) - *FlagDescriptions[F].StrFlag = nullptr; - } - Inputs = new std::vector<std::string>; - for (size_t A = 1; A < Args.size(); A++) { - if (ParseOneFlag(Args[A].c_str())) continue; - Inputs->push_back(Args[A]); - } -} - -static std::mutex Mu; - -static void PulseThread() { - while (true) { - std::this_thread::sleep_for(std::chrono::seconds(600)); - std::lock_guard<std::mutex> Lock(Mu); - Printf("pulse...\n"); - } -} - -static void WorkerThread(const std::string &Cmd, std::atomic<int> *Counter, - int NumJobs, std::atomic<bool> *HasErrors) { - while (true) { - int C = (*Counter)++; - if (C >= NumJobs) break; - std::string Log = "fuzz-" + std::to_string(C) + ".log"; - std::string ToRun = Cmd + " > " + Log + " 2>&1\n"; - if (Flags.verbosity) - Printf("%s", ToRun.c_str()); - int ExitCode = ExecuteCommand(ToRun.c_str()); - if (ExitCode != 0) - *HasErrors = true; - std::lock_guard<std::mutex> Lock(Mu); - Printf("================== Job %d exited with exit code %d ============\n", - C, ExitCode); - fuzzer::CopyFileToErr(Log); - } -} - -static int RunInMultipleProcesses(const std::vector<std::string> &Args, - int NumWorkers, int NumJobs) { - std::atomic<int> Counter(0); - std::atomic<bool> HasErrors(false); - std::string Cmd; - for (auto &S : Args) { - if (FlagValue(S.c_str(), "jobs") || FlagValue(S.c_str(), "workers")) - continue; - Cmd += S + " "; - } - std::vector<std::thread> V; - std::thread Pulse(PulseThread); - Pulse.detach(); - for (int i = 0; i < NumWorkers; i++) - V.push_back(std::thread(WorkerThread, Cmd, &Counter, NumJobs, &HasErrors)); - for (auto &T : V) - T.join(); - return HasErrors ? 1 : 0; -} - -int RunOneTest(Fuzzer *F, const char *InputFilePath) { - Unit U = FileToVector(InputFilePath); - Unit PreciseSizedU(U); - assert(PreciseSizedU.size() == PreciseSizedU.capacity()); - F->ExecuteCallback(PreciseSizedU); - return 0; -} - -int FuzzerDriver(int argc, char **argv, UserCallback Callback) { - FuzzerRandomLibc Rand(0); - SimpleUserSuppliedFuzzer SUSF(&Rand, Callback); - return FuzzerDriver(argc, argv, SUSF); -} - -int FuzzerDriver(int argc, char **argv, UserSuppliedFuzzer &USF) { - std::vector<std::string> Args(argv, argv + argc); - return FuzzerDriver(Args, USF); -} - -int FuzzerDriver(const std::vector<std::string> &Args, UserCallback Callback) { - FuzzerRandomLibc Rand(0); - SimpleUserSuppliedFuzzer SUSF(&Rand, Callback); - return FuzzerDriver(Args, SUSF); -} - -int FuzzerDriver(const std::vector<std::string> &Args, - UserSuppliedFuzzer &USF) { - using namespace fuzzer; - assert(!Args.empty()); - ProgName = new std::string(Args[0]); - ParseFlags(Args); - if (Flags.help) { - PrintHelp(); - return 0; - } - - if (Flags.jobs > 0 && Flags.workers == 0) { - Flags.workers = std::min(NumberOfCpuCores() / 2, Flags.jobs); - if (Flags.workers > 1) - Printf("Running %d workers\n", Flags.workers); - } - - if (Flags.workers > 0 && Flags.jobs > 0) - return RunInMultipleProcesses(Args, Flags.workers, Flags.jobs); - - Fuzzer::FuzzingOptions Options; - Options.Verbosity = Flags.verbosity; - Options.MaxLen = Flags.max_len; - Options.UnitTimeoutSec = Flags.timeout; - Options.MaxTotalTimeSec = Flags.max_total_time; - Options.DoCrossOver = Flags.cross_over; - Options.MutateDepth = Flags.mutate_depth; - Options.ExitOnFirst = Flags.exit_on_first; - Options.UseCounters = Flags.use_counters; - Options.UseIndirCalls = Flags.use_indir_calls; - Options.UseTraces = Flags.use_traces; - Options.ShuffleAtStartUp = Flags.shuffle; - Options.PreferSmallDuringInitialShuffle = - Flags.prefer_small_during_initial_shuffle; - Options.Reload = Flags.reload; - Options.OnlyASCII = Flags.only_ascii; - Options.OutputCSV = Flags.output_csv; - if (Flags.runs >= 0) - Options.MaxNumberOfRuns = Flags.runs; - if (!Inputs->empty()) - Options.OutputCorpus = (*Inputs)[0]; - if (Flags.sync_command) - Options.SyncCommand = Flags.sync_command; - Options.SyncTimeout = Flags.sync_timeout; - Options.ReportSlowUnits = Flags.report_slow_units; - if (Flags.artifact_prefix) - Options.ArtifactPrefix = Flags.artifact_prefix; - if (Flags.exact_artifact_path) - Options.ExactArtifactPath = Flags.exact_artifact_path; - std::vector<Unit> Dictionary; - if (Flags.dict) - if (!ParseDictionaryFile(FileToString(Flags.dict), &Dictionary)) - return 1; - if (Flags.verbosity > 0 && !Dictionary.empty()) - Printf("Dictionary: %zd entries\n", Dictionary.size()); - Options.SaveArtifacts = !Flags.test_single_input; - Options.PrintNewCovPcs = Flags.print_new_cov_pcs; - - Fuzzer F(USF, Options); - - for (auto &U: Dictionary) - USF.GetMD().AddWordToManualDictionary(U); - - // Timer - if (Flags.timeout > 0) - SetTimer(Flags.timeout / 2 + 1); - - if (Flags.test_single_input) { - RunOneTest(&F, Flags.test_single_input); - exit(0); - } - - if (Flags.save_minimized_corpus) { - Printf("The flag -save_minimized_corpus is deprecated; use -merge=1\n"); - exit(1); - } - - if (Flags.merge) { - F.Merge(*Inputs); - exit(0); - } - - unsigned Seed = Flags.seed; - // Initialize Seed. - if (Seed == 0) - Seed = time(0) * 10000 + getpid(); - if (Flags.verbosity) - Printf("Seed: %u\n", Seed); - USF.GetRand().ResetSeed(Seed); - - F.RereadOutputCorpus(); - for (auto &inp : *Inputs) - if (inp != Options.OutputCorpus) - F.ReadDir(inp, nullptr); - - if (F.CorpusSize() == 0) - F.AddToCorpus(Unit()); // Can't fuzz empty corpus, so add an empty input. - F.ShuffleAndMinimize(); - if (Flags.drill) - F.Drill(); - else - F.Loop(); - - if (Flags.verbosity) - Printf("Done %d runs in %zd second(s)\n", F.getTotalNumberOfRuns(), - F.secondsSinceProcessStartUp()); - - exit(0); // Don't let F destroy itself. -} - -} // namespace fuzzer diff --git a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctions.def b/gnu/llvm/lib/Fuzzer/FuzzerExtFunctions.def deleted file mode 100644 index f7dcf9b54fb..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctions.def +++ /dev/null @@ -1,46 +0,0 @@ -//===- FuzzerExtFunctions.def - External functions --------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// This defines the external function pointers that -// ``fuzzer::ExternalFunctions`` should contain and try to initialize. The -// EXT_FUNC macro must be defined at the point of inclusion. The signature of -// the macro is: -// -// EXT_FUNC(<name>, <return_type>, <function_signature>, <warn_if_missing>) -//===----------------------------------------------------------------------===// - -// Optional user functions -EXT_FUNC(LLVMFuzzerInitialize, int, (int *argc, char ***argv), false); -EXT_FUNC(LLVMFuzzerCustomMutator, size_t, - (uint8_t * Data, size_t Size, size_t MaxSize, unsigned int Seed), - false); -EXT_FUNC(LLVMFuzzerCustomCrossOver, size_t, - (const uint8_t * Data1, size_t Size1, - const uint8_t * Data2, size_t Size2, - uint8_t * Out, size_t MaxOutSize, unsigned int Seed), - false); - -// Sanitizer functions -EXT_FUNC(__lsan_enable, void, (), false); -EXT_FUNC(__lsan_disable, void, (), false); -EXT_FUNC(__lsan_do_recoverable_leak_check, int, (), false); -EXT_FUNC(__sanitizer_get_coverage_pc_buffer, uintptr_t, (uintptr_t**), true); -EXT_FUNC(__sanitizer_get_number_of_counters, size_t, (), false); -EXT_FUNC(__sanitizer_install_malloc_and_free_hooks, int, - (void (*malloc_hook)(const volatile void *, size_t), - void (*free_hook)(const volatile void *)), - false); -EXT_FUNC(__sanitizer_get_total_unique_caller_callee_pairs, size_t, (), false); -EXT_FUNC(__sanitizer_get_total_unique_coverage, size_t, (), true); -EXT_FUNC(__sanitizer_print_memory_profile, int, (size_t), false); -EXT_FUNC(__sanitizer_print_stack_trace, void, (), true); -EXT_FUNC(__sanitizer_reset_coverage, void, (), true); -EXT_FUNC(__sanitizer_set_death_callback, void, (void (*)(void)), true); -EXT_FUNC(__sanitizer_set_report_fd, void, (void*), false); -EXT_FUNC(__sanitizer_update_counter_bitset_and_clear_counters, uintptr_t, - (uint8_t*), false); diff --git a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctions.h b/gnu/llvm/lib/Fuzzer/FuzzerExtFunctions.h deleted file mode 100644 index 2ec86cb9231..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctions.h +++ /dev/null @@ -1,33 +0,0 @@ -//===- FuzzerExtFunctions.h - Interface to external functions ---*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Defines an interface to (possibly optional) functions. -//===----------------------------------------------------------------------===// -#ifndef LLVM_FUZZER_EXT_FUNCTIONS_H -#define LLVM_FUZZER_EXT_FUNCTIONS_H - -#include <stddef.h> -#include <stdint.h> - -namespace fuzzer { - -struct ExternalFunctions { - // Initialize function pointers. Functions that are not available will be set - // to nullptr. Do not call this constructor before ``main()`` has been - // entered. - ExternalFunctions(); - -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - RETURN_TYPE(*NAME) FUNC_SIG = nullptr - -#include "FuzzerExtFunctions.def" - -#undef EXT_FUNC -}; -} // namespace fuzzer -#endif diff --git a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp b/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp deleted file mode 100644 index 7b9681a6193..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//===- FuzzerExtFunctionsDlsym.cpp - Interface to external functions ------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Implementation for operating systems that support dlsym(). We only use it on -// Apple platforms for now. We don't use this approach on Linux because it -// requires that clients of LibFuzzer pass ``--export-dynamic`` to the linker. -// That is a complication we don't wish to expose to clients right now. -//===----------------------------------------------------------------------===// -#include "FuzzerInternal.h" -#if LIBFUZZER_APPLE - -#include "FuzzerExtFunctions.h" -#include <dlfcn.h> - -using namespace fuzzer; - -template <typename T> -static T GetFnPtr(const char *FnName, bool WarnIfMissing) { - dlerror(); // Clear any previous errors. - void *Fn = dlsym(RTLD_DEFAULT, FnName); - if (Fn == nullptr) { - if (WarnIfMissing) { - const char *ErrorMsg = dlerror(); - Printf("WARNING: Failed to find function \"%s\".", FnName); - if (ErrorMsg) - Printf(" Reason %s.", ErrorMsg); - Printf("\n"); - } - } - return reinterpret_cast<T>(Fn); -} - -namespace fuzzer { - -ExternalFunctions::ExternalFunctions() { -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - this->NAME = GetFnPtr<decltype(ExternalFunctions::NAME)>(#NAME, WARN) - -#include "FuzzerExtFunctions.def" - -#undef EXT_FUNC -} -} // namespace fuzzer -#endif // LIBFUZZER_APPLE diff --git a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsymWin.cpp b/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsymWin.cpp deleted file mode 100644 index 321b3ec5d41..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsymWin.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===- FuzzerExtFunctionsDlsymWin.cpp - Interface to external functions ---===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Implementation using dynamic loading for Windows. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_WINDOWS - -#include "FuzzerExtFunctions.h" -#include "FuzzerIO.h" -#include "Windows.h" - -// This must be included after Windows.h. -#include "Psapi.h" - -namespace fuzzer { - -ExternalFunctions::ExternalFunctions() { - HMODULE Modules[1024]; - DWORD BytesNeeded; - HANDLE CurrentProcess = GetCurrentProcess(); - - if (!EnumProcessModules(CurrentProcess, Modules, sizeof(Modules), - &BytesNeeded)) { - Printf("EnumProcessModules failed (error: %d).\n", GetLastError()); - exit(1); - } - - if (sizeof(Modules) < BytesNeeded) { - Printf("Error: the array is not big enough to hold all loaded modules.\n"); - exit(1); - } - - for (size_t i = 0; i < (BytesNeeded / sizeof(HMODULE)); i++) - { - FARPROC Fn; -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - if (this->NAME == nullptr) { \ - Fn = GetProcAddress(Modules[i], #NAME); \ - if (Fn == nullptr) \ - Fn = GetProcAddress(Modules[i], #NAME "__dll"); \ - this->NAME = (decltype(ExternalFunctions::NAME)) Fn; \ - } -#include "FuzzerExtFunctions.def" -#undef EXT_FUNC - } - -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - if (this->NAME == nullptr && WARN) \ - Printf("WARNING: Failed to find function \"%s\".\n", #NAME); -#include "FuzzerExtFunctions.def" -#undef EXT_FUNC -} - -} // namespace fuzzer - -#endif // LIBFUZZER_WINDOWS diff --git a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp b/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp deleted file mode 100644 index 75c0ed9f830..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===- FuzzerExtFunctionsWeak.cpp - Interface to external functions -------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Implementation for Linux. This relies on the linker's support for weak -// symbols. We don't use this approach on Apple platforms because it requires -// clients of LibFuzzer to pass ``-U _<symbol_name>`` to the linker to allow -// weak symbols to be undefined. That is a complication we don't want to expose -// to clients right now. -//===----------------------------------------------------------------------===// -#include "FuzzerInternal.h" -#if LIBFUZZER_LINUX - -#include "FuzzerExtFunctions.h" - -extern "C" { -// Declare these symbols as weak to allow them to be optionally defined. -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - __attribute__((weak)) RETURN_TYPE NAME FUNC_SIG - -#include "FuzzerExtFunctions.def" - -#undef EXT_FUNC -} - -using namespace fuzzer; - -static void CheckFnPtr(void *FnPtr, const char *FnName, bool WarnIfMissing) { - if (FnPtr == nullptr && WarnIfMissing) { - Printf("WARNING: Failed to find function \"%s\".\n", FnName); - } -} - -namespace fuzzer { - -ExternalFunctions::ExternalFunctions() { -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - this->NAME = ::NAME; \ - CheckFnPtr((void *)::NAME, #NAME, WARN); - -#include "FuzzerExtFunctions.def" - -#undef EXT_FUNC -} -} // namespace fuzzer -#endif // LIBFUZZER_LINUX diff --git a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp b/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp deleted file mode 100644 index e10f7b4dcac..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//===- FuzzerExtFunctionsWeakAlias.cpp - Interface to external functions --===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Implementation using weak aliases. Works for Windows. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_WINDOWS - -#include "FuzzerExtFunctions.h" -#include "FuzzerIO.h" - -using namespace fuzzer; - -extern "C" { -// Declare these symbols as weak to allow them to be optionally defined. -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - RETURN_TYPE NAME##Def FUNC_SIG { \ - Printf("ERROR: Function \"%s\" not defined.\n", #NAME); \ - exit(1); \ - } \ - RETURN_TYPE NAME FUNC_SIG __attribute__((weak, alias(#NAME "Def"))); - -#include "FuzzerExtFunctions.def" - -#undef EXT_FUNC -} - -template <typename T> -static T *GetFnPtr(T *Fun, T *FunDef, const char *FnName, bool WarnIfMissing) { - if (Fun == FunDef) { - if (WarnIfMissing) - Printf("WARNING: Failed to find function \"%s\".\n", FnName); - return nullptr; - } - return Fun; -} - -namespace fuzzer { - -ExternalFunctions::ExternalFunctions() { -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - this->NAME = GetFnPtr<decltype(::NAME)>(::NAME, ::NAME##Def, #NAME, WARN); - -#include "FuzzerExtFunctions.def" - -#undef EXT_FUNC -} - -} // namespace fuzzer - -#endif // LIBFUZZER_WINDOWS diff --git a/gnu/llvm/lib/Fuzzer/FuzzerExtraCounters.cpp b/gnu/llvm/lib/Fuzzer/FuzzerExtraCounters.cpp deleted file mode 100644 index 07dbe0fdee7..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerExtraCounters.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===- FuzzerExtraCounters.cpp - Extra coverage counters ------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Extra coverage counters defined by user code. -//===----------------------------------------------------------------------===// - -#include "FuzzerDefs.h" - -#if LIBFUZZER_LINUX -__attribute__((weak)) extern uint8_t __start___libfuzzer_extra_counters; -__attribute__((weak)) extern uint8_t __stop___libfuzzer_extra_counters; - -namespace fuzzer { -uint8_t *ExtraCountersBegin() { return &__start___libfuzzer_extra_counters; } -uint8_t *ExtraCountersEnd() { return &__stop___libfuzzer_extra_counters; } -ATTRIBUTE_NO_SANITIZE_ALL -void ClearExtraCounters() { // hand-written memset, don't asan-ify. - uintptr_t *Beg = reinterpret_cast<uintptr_t*>(ExtraCountersBegin()); - uintptr_t *End = reinterpret_cast<uintptr_t*>(ExtraCountersEnd()); - for (; Beg < End; Beg++) { - *Beg = 0; - __asm__ __volatile__("" : : : "memory"); - } -} - -} // namespace fuzzer - -#else -// TODO: implement for other platforms. -namespace fuzzer { -uint8_t *ExtraCountersBegin() { return nullptr; } -uint8_t *ExtraCountersEnd() { return nullptr; } -void ClearExtraCounters() {} -} // namespace fuzzer - -#endif diff --git a/gnu/llvm/lib/Fuzzer/FuzzerFlags.def b/gnu/llvm/lib/Fuzzer/FuzzerFlags.def deleted file mode 100644 index 977efb76922..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerFlags.def +++ /dev/null @@ -1,72 +0,0 @@ -//===- FuzzerFlags.def - Run-time flags -------------------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Flags. FUZZER_FLAG_INT/FUZZER_FLAG_STRING macros should be defined at the -// point of inclusion. We are not using any flag parsing library for better -// portability and independence. -//===----------------------------------------------------------------------===// -FUZZER_FLAG_INT(verbosity, 1, "Verbosity level.") -FUZZER_FLAG_UNSIGNED(seed, 0, "Random seed. If 0, seed is generated.") -FUZZER_FLAG_INT(runs, -1, - "Number of individual test runs (-1 for infinite runs).") -FUZZER_FLAG_INT(max_len, 64, "Maximum length of the test input.") -FUZZER_FLAG_INT(cross_over, 1, "If 1, cross over inputs.") -FUZZER_FLAG_INT(mutate_depth, 5, - "Apply this number of consecutive mutations to each input.") -FUZZER_FLAG_INT(shuffle, 1, "Shuffle inputs at startup") -FUZZER_FLAG_INT( - prefer_small_during_initial_shuffle, -1, - "If 1, always prefer smaller inputs during the initial corpus shuffle." - " If 0, never do that. If -1, do it sometimes.") -FUZZER_FLAG_INT(exit_on_first, 0, - "If 1, exit after the first new interesting input is found.") -FUZZER_FLAG_INT( - timeout, 1200, - "Timeout in seconds (if positive). " - "If one unit runs more than this number of seconds the process will abort.") -FUZZER_FLAG_INT(max_total_time, 0, "If positive, indicates the maximal total " - "time in seconds to run the fuzzer.") -FUZZER_FLAG_INT(help, 0, "Print help.") -FUZZER_FLAG_INT(save_minimized_corpus, 0, "Deprecated. Use -merge=1") -FUZZER_FLAG_INT(merge, 0, "If 1, the 2-nd, 3-rd, etc corpora will be " - "merged into the 1-st corpus. Only interesting units will be taken.") -FUZZER_FLAG_INT(use_counters, 1, "Use coverage counters") -FUZZER_FLAG_INT(use_indir_calls, 1, "Use indirect caller-callee counters") -FUZZER_FLAG_INT(use_traces, 0, "Experimental: use instruction traces") -FUZZER_FLAG_INT(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn" - " this number of jobs in separate worker processes" - " with stdout/stderr redirected to fuzz-JOB.log.") -FUZZER_FLAG_INT(workers, 0, - "Number of simultaneous worker processes to run the jobs." - " If zero, \"min(jobs,NumberOfCpuCores()/2)\" is used.") -FUZZER_FLAG_INT(reload, 1, - "Reload the main corpus periodically to get new units" - " discovered by other processes.") -FUZZER_FLAG_STRING(sync_command, "Execute an external command " - "\"<sync_command> <test_corpus>\" " - "to synchronize the test corpus.") -FUZZER_FLAG_INT(sync_timeout, 600, "Minimum timeout between syncs.") -FUZZER_FLAG_INT(report_slow_units, 10, - "Report slowest units if they run for more than this number of seconds.") -FUZZER_FLAG_INT(only_ascii, 0, - "If 1, generate only ASCII (isprint+isspace) inputs.") -FUZZER_FLAG_STRING(dict, "Experimental. Use the dictionary file.") -FUZZER_FLAG_STRING(test_single_input, "Use specified file as test input.") -FUZZER_FLAG_STRING(artifact_prefix, "Write fuzzing artifacts (crash, " - "timeout, or slow inputs) as " - "$(artifact_prefix)file") -FUZZER_FLAG_STRING(exact_artifact_path, - "Write the single artifact on failure (crash, timeout) " - "as $(exact_artifact_path). This overrides -artifact_prefix " - "and will not use checksum in the file name. Do not " - "use the same path for several parallel processes.") -FUZZER_FLAG_INT(drill, 0, "Experimental: fuzz using a single unit as the seed " - "corpus, then merge with the initial corpus") -FUZZER_FLAG_INT(output_csv, 0, "Enable pulse output in CSV format.") -FUZZER_FLAG_INT(print_new_cov_pcs, 0, "If 1, print out new covered pcs.") - diff --git a/gnu/llvm/lib/Fuzzer/FuzzerIO.cpp b/gnu/llvm/lib/Fuzzer/FuzzerIO.cpp deleted file mode 100644 index 043fad396d5..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerIO.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//===- FuzzerIO.cpp - IO utils. -------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// IO functions. -//===----------------------------------------------------------------------===// -#include "FuzzerInternal.h" -#include <iterator> -#include <fstream> -#include <dirent.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <cstdarg> -#include <cstdio> - -namespace fuzzer { - -static long GetEpoch(const std::string &Path) { - struct stat St; - if (stat(Path.c_str(), &St)) - return 0; // Can't stat, be conservative. - return St.st_mtime; -} - -static std::vector<std::string> ListFilesInDir(const std::string &Dir, - long *Epoch) { - std::vector<std::string> V; - if (Epoch) { - auto E = GetEpoch(Dir); - if (*Epoch >= E) return V; - *Epoch = E; - } - DIR *D = opendir(Dir.c_str()); - if (!D) { - Printf("No such directory: %s; exiting\n", Dir.c_str()); - exit(1); - } - while (auto E = readdir(D)) { - if (E->d_type == DT_REG || E->d_type == DT_LNK) - V.push_back(E->d_name); - } - closedir(D); - return V; -} - -Unit FileToVector(const std::string &Path) { - std::ifstream T(Path); - if (!T) { - Printf("No such directory: %s; exiting\n", Path.c_str()); - exit(1); - } - return Unit((std::istreambuf_iterator<char>(T)), - std::istreambuf_iterator<char>()); -} - -std::string FileToString(const std::string &Path) { - std::ifstream T(Path); - return std::string((std::istreambuf_iterator<char>(T)), - std::istreambuf_iterator<char>()); -} - -void CopyFileToErr(const std::string &Path) { - Printf("%s", FileToString(Path).c_str()); -} - -void WriteToFile(const Unit &U, const std::string &Path) { - // Use raw C interface because this function may be called from a sig handler. - FILE *Out = fopen(Path.c_str(), "w"); - if (!Out) return; - fwrite(U.data(), sizeof(U[0]), U.size(), Out); - fclose(Out); -} - -void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V, - long *Epoch) { - long E = Epoch ? *Epoch : 0; - for (auto &X : ListFilesInDir(Path, Epoch)) { - auto FilePath = DirPlusFile(Path, X); - if (Epoch && GetEpoch(FilePath) < E) continue; - V->push_back(FileToVector(FilePath)); - } -} - -std::string DirPlusFile(const std::string &DirPath, - const std::string &FileName) { - return DirPath + "/" + FileName; -} - -void Printf(const char *Fmt, ...) { - va_list ap; - va_start(ap, Fmt); - vfprintf(stderr, Fmt, ap); - va_end(ap); -} - -} // namespace fuzzer diff --git a/gnu/llvm/lib/Fuzzer/FuzzerIO.h b/gnu/llvm/lib/Fuzzer/FuzzerIO.h deleted file mode 100644 index 15bfd3d3472..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerIO.h +++ /dev/null @@ -1,67 +0,0 @@ -//===- FuzzerIO.h - Internal header for IO utils ----------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// IO interface. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_IO_H -#define LLVM_FUZZER_IO_H - -#include "FuzzerDefs.h" - -namespace fuzzer { - -long GetEpoch(const std::string &Path); - -Unit FileToVector(const std::string &Path, size_t MaxSize = 0, - bool ExitOnError = true); - -std::string FileToString(const std::string &Path); - -void CopyFileToErr(const std::string &Path); - -void WriteToFile(const Unit &U, const std::string &Path); - -void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V, - long *Epoch, size_t MaxSize, bool ExitOnError); - -// Returns "Dir/FileName" or equivalent for the current OS. -std::string DirPlusFile(const std::string &DirPath, - const std::string &FileName); - -// Returns the name of the dir, similar to the 'dirname' utility. -std::string DirName(const std::string &FileName); - -// Returns path to a TmpDir. -std::string TmpDir(); - -void DupAndCloseStderr(); - -void CloseStdout(); - -void Printf(const char *Fmt, ...); - -// Platform specific functions: -bool IsFile(const std::string &Path); - -void ListFilesInDirRecursive(const std::string &Dir, long *Epoch, - std::vector<std::string> *V, bool TopDir); - -char GetSeparator(); - -FILE* OpenFile(int Fd, const char *Mode); - -int CloseFile(int Fd); - -int DuplicateFile(int Fd); - -void RemoveFile(const std::string &Path); - -} // namespace fuzzer - -#endif // LLVM_FUZZER_IO_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerIOPosix.cpp b/gnu/llvm/lib/Fuzzer/FuzzerIOPosix.cpp deleted file mode 100644 index 6d8edf6ff53..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerIOPosix.cpp +++ /dev/null @@ -1,94 +0,0 @@ -//===- FuzzerIOPosix.cpp - IO utils for Posix. ----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// IO functions implementation using Posix API. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_POSIX - -#include "FuzzerExtFunctions.h" -#include "FuzzerIO.h" -#include <cstdarg> -#include <cstdio> -#include <dirent.h> -#include <fstream> -#include <iterator> -#include <libgen.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <unistd.h> - -namespace fuzzer { - -bool IsFile(const std::string &Path) { - struct stat St; - if (stat(Path.c_str(), &St)) - return false; - return S_ISREG(St.st_mode); -} - -void ListFilesInDirRecursive(const std::string &Dir, long *Epoch, - std::vector<std::string> *V, bool TopDir) { - auto E = GetEpoch(Dir); - if (Epoch) - if (E && *Epoch >= E) return; - - DIR *D = opendir(Dir.c_str()); - if (!D) { - Printf("No such directory: %s; exiting\n", Dir.c_str()); - exit(1); - } - while (auto E = readdir(D)) { - std::string Path = DirPlusFile(Dir, E->d_name); - if (E->d_type == DT_REG || E->d_type == DT_LNK) - V->push_back(Path); - else if (E->d_type == DT_DIR && *E->d_name != '.') - ListFilesInDirRecursive(Path, Epoch, V, false); - } - closedir(D); - if (Epoch && TopDir) - *Epoch = E; -} - -char GetSeparator() { - return '/'; -} - -FILE* OpenFile(int Fd, const char* Mode) { - return fdopen(Fd, Mode); -} - -int CloseFile(int fd) { - return close(fd); -} - -int DuplicateFile(int Fd) { - return dup(Fd); -} - -void RemoveFile(const std::string &Path) { - unlink(Path.c_str()); -} - -std::string DirName(const std::string &FileName) { - char *Tmp = new char[FileName.size() + 1]; - memcpy(Tmp, FileName.c_str(), FileName.size() + 1); - std::string Res = dirname(Tmp); - delete [] Tmp; - return Res; -} - -std::string TmpDir() { - if (auto Env = getenv("TMPDIR")) - return Env; - return "/tmp"; -} - -} // namespace fuzzer - -#endif // LIBFUZZER_POSIX diff --git a/gnu/llvm/lib/Fuzzer/FuzzerIOWindows.cpp b/gnu/llvm/lib/Fuzzer/FuzzerIOWindows.cpp deleted file mode 100644 index 056f0721a33..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerIOWindows.cpp +++ /dev/null @@ -1,284 +0,0 @@ -//===- FuzzerIOWindows.cpp - IO utils for Windows. ------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// IO functions implementation for Windows. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_WINDOWS - -#include "FuzzerExtFunctions.h" -#include "FuzzerIO.h" -#include <cstdarg> -#include <cstdio> -#include <fstream> -#include <io.h> -#include <iterator> -#include <sys/stat.h> -#include <sys/types.h> -#include <windows.h> - -namespace fuzzer { - -static bool IsFile(const std::string &Path, const DWORD &FileAttributes) { - - if (FileAttributes & FILE_ATTRIBUTE_NORMAL) - return true; - - if (FileAttributes & FILE_ATTRIBUTE_DIRECTORY) - return false; - - HANDLE FileHandle( - CreateFileA(Path.c_str(), 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, 0)); - - if (FileHandle == INVALID_HANDLE_VALUE) { - Printf("CreateFileA() failed for \"%s\" (Error code: %lu).\n", Path.c_str(), - GetLastError()); - return false; - } - - DWORD FileType = GetFileType(FileHandle); - - if (FileType == FILE_TYPE_UNKNOWN) { - Printf("GetFileType() failed for \"%s\" (Error code: %lu).\n", Path.c_str(), - GetLastError()); - CloseHandle(FileHandle); - return false; - } - - if (FileType != FILE_TYPE_DISK) { - CloseHandle(FileHandle); - return false; - } - - CloseHandle(FileHandle); - return true; -} - -bool IsFile(const std::string &Path) { - DWORD Att = GetFileAttributesA(Path.c_str()); - - if (Att == INVALID_FILE_ATTRIBUTES) { - Printf("GetFileAttributesA() failed for \"%s\" (Error code: %lu).\n", - Path.c_str(), GetLastError()); - return false; - } - - return IsFile(Path, Att); -} - -void ListFilesInDirRecursive(const std::string &Dir, long *Epoch, - std::vector<std::string> *V, bool TopDir) { - auto E = GetEpoch(Dir); - if (Epoch) - if (E && *Epoch >= E) return; - - std::string Path(Dir); - assert(!Path.empty()); - if (Path.back() != '\\') - Path.push_back('\\'); - Path.push_back('*'); - - // Get the first directory entry. - WIN32_FIND_DATAA FindInfo; - HANDLE FindHandle(FindFirstFileA(Path.c_str(), &FindInfo)); - if (FindHandle == INVALID_HANDLE_VALUE) - { - Printf("No file found in: %s.\n", Dir.c_str()); - return; - } - - do { - std::string FileName = DirPlusFile(Dir, FindInfo.cFileName); - - if (FindInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - size_t FilenameLen = strlen(FindInfo.cFileName); - if ((FilenameLen == 1 && FindInfo.cFileName[0] == '.') || - (FilenameLen == 2 && FindInfo.cFileName[0] == '.' && - FindInfo.cFileName[1] == '.')) - continue; - - ListFilesInDirRecursive(FileName, Epoch, V, false); - } - else if (IsFile(FileName, FindInfo.dwFileAttributes)) - V->push_back(FileName); - } while (FindNextFileA(FindHandle, &FindInfo)); - - DWORD LastError = GetLastError(); - if (LastError != ERROR_NO_MORE_FILES) - Printf("FindNextFileA failed (Error code: %lu).\n", LastError); - - FindClose(FindHandle); - - if (Epoch && TopDir) - *Epoch = E; -} - -char GetSeparator() { - return '\\'; -} - -FILE* OpenFile(int Fd, const char* Mode) { - return _fdopen(Fd, Mode); -} - -int CloseFile(int Fd) { - return _close(Fd); -} - -int DuplicateFile(int Fd) { - return _dup(Fd); -} - -void RemoveFile(const std::string &Path) { - _unlink(Path.c_str()); -} - -static bool IsSeparator(char C) { - return C == '\\' || C == '/'; -} - -// Parse disk designators, like "C:\". If Relative == true, also accepts: "C:". -// Returns number of characters considered if successful. -static size_t ParseDrive(const std::string &FileName, const size_t Offset, - bool Relative = true) { - if (Offset + 1 >= FileName.size() || FileName[Offset + 1] != ':') - return 0; - if (Offset + 2 >= FileName.size() || !IsSeparator(FileName[Offset + 2])) { - if (!Relative) // Accept relative path? - return 0; - else - return 2; - } - return 3; -} - -// Parse a file name, like: SomeFile.txt -// Returns number of characters considered if successful. -static size_t ParseFileName(const std::string &FileName, const size_t Offset) { - size_t Pos = Offset; - const size_t End = FileName.size(); - for(; Pos < End && !IsSeparator(FileName[Pos]); ++Pos) - ; - return Pos - Offset; -} - -// Parse a directory ending in separator, like: SomeDir\ -// Returns number of characters considered if successful. -static size_t ParseDir(const std::string &FileName, const size_t Offset) { - size_t Pos = Offset; - const size_t End = FileName.size(); - if (Pos >= End || IsSeparator(FileName[Pos])) - return 0; - for(; Pos < End && !IsSeparator(FileName[Pos]); ++Pos) - ; - if (Pos >= End) - return 0; - ++Pos; // Include separator. - return Pos - Offset; -} - -// Parse a servername and share, like: SomeServer\SomeShare\ -// Returns number of characters considered if successful. -static size_t ParseServerAndShare(const std::string &FileName, - const size_t Offset) { - size_t Pos = Offset, Res; - if (!(Res = ParseDir(FileName, Pos))) - return 0; - Pos += Res; - if (!(Res = ParseDir(FileName, Pos))) - return 0; - Pos += Res; - return Pos - Offset; -} - -// Parse the given Ref string from the position Offset, to exactly match the given -// string Patt. -// Returns number of characters considered if successful. -static size_t ParseCustomString(const std::string &Ref, size_t Offset, - const char *Patt) { - size_t Len = strlen(Patt); - if (Offset + Len > Ref.size()) - return 0; - return Ref.compare(Offset, Len, Patt) == 0 ? Len : 0; -} - -// Parse a location, like: -// \\?\UNC\Server\Share\ \\?\C:\ \\Server\Share\ \ C:\ C: -// Returns number of characters considered if successful. -static size_t ParseLocation(const std::string &FileName) { - size_t Pos = 0, Res; - - if ((Res = ParseCustomString(FileName, Pos, R"(\\?\)"))) { - Pos += Res; - if ((Res = ParseCustomString(FileName, Pos, R"(UNC\)"))) { - Pos += Res; - if ((Res = ParseServerAndShare(FileName, Pos))) - return Pos + Res; - return 0; - } - if ((Res = ParseDrive(FileName, Pos, false))) - return Pos + Res; - return 0; - } - - if (Pos < FileName.size() && IsSeparator(FileName[Pos])) { - ++Pos; - if (Pos < FileName.size() && IsSeparator(FileName[Pos])) { - ++Pos; - if ((Res = ParseServerAndShare(FileName, Pos))) - return Pos + Res; - return 0; - } - return Pos; - } - - if ((Res = ParseDrive(FileName, Pos))) - return Pos + Res; - - return Pos; -} - -std::string DirName(const std::string &FileName) { - size_t LocationLen = ParseLocation(FileName); - size_t DirLen = 0, Res; - while ((Res = ParseDir(FileName, LocationLen + DirLen))) - DirLen += Res; - size_t FileLen = ParseFileName(FileName, LocationLen + DirLen); - - if (LocationLen + DirLen + FileLen != FileName.size()) { - Printf("DirName() failed for \"%s\", invalid path.\n", FileName.c_str()); - exit(1); - } - - if (DirLen) { - --DirLen; // Remove trailing separator. - if (!FileLen) { // Path ended in separator. - assert(DirLen); - // Remove file name from Dir. - while (DirLen && !IsSeparator(FileName[LocationLen + DirLen - 1])) - --DirLen; - if (DirLen) // Remove trailing separator. - --DirLen; - } - } - - if (!LocationLen) { // Relative path. - if (!DirLen) - return "."; - return std::string(".\\").append(FileName, 0, DirLen); - } - - return FileName.substr(0, LocationLen + DirLen); -} - -std::string TmpDir() { return "TODO: implement TmpDir"; } - -} // namespace fuzzer - -#endif // LIBFUZZER_WINDOWS diff --git a/gnu/llvm/lib/Fuzzer/FuzzerInterface.h b/gnu/llvm/lib/Fuzzer/FuzzerInterface.h deleted file mode 100644 index e22b27a3dd2..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerInterface.h +++ /dev/null @@ -1,198 +0,0 @@ -//===- FuzzerInterface.h - Interface header for the Fuzzer ------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Define the interface between the Fuzzer and the library being tested. -//===----------------------------------------------------------------------===// - -// WARNING: keep the interface free of STL or any other header-based C++ lib, -// to avoid bad interactions between the code used in the fuzzer and -// the code used in the target function. - -#ifndef LLVM_FUZZER_INTERFACE_H -#define LLVM_FUZZER_INTERFACE_H - -#include <limits> -#include <cstddef> -#include <cstdint> -#include <vector> -#include <string> - -namespace fuzzer { -typedef std::vector<uint8_t> Unit; - -/// Returns an int 0. Values other than zero are reserved for future. -typedef int (*UserCallback)(const uint8_t *Data, size_t Size); -/** Simple C-like interface with a single user-supplied callback. - -Usage: - -#\code -#include "FuzzerInterface.h" - -int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - DoStuffWithData(Data, Size); - return 0; -} - -// Implement your own main() or use the one from FuzzerMain.cpp. -int main(int argc, char **argv) { - InitializeMeIfNeeded(); - return fuzzer::FuzzerDriver(argc, argv, LLVMFuzzerTestOneInput); -} -#\endcode -*/ -int FuzzerDriver(int argc, char **argv, UserCallback Callback); - -class FuzzerRandomBase { - public: - FuzzerRandomBase(){} - virtual ~FuzzerRandomBase(){}; - virtual void ResetSeed(unsigned int seed) = 0; - // Return a random number. - virtual size_t Rand() = 0; - // Return a random number in range [0,n). - size_t operator()(size_t n) { return n ? Rand() % n : 0; } - bool RandBool() { return Rand() % 2; } -}; - -class FuzzerRandomLibc : public FuzzerRandomBase { - public: - FuzzerRandomLibc(unsigned int seed) { ResetSeed(seed); } - void ResetSeed(unsigned int seed) override; - ~FuzzerRandomLibc() override {} - size_t Rand() override; -}; - -class MutationDispatcher { - public: - MutationDispatcher(FuzzerRandomBase &Rand); - ~MutationDispatcher(); - /// Indicate that we are about to start a new sequence of mutations. - void StartMutationSequence(); - /// Print the current sequence of mutations. - void PrintMutationSequence(); - /// Mutates data by shuffling bytes. - size_t Mutate_ShuffleBytes(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by erasing a byte. - size_t Mutate_EraseByte(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by inserting a byte. - size_t Mutate_InsertByte(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by chanding one byte. - size_t Mutate_ChangeByte(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by chanding one bit. - size_t Mutate_ChangeBit(uint8_t *Data, size_t Size, size_t MaxSize); - - /// Mutates data by adding a word from the manual dictionary. - size_t Mutate_AddWordFromManualDictionary(uint8_t *Data, size_t Size, - size_t MaxSize); - - /// Mutates data by adding a word from the automatic dictionary. - size_t Mutate_AddWordFromAutoDictionary(uint8_t *Data, size_t Size, - size_t MaxSize); - - /// Tries to find an ASCII integer in Data, changes it to another ASCII int. - size_t Mutate_ChangeASCIIInteger(uint8_t *Data, size_t Size, size_t MaxSize); - - /// CrossOver Data with some other element of the corpus. - size_t Mutate_CrossOver(uint8_t *Data, size_t Size, size_t MaxSize); - - /// Applies one of the above mutations. - /// Returns the new size of data which could be up to MaxSize. - size_t Mutate(uint8_t *Data, size_t Size, size_t MaxSize); - - /// Creates a cross-over of two pieces of Data, returns its size. - size_t CrossOver(const uint8_t *Data1, size_t Size1, const uint8_t *Data2, - size_t Size2, uint8_t *Out, size_t MaxOutSize); - - void AddWordToManualDictionary(const Unit &Word); - - void AddWordToAutoDictionary(const Unit &Word, size_t PositionHint); - void ClearAutoDictionary(); - - void SetCorpus(const std::vector<Unit> *Corpus); - - private: - FuzzerRandomBase &Rand; - struct Impl; - Impl *MDImpl; -}; - -// For backward compatibility only, deprecated. -static inline size_t Mutate(uint8_t *Data, size_t Size, size_t MaxSize, - FuzzerRandomBase &Rand) { - MutationDispatcher MD(Rand); - return MD.Mutate(Data, Size, MaxSize); -} - -/** An abstract class that allows to use user-supplied mutators with libFuzzer. - -Usage: - -#\code -#include "FuzzerInterface.h" -class MyFuzzer : public fuzzer::UserSuppliedFuzzer { - public: - MyFuzzer(fuzzer::FuzzerRandomBase *Rand); - // Must define the target function. - int TargetFunction(...) { ...; return 0; } - // Optionally define the mutator. - size_t Mutate(...) { ... } - // Optionally define the CrossOver method. - size_t CrossOver(...) { ... } -}; - -int main(int argc, char **argv) { - MyFuzzer F; - fuzzer::FuzzerDriver(argc, argv, F); -} -#\endcode -*/ -class UserSuppliedFuzzer { - public: - UserSuppliedFuzzer(FuzzerRandomBase *Rand); - /// Executes the target function on 'Size' bytes of 'Data'. - virtual int TargetFunction(const uint8_t *Data, size_t Size) = 0; - virtual void StartMutationSequence() { MD.StartMutationSequence(); } - virtual void PrintMutationSequence() { MD.PrintMutationSequence(); } - virtual void SetCorpus(const std::vector<Unit> *Corpus) { - MD.SetCorpus(Corpus); - } - /// Mutates 'Size' bytes of data in 'Data' inplace into up to 'MaxSize' bytes, - /// returns the new size of the data, which should be positive. - virtual size_t Mutate(uint8_t *Data, size_t Size, size_t MaxSize) { - return MD.Mutate(Data, Size, MaxSize); - } - /// Crosses 'Data1' and 'Data2', writes up to 'MaxOutSize' bytes into Out, - /// returns the number of bytes written, which should be positive. - virtual size_t CrossOver(const uint8_t *Data1, size_t Size1, - const uint8_t *Data2, size_t Size2, - uint8_t *Out, size_t MaxOutSize) { - return MD.CrossOver(Data1, Size1, Data2, Size2, Out, MaxOutSize); - } - virtual ~UserSuppliedFuzzer(); - - FuzzerRandomBase &GetRand() { return *Rand; } - - MutationDispatcher &GetMD() { return MD; } - - private: - bool OwnRand = false; - FuzzerRandomBase *Rand; - MutationDispatcher MD; -}; - -/// Runs the fuzzing with the UserSuppliedFuzzer. -int FuzzerDriver(int argc, char **argv, UserSuppliedFuzzer &USF); - -/// More C++-ish interface. -int FuzzerDriver(const std::vector<std::string> &Args, UserSuppliedFuzzer &USF); -int FuzzerDriver(const std::vector<std::string> &Args, UserCallback Callback); - -} // namespace fuzzer - -#endif // LLVM_FUZZER_INTERFACE_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerInternal.h b/gnu/llvm/lib/Fuzzer/FuzzerInternal.h deleted file mode 100644 index c1e9daac980..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerInternal.h +++ /dev/null @@ -1,207 +0,0 @@ -//===- FuzzerInternal.h - Internal header for the Fuzzer --------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Define the main class fuzzer::Fuzzer and most functions. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_INTERNAL_H -#define LLVM_FUZZER_INTERNAL_H - -#include <cassert> -#include <climits> -#include <chrono> -#include <cstddef> -#include <cstdlib> -#include <string> -#include <vector> -#include <unordered_set> - -#include "FuzzerInterface.h" - -namespace fuzzer { -using namespace std::chrono; - -std::string FileToString(const std::string &Path); -Unit FileToVector(const std::string &Path); -void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V, - long *Epoch); -void WriteToFile(const Unit &U, const std::string &Path); -void CopyFileToErr(const std::string &Path); -// Returns "Dir/FileName" or equivalent for the current OS. -std::string DirPlusFile(const std::string &DirPath, - const std::string &FileName); - -void Printf(const char *Fmt, ...); -void Print(const Unit &U, const char *PrintAfter = ""); -void PrintASCII(const uint8_t *Data, size_t Size, const char *PrintAfter = ""); -void PrintASCII(const Unit &U, const char *PrintAfter = ""); -std::string Hash(const Unit &U); -void SetTimer(int Seconds); -std::string Base64(const Unit &U); -int ExecuteCommand(const std::string &Command); - -// Private copy of SHA1 implementation. -static const int kSHA1NumBytes = 20; -// Computes SHA1 hash of 'Len' bytes in 'Data', writes kSHA1NumBytes to 'Out'. -void ComputeSHA1(const uint8_t *Data, size_t Len, uint8_t *Out); - -// Changes U to contain only ASCII (isprint+isspace) characters. -// Returns true iff U has been changed. -bool ToASCII(Unit &U); -bool IsASCII(const Unit &U); - -int NumberOfCpuCores(); -int GetPid(); - -// Dictionary. - -// Parses one dictionary entry. -// If successfull, write the enty to Unit and returns true, -// otherwise returns false. -bool ParseOneDictionaryEntry(const std::string &Str, Unit *U); -// Parses the dictionary file, fills Units, returns true iff all lines -// were parsed succesfully. -bool ParseDictionaryFile(const std::string &Text, std::vector<Unit> *Units); - -class Fuzzer { - public: - struct FuzzingOptions { - int Verbosity = 1; - int MaxLen = 0; - int UnitTimeoutSec = 300; - int MaxTotalTimeSec = 0; - bool DoCrossOver = true; - int MutateDepth = 5; - bool ExitOnFirst = false; - bool UseCounters = false; - bool UseIndirCalls = true; - bool UseTraces = false; - bool UseFullCoverageSet = false; - bool Reload = true; - bool ShuffleAtStartUp = true; - int PreferSmallDuringInitialShuffle = -1; - size_t MaxNumberOfRuns = ULONG_MAX; - int SyncTimeout = 600; - int ReportSlowUnits = 10; - bool OnlyASCII = false; - std::string OutputCorpus; - std::string SyncCommand; - std::string ArtifactPrefix = "./"; - std::string ExactArtifactPath; - bool SaveArtifacts = true; - bool PrintNEW = true; // Print a status line when new units are found; - bool OutputCSV = false; - bool PrintNewCovPcs = false; - }; - Fuzzer(UserSuppliedFuzzer &USF, FuzzingOptions Options); - void AddToCorpus(const Unit &U) { Corpus.push_back(U); } - size_t ChooseUnitIdxToMutate(); - const Unit &ChooseUnitToMutate() { return Corpus[ChooseUnitIdxToMutate()]; }; - void Loop(); - void Drill(); - void ShuffleAndMinimize(); - void InitializeTraceState(); - size_t CorpusSize() const { return Corpus.size(); } - void ReadDir(const std::string &Path, long *Epoch) { - Printf("Loading corpus: %s\n", Path.c_str()); - ReadDirToVectorOfUnits(Path.c_str(), &Corpus, Epoch); - } - void RereadOutputCorpus(); - // Save the current corpus to OutputCorpus. - void SaveCorpus(); - - size_t secondsSinceProcessStartUp() { - return duration_cast<seconds>(system_clock::now() - ProcessStartTime) - .count(); - } - - size_t getTotalNumberOfRuns() { return TotalNumberOfRuns; } - - static void StaticAlarmCallback(); - - void ExecuteCallback(const Unit &U); - - // Merge Corpora[1:] into Corpora[0]. - void Merge(const std::vector<std::string> &Corpora); - - private: - void AlarmCallback(); - void MutateAndTestOne(); - void ReportNewCoverage(const Unit &U); - bool RunOne(const Unit &U); - void RunOneAndUpdateCorpus(Unit &U); - void WriteToOutputCorpus(const Unit &U); - void WriteUnitToFileWithPrefix(const Unit &U, const char *Prefix); - void PrintStats(const char *Where, const char *End = "\n"); - void PrintStatusForNewUnit(const Unit &U); - void PrintUnitInASCII(const Unit &U, const char *PrintAfter = ""); - - void SyncCorpus(); - - size_t RecordBlockCoverage(); - size_t RecordCallerCalleeCoverage(); - void PrepareCoverageBeforeRun(); - bool CheckCoverageAfterRun(); - - - // Trace-based fuzzing: we run a unit with some kind of tracing - // enabled and record potentially useful mutations. Then - // We apply these mutations one by one to the unit and run it again. - - // Start tracing; forget all previously proposed mutations. - void StartTraceRecording(); - // Stop tracing. - void StopTraceRecording(); - - void SetDeathCallback(); - static void StaticDeathCallback(); - void DeathCallback(); - Unit CurrentUnit; - - size_t TotalNumberOfRuns = 0; - size_t TotalNumberOfExecutedTraceBasedMutations = 0; - - std::vector<Unit> Corpus; - std::unordered_set<std::string> UnitHashesAddedToCorpus; - - // For UseCounters - std::vector<uint8_t> CounterBitmap; - size_t TotalBits() { // Slow. Call it only for printing stats. - size_t Res = 0; - for (auto x : CounterBitmap) Res += __builtin_popcount(x); - return Res; - } - - UserSuppliedFuzzer &USF; - FuzzingOptions Options; - system_clock::time_point ProcessStartTime = system_clock::now(); - system_clock::time_point LastExternalSync = system_clock::now(); - system_clock::time_point UnitStartTime; - long TimeOfLongestUnitInSeconds = 0; - long EpochOfLastReadOfOutputCorpus = 0; - size_t LastRecordedBlockCoverage = 0; - size_t LastRecordedCallerCalleeCoverage = 0; - size_t LastCoveragePcBufferLen = 0; -}; - -class SimpleUserSuppliedFuzzer: public UserSuppliedFuzzer { - public: - SimpleUserSuppliedFuzzer(FuzzerRandomBase *Rand, UserCallback Callback) - : UserSuppliedFuzzer(Rand), Callback(Callback) {} - - virtual int TargetFunction(const uint8_t *Data, size_t Size) override { - return Callback(Data, Size); - } - - private: - UserCallback Callback = nullptr; -}; - -}; // namespace fuzzer - -#endif // LLVM_FUZZER_INTERNAL_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerLoop.cpp b/gnu/llvm/lib/Fuzzer/FuzzerLoop.cpp deleted file mode 100644 index 5237682ff24..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerLoop.cpp +++ /dev/null @@ -1,512 +0,0 @@ -//===- FuzzerLoop.cpp - Fuzzer's main loop --------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Fuzzer's main loop. -//===----------------------------------------------------------------------===// - -#include "FuzzerInternal.h" -#include <algorithm> - -#if defined(__has_include) -# if __has_include(<sanitizer/coverage_interface.h>) -# include <sanitizer/coverage_interface.h> -# endif -#endif - -extern "C" { -// Re-declare some of the sanitizer functions as "weak" so that -// libFuzzer can be linked w/o the sanitizers and sanitizer-coverage -// (in which case it will complain at start-up time). -__attribute__((weak)) void __sanitizer_print_stack_trace(); -__attribute__((weak)) void __sanitizer_reset_coverage(); -__attribute__((weak)) size_t __sanitizer_get_total_unique_caller_callee_pairs(); -__attribute__((weak)) size_t __sanitizer_get_total_unique_coverage(); -__attribute__((weak)) -void __sanitizer_set_death_callback(void (*callback)(void)); -__attribute__((weak)) size_t __sanitizer_get_number_of_counters(); -__attribute__((weak)) -uintptr_t __sanitizer_update_counter_bitset_and_clear_counters(uint8_t *bitset); -__attribute__((weak)) uintptr_t -__sanitizer_get_coverage_pc_buffer(uintptr_t **data); -} - -namespace fuzzer { -static const size_t kMaxUnitSizeToPrint = 256; - -static void MissingWeakApiFunction(const char *FnName) { - Printf("ERROR: %s is not defined. Exiting.\n" - "Did you use -fsanitize-coverage=... to build your code?\n", FnName); - exit(1); -} - -#define CHECK_WEAK_API_FUNCTION(fn) \ - do { \ - if (!fn) \ - MissingWeakApiFunction(#fn); \ - } while (false) - -// Only one Fuzzer per process. -static Fuzzer *F; - -Fuzzer::Fuzzer(UserSuppliedFuzzer &USF, FuzzingOptions Options) - : USF(USF), Options(Options) { - SetDeathCallback(); - InitializeTraceState(); - assert(!F); - F = this; -} - -void Fuzzer::SetDeathCallback() { - CHECK_WEAK_API_FUNCTION(__sanitizer_set_death_callback); - __sanitizer_set_death_callback(StaticDeathCallback); -} - -void Fuzzer::PrintUnitInASCII(const Unit &U, const char *PrintAfter) { - PrintASCII(U, PrintAfter); -} - -void Fuzzer::StaticDeathCallback() { - assert(F); - F->DeathCallback(); -} - -void Fuzzer::DeathCallback() { - Printf("DEATH:\n"); - if (CurrentUnit.size() <= kMaxUnitSizeToPrint) { - Print(CurrentUnit, "\n"); - PrintUnitInASCII(CurrentUnit, "\n"); - } - WriteUnitToFileWithPrefix(CurrentUnit, "crash-"); -} - -void Fuzzer::StaticAlarmCallback() { - assert(F); - F->AlarmCallback(); -} - -void Fuzzer::AlarmCallback() { - assert(Options.UnitTimeoutSec > 0); - size_t Seconds = - duration_cast<seconds>(system_clock::now() - UnitStartTime).count(); - if (Seconds == 0) return; - if (Options.Verbosity >= 2) - Printf("AlarmCallback %zd\n", Seconds); - if (Seconds >= (size_t)Options.UnitTimeoutSec) { - Printf("ALARM: working on the last Unit for %zd seconds\n", Seconds); - Printf(" and the timeout value is %d (use -timeout=N to change)\n", - Options.UnitTimeoutSec); - if (CurrentUnit.size() <= kMaxUnitSizeToPrint) { - Print(CurrentUnit, "\n"); - PrintUnitInASCII(CurrentUnit, "\n"); - } - WriteUnitToFileWithPrefix(CurrentUnit, "timeout-"); - Printf("==%d== ERROR: libFuzzer: timeout after %d seconds\n", GetPid(), - Seconds); - if (__sanitizer_print_stack_trace) - __sanitizer_print_stack_trace(); - Printf("SUMMARY: libFuzzer: timeout\n"); - exit(1); - } -} - -void Fuzzer::PrintStats(const char *Where, const char *End) { - size_t Seconds = secondsSinceProcessStartUp(); - size_t ExecPerSec = (Seconds ? TotalNumberOfRuns / Seconds : 0); - - if (Options.OutputCSV) { - static bool csvHeaderPrinted = false; - if (!csvHeaderPrinted) { - csvHeaderPrinted = true; - Printf("runs,block_cov,bits,cc_cov,corpus,execs_per_sec,tbms,reason\n"); - } - Printf("%zd,%zd,%zd,%zd,%zd,%zd,%zd,%s\n", TotalNumberOfRuns, - LastRecordedBlockCoverage, TotalBits(), - LastRecordedCallerCalleeCoverage, Corpus.size(), ExecPerSec, - TotalNumberOfExecutedTraceBasedMutations, Where); - } - - if (!Options.Verbosity) - return; - Printf("#%zd\t%s", TotalNumberOfRuns, Where); - if (LastRecordedBlockCoverage) - Printf(" cov: %zd", LastRecordedBlockCoverage); - if (auto TB = TotalBits()) - Printf(" bits: %zd", TB); - if (LastRecordedCallerCalleeCoverage) - Printf(" indir: %zd", LastRecordedCallerCalleeCoverage); - Printf(" units: %zd exec/s: %zd", Corpus.size(), ExecPerSec); - if (TotalNumberOfExecutedTraceBasedMutations) - Printf(" tbm: %zd", TotalNumberOfExecutedTraceBasedMutations); - Printf("%s", End); -} - -void Fuzzer::RereadOutputCorpus() { - if (Options.OutputCorpus.empty()) return; - std::vector<Unit> AdditionalCorpus; - ReadDirToVectorOfUnits(Options.OutputCorpus.c_str(), &AdditionalCorpus, - &EpochOfLastReadOfOutputCorpus); - if (Corpus.empty()) { - Corpus = AdditionalCorpus; - return; - } - if (!Options.Reload) return; - if (Options.Verbosity >= 2) - Printf("Reload: read %zd new units.\n", AdditionalCorpus.size()); - for (auto &X : AdditionalCorpus) { - if (X.size() > (size_t)Options.MaxLen) - X.resize(Options.MaxLen); - if (UnitHashesAddedToCorpus.insert(Hash(X)).second) { - CurrentUnit.clear(); - CurrentUnit.insert(CurrentUnit.begin(), X.begin(), X.end()); - if (RunOne(CurrentUnit)) { - Corpus.push_back(X); - PrintStats("RELOAD"); - } - } - } -} - -void Fuzzer::ShuffleAndMinimize() { - bool PreferSmall = (Options.PreferSmallDuringInitialShuffle == 1 || - (Options.PreferSmallDuringInitialShuffle == -1 && - USF.GetRand().RandBool())); - if (Options.Verbosity) - Printf("PreferSmall: %d\n", PreferSmall); - PrintStats("READ "); - std::vector<Unit> NewCorpus; - if (Options.ShuffleAtStartUp) { - std::random_shuffle(Corpus.begin(), Corpus.end(), USF.GetRand()); - if (PreferSmall) - std::stable_sort( - Corpus.begin(), Corpus.end(), - [](const Unit &A, const Unit &B) { return A.size() < B.size(); }); - } - Unit &U = CurrentUnit; - for (const auto &C : Corpus) { - for (size_t First = 0; First < 1; First++) { - U.clear(); - size_t Last = std::min(First + Options.MaxLen, C.size()); - U.insert(U.begin(), C.begin() + First, C.begin() + Last); - if (Options.OnlyASCII) - ToASCII(U); - if (RunOne(U)) { - NewCorpus.push_back(U); - if (Options.Verbosity >= 2) - Printf("NEW0: %zd L %zd\n", LastRecordedBlockCoverage, U.size()); - } - } - } - Corpus = NewCorpus; - for (auto &X : Corpus) - UnitHashesAddedToCorpus.insert(Hash(X)); - PrintStats("INITED"); -} - -bool Fuzzer::RunOne(const Unit &U) { - UnitStartTime = system_clock::now(); - TotalNumberOfRuns++; - - PrepareCoverageBeforeRun(); - ExecuteCallback(U); - bool Res = CheckCoverageAfterRun(); - - auto UnitStopTime = system_clock::now(); - auto TimeOfUnit = - duration_cast<seconds>(UnitStopTime - UnitStartTime).count(); - if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1)) && - secondsSinceProcessStartUp() >= 2) - PrintStats("pulse "); - if (TimeOfUnit > TimeOfLongestUnitInSeconds && - TimeOfUnit >= Options.ReportSlowUnits) { - TimeOfLongestUnitInSeconds = TimeOfUnit; - Printf("Slowest unit: %zd s:\n", TimeOfLongestUnitInSeconds); - WriteUnitToFileWithPrefix(U, "slow-unit-"); - } - return Res; -} - -void Fuzzer::RunOneAndUpdateCorpus(Unit &U) { - if (TotalNumberOfRuns >= Options.MaxNumberOfRuns) - return; - if (Options.OnlyASCII) - ToASCII(U); - if (RunOne(U)) - ReportNewCoverage(U); -} - -void Fuzzer::ExecuteCallback(const Unit &U) { - const uint8_t *Data = U.data(); - uint8_t EmptyData; - if (!Data) - Data = &EmptyData; - int Res = USF.TargetFunction(Data, U.size()); - (void)Res; - assert(Res == 0); -} - -size_t Fuzzer::RecordBlockCoverage() { - CHECK_WEAK_API_FUNCTION(__sanitizer_get_total_unique_coverage); - uintptr_t PrevCoverage = LastRecordedBlockCoverage; - LastRecordedBlockCoverage = __sanitizer_get_total_unique_coverage(); - - if (PrevCoverage == LastRecordedBlockCoverage || !Options.PrintNewCovPcs) - return LastRecordedBlockCoverage; - - uintptr_t PrevBufferLen = LastCoveragePcBufferLen; - uintptr_t *CoverageBuf; - LastCoveragePcBufferLen = __sanitizer_get_coverage_pc_buffer(&CoverageBuf); - assert(CoverageBuf); - for (size_t i = PrevBufferLen; i < LastCoveragePcBufferLen; ++i) { - Printf("0x%x\n", CoverageBuf[i]); - } - - return LastRecordedBlockCoverage; -} - -size_t Fuzzer::RecordCallerCalleeCoverage() { - if (!Options.UseIndirCalls) - return 0; - if (!__sanitizer_get_total_unique_caller_callee_pairs) - return 0; - return LastRecordedCallerCalleeCoverage = - __sanitizer_get_total_unique_caller_callee_pairs(); -} - -void Fuzzer::PrepareCoverageBeforeRun() { - if (Options.UseCounters) { - size_t NumCounters = __sanitizer_get_number_of_counters(); - CounterBitmap.resize(NumCounters); - __sanitizer_update_counter_bitset_and_clear_counters(0); - } - RecordBlockCoverage(); - RecordCallerCalleeCoverage(); -} - -bool Fuzzer::CheckCoverageAfterRun() { - size_t OldCoverage = LastRecordedBlockCoverage; - size_t NewCoverage = RecordBlockCoverage(); - size_t OldCallerCalleeCoverage = LastRecordedCallerCalleeCoverage; - size_t NewCallerCalleeCoverage = RecordCallerCalleeCoverage(); - size_t NumNewBits = 0; - if (Options.UseCounters) - NumNewBits = __sanitizer_update_counter_bitset_and_clear_counters( - CounterBitmap.data()); - return NewCoverage > OldCoverage || - NewCallerCalleeCoverage > OldCallerCalleeCoverage || NumNewBits; -} - -void Fuzzer::WriteToOutputCorpus(const Unit &U) { - if (Options.OutputCorpus.empty()) return; - std::string Path = DirPlusFile(Options.OutputCorpus, Hash(U)); - WriteToFile(U, Path); - if (Options.Verbosity >= 2) - Printf("Written to %s\n", Path.c_str()); - assert(!Options.OnlyASCII || IsASCII(U)); -} - -void Fuzzer::WriteUnitToFileWithPrefix(const Unit &U, const char *Prefix) { - if (!Options.SaveArtifacts) - return; - std::string Path = Options.ArtifactPrefix + Prefix + Hash(U); - if (!Options.ExactArtifactPath.empty()) - Path = Options.ExactArtifactPath; // Overrides ArtifactPrefix. - WriteToFile(U, Path); - Printf("artifact_prefix='%s'; Test unit written to %s\n", - Options.ArtifactPrefix.c_str(), Path.c_str()); - if (U.size() <= kMaxUnitSizeToPrint) - Printf("Base64: %s\n", Base64(U).c_str()); -} - -void Fuzzer::SaveCorpus() { - if (Options.OutputCorpus.empty()) return; - for (const auto &U : Corpus) - WriteToFile(U, DirPlusFile(Options.OutputCorpus, Hash(U))); - if (Options.Verbosity) - Printf("Written corpus of %zd files to %s\n", Corpus.size(), - Options.OutputCorpus.c_str()); -} - -void Fuzzer::PrintStatusForNewUnit(const Unit &U) { - if (!Options.PrintNEW) - return; - PrintStats("NEW ", ""); - if (Options.Verbosity) { - Printf(" L: %zd ", U.size()); - USF.PrintMutationSequence(); - Printf("\n"); - } -} - -void Fuzzer::ReportNewCoverage(const Unit &U) { - Corpus.push_back(U); - UnitHashesAddedToCorpus.insert(Hash(U)); - PrintStatusForNewUnit(U); - WriteToOutputCorpus(U); - if (Options.ExitOnFirst) - exit(0); -} - -void Fuzzer::Merge(const std::vector<std::string> &Corpora) { - if (Corpora.size() <= 1) { - Printf("Merge requires two or more corpus dirs\n"); - return; - } - auto InitialCorpusDir = Corpora[0]; - ReadDir(InitialCorpusDir, nullptr); - Printf("Merge: running the initial corpus '%s' of %d units\n", - InitialCorpusDir.c_str(), Corpus.size()); - for (auto &U : Corpus) - RunOne(U); - - std::vector<std::string> ExtraCorpora(Corpora.begin() + 1, Corpora.end()); - - size_t NumTried = 0; - size_t NumMerged = 0; - for (auto &C : ExtraCorpora) { - Corpus.clear(); - ReadDir(C, nullptr); - Printf("Merge: merging the extra corpus '%s' of %zd units\n", C.c_str(), - Corpus.size()); - for (auto &U : Corpus) { - NumTried++; - if (RunOne(U)) { - WriteToOutputCorpus(U); - NumMerged++; - } - } - } - Printf("Merge: written %zd out of %zd units\n", NumMerged, NumTried); -} - -void Fuzzer::MutateAndTestOne() { - auto &U = CurrentUnit; - USF.StartMutationSequence(); - - U = ChooseUnitToMutate(); - - for (int i = 0; i < Options.MutateDepth; i++) { - size_t Size = U.size(); - U.resize(Options.MaxLen); - size_t NewSize = USF.Mutate(U.data(), Size, U.size()); - assert(NewSize > 0 && "Mutator returned empty unit"); - assert(NewSize <= (size_t)Options.MaxLen && - "Mutator return overisized unit"); - U.resize(NewSize); - if (i == 0) - StartTraceRecording(); - RunOneAndUpdateCorpus(U); - StopTraceRecording(); - } -} - -// Returns an index of random unit from the corpus to mutate. -// Hypothesis: units added to the corpus last are more likely to be interesting. -// This function gives more wieght to the more recent units. -size_t Fuzzer::ChooseUnitIdxToMutate() { - size_t N = Corpus.size(); - size_t Total = (N + 1) * N / 2; - size_t R = USF.GetRand()(Total); - size_t IdxBeg = 0, IdxEnd = N; - // Binary search. - while (IdxEnd - IdxBeg >= 2) { - size_t Idx = IdxBeg + (IdxEnd - IdxBeg) / 2; - if (R > (Idx + 1) * Idx / 2) - IdxBeg = Idx; - else - IdxEnd = Idx; - } - assert(IdxBeg < N); - return IdxBeg; -} - -// Experimental search heuristic: drilling. -// - Read, shuffle, execute and minimize the corpus. -// - Choose one random unit. -// - Reset the coverage. -// - Start fuzzing as if the chosen unit was the only element of the corpus. -// - When done, reset the coverage again. -// - Merge the newly created corpus into the original one. -void Fuzzer::Drill() { - // The corpus is already read, shuffled, and minimized. - assert(!Corpus.empty()); - Options.PrintNEW = false; // Don't print NEW status lines when drilling. - - Unit U = ChooseUnitToMutate(); - - CHECK_WEAK_API_FUNCTION(__sanitizer_reset_coverage); - __sanitizer_reset_coverage(); - - std::vector<Unit> SavedCorpus; - SavedCorpus.swap(Corpus); - Corpus.push_back(U); - assert(Corpus.size() == 1); - RunOne(U); - PrintStats("DRILL "); - std::string SavedOutputCorpusPath; // Don't write new units while drilling. - SavedOutputCorpusPath.swap(Options.OutputCorpus); - Loop(); - - __sanitizer_reset_coverage(); - - PrintStats("REINIT"); - SavedOutputCorpusPath.swap(Options.OutputCorpus); - for (auto &U : SavedCorpus) { - CurrentUnit = U; - RunOne(U); - } - PrintStats("MERGE "); - Options.PrintNEW = true; - size_t NumMerged = 0; - for (auto &U : Corpus) { - CurrentUnit = U; - if (RunOne(U)) { - PrintStatusForNewUnit(U); - NumMerged++; - WriteToOutputCorpus(U); - } - } - PrintStats("MERGED"); - if (NumMerged && Options.Verbosity) - Printf("Drilling discovered %zd new units\n", NumMerged); -} - -void Fuzzer::Loop() { - system_clock::time_point LastCorpusReload = system_clock::now(); - if (Options.DoCrossOver) - USF.SetCorpus(&Corpus); - while (true) { - SyncCorpus(); - auto Now = system_clock::now(); - if (duration_cast<seconds>(Now - LastCorpusReload).count()) { - RereadOutputCorpus(); - LastCorpusReload = Now; - } - if (TotalNumberOfRuns >= Options.MaxNumberOfRuns) - break; - if (Options.MaxTotalTimeSec > 0 && - secondsSinceProcessStartUp() > - static_cast<size_t>(Options.MaxTotalTimeSec)) - break; - // Perform several mutations and runs. - MutateAndTestOne(); - } - - PrintStats("DONE ", "\n"); -} - -void Fuzzer::SyncCorpus() { - if (Options.SyncCommand.empty() || Options.OutputCorpus.empty()) return; - auto Now = system_clock::now(); - if (duration_cast<seconds>(Now - LastExternalSync).count() < - Options.SyncTimeout) - return; - LastExternalSync = Now; - ExecuteCommand(Options.SyncCommand + " " + Options.OutputCorpus); -} - -} // namespace fuzzer diff --git a/gnu/llvm/lib/Fuzzer/FuzzerMain.cpp b/gnu/llvm/lib/Fuzzer/FuzzerMain.cpp deleted file mode 100644 index c5af5b05909..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerMain.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//===- FuzzerMain.cpp - main() function and flags -------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// main() and flags. -//===----------------------------------------------------------------------===// - -#include "FuzzerInterface.h" -#include "FuzzerInternal.h" - -// This function should be defined by the user. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); - -int main(int argc, char **argv) { - return fuzzer::FuzzerDriver(argc, argv, LLVMFuzzerTestOneInput); -} diff --git a/gnu/llvm/lib/Fuzzer/FuzzerMerge.cpp b/gnu/llvm/lib/Fuzzer/FuzzerMerge.cpp deleted file mode 100644 index 9e559115680..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerMerge.cpp +++ /dev/null @@ -1,269 +0,0 @@ -//===- FuzzerMerge.cpp - merging corpora ----------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Merging corpora. -//===----------------------------------------------------------------------===// - -#include "FuzzerInternal.h" -#include "FuzzerIO.h" -#include "FuzzerMerge.h" -#include "FuzzerTracePC.h" -#include "FuzzerUtil.h" - -#include <fstream> -#include <iterator> -#include <sstream> - -namespace fuzzer { - -bool Merger::Parse(const std::string &Str, bool ParseCoverage) { - std::istringstream SS(Str); - return Parse(SS, ParseCoverage); -} - -void Merger::ParseOrExit(std::istream &IS, bool ParseCoverage) { - if (!Parse(IS, ParseCoverage)) { - Printf("MERGE: failed to parse the control file (unexpected error)\n"); - exit(1); - } -} - -// The control file example: -// -// 3 # The number of inputs -// 1 # The number of inputs in the first corpus, <= the previous number -// file0 -// file1 -// file2 # One file name per line. -// STARTED 0 123 # FileID, file size -// DONE 0 1 4 6 8 # FileID COV1 COV2 ... -// STARTED 1 456 # If DONE is missing, the input crashed while processing. -// STARTED 2 567 -// DONE 2 8 9 -bool Merger::Parse(std::istream &IS, bool ParseCoverage) { - LastFailure.clear(); - std::string Line; - - // Parse NumFiles. - if (!std::getline(IS, Line, '\n')) return false; - std::istringstream L1(Line); - size_t NumFiles = 0; - L1 >> NumFiles; - if (NumFiles == 0 || NumFiles > 10000000) return false; - - // Parse NumFilesInFirstCorpus. - if (!std::getline(IS, Line, '\n')) return false; - std::istringstream L2(Line); - NumFilesInFirstCorpus = NumFiles + 1; - L2 >> NumFilesInFirstCorpus; - if (NumFilesInFirstCorpus > NumFiles) return false; - - // Parse file names. - Files.resize(NumFiles); - for (size_t i = 0; i < NumFiles; i++) - if (!std::getline(IS, Files[i].Name, '\n')) - return false; - - // Parse STARTED and DONE lines. - size_t ExpectedStartMarker = 0; - const size_t kInvalidStartMarker = -1; - size_t LastSeenStartMarker = kInvalidStartMarker; - while (std::getline(IS, Line, '\n')) { - std::istringstream ISS1(Line); - std::string Marker; - size_t N; - ISS1 >> Marker; - ISS1 >> N; - if (Marker == "STARTED") { - // STARTED FILE_ID FILE_SIZE - if (ExpectedStartMarker != N) - return false; - ISS1 >> Files[ExpectedStartMarker].Size; - LastSeenStartMarker = ExpectedStartMarker; - assert(ExpectedStartMarker < Files.size()); - ExpectedStartMarker++; - } else if (Marker == "DONE") { - // DONE FILE_SIZE COV1 COV2 COV3 ... - size_t CurrentFileIdx = N; - if (CurrentFileIdx != LastSeenStartMarker) - return false; - LastSeenStartMarker = kInvalidStartMarker; - if (ParseCoverage) { - auto &V = Files[CurrentFileIdx].Features; - V.clear(); - while (ISS1 >> std::hex >> N) - V.push_back(N); - std::sort(V.begin(), V.end()); - } - } else { - return false; - } - } - if (LastSeenStartMarker != kInvalidStartMarker) - LastFailure = Files[LastSeenStartMarker].Name; - - FirstNotProcessedFile = ExpectedStartMarker; - return true; -} - -// Decides which files need to be merged (add thost to NewFiles). -// Returns the number of new features added. -size_t Merger::Merge(std::vector<std::string> *NewFiles) { - NewFiles->clear(); - assert(NumFilesInFirstCorpus <= Files.size()); - std::set<uint32_t> AllFeatures; - - // What features are in the initial corpus? - for (size_t i = 0; i < NumFilesInFirstCorpus; i++) { - auto &Cur = Files[i].Features; - AllFeatures.insert(Cur.begin(), Cur.end()); - } - size_t InitialNumFeatures = AllFeatures.size(); - - // Remove all features that we already know from all other inputs. - for (size_t i = NumFilesInFirstCorpus; i < Files.size(); i++) { - auto &Cur = Files[i].Features; - std::vector<uint32_t> Tmp; - std::set_difference(Cur.begin(), Cur.end(), AllFeatures.begin(), - AllFeatures.end(), std::inserter(Tmp, Tmp.begin())); - Cur.swap(Tmp); - } - - // Sort. Give preference to - // * smaller files - // * files with more features. - std::sort(Files.begin() + NumFilesInFirstCorpus, Files.end(), - [&](const MergeFileInfo &a, const MergeFileInfo &b) -> bool { - if (a.Size != b.Size) - return a.Size < b.Size; - return a.Features.size() > b.Features.size(); - }); - - // One greedy pass: add the file's features to AllFeatures. - // If new features were added, add this file to NewFiles. - for (size_t i = NumFilesInFirstCorpus; i < Files.size(); i++) { - auto &Cur = Files[i].Features; - // Printf("%s -> sz %zd ft %zd\n", Files[i].Name.c_str(), - // Files[i].Size, Cur.size()); - size_t OldSize = AllFeatures.size(); - AllFeatures.insert(Cur.begin(), Cur.end()); - if (AllFeatures.size() > OldSize) - NewFiles->push_back(Files[i].Name); - } - return AllFeatures.size() - InitialNumFeatures; -} - -// Inner process. May crash if the target crashes. -void Fuzzer::CrashResistantMergeInternalStep(const std::string &CFPath) { - Printf("MERGE-INNER: using the control file '%s'\n", CFPath.c_str()); - Merger M; - std::ifstream IF(CFPath); - M.ParseOrExit(IF, false); - IF.close(); - if (!M.LastFailure.empty()) - Printf("MERGE-INNER: '%s' caused a failure at the previous merge step\n", - M.LastFailure.c_str()); - - Printf("MERGE-INNER: %zd total files;" - " %zd processed earlier; will process %zd files now\n", - M.Files.size(), M.FirstNotProcessedFile, - M.Files.size() - M.FirstNotProcessedFile); - - std::ofstream OF(CFPath, std::ofstream::out | std::ofstream::app); - for (size_t i = M.FirstNotProcessedFile; i < M.Files.size(); i++) { - auto U = FileToVector(M.Files[i].Name); - if (U.size() > MaxInputLen) { - U.resize(MaxInputLen); - U.shrink_to_fit(); - } - std::ostringstream StartedLine; - // Write the pre-run marker. - OF << "STARTED " << std::dec << i << " " << U.size() << "\n"; - OF.flush(); // Flush is important since ExecuteCommand may crash. - // Run. - TPC.ResetMaps(); - ExecuteCallback(U.data(), U.size()); - // Collect coverage. - std::set<size_t> Features; - TPC.CollectFeatures([&](size_t Feature) -> bool { - Features.insert(Feature); - return true; - }); - // Show stats. - TotalNumberOfRuns++; - if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1))) - PrintStats("pulse "); - // Write the post-run marker and the coverage. - OF << "DONE " << i; - for (size_t F : Features) - OF << " " << std::hex << F; - OF << "\n"; - } -} - -// Outer process. Does not call the target code and thus sohuld not fail. -void Fuzzer::CrashResistantMerge(const std::vector<std::string> &Args, - const std::vector<std::string> &Corpora) { - if (Corpora.size() <= 1) { - Printf("Merge requires two or more corpus dirs\n"); - return; - } - std::vector<std::string> AllFiles; - ListFilesInDirRecursive(Corpora[0], nullptr, &AllFiles, /*TopDir*/true); - size_t NumFilesInFirstCorpus = AllFiles.size(); - for (size_t i = 1; i < Corpora.size(); i++) - ListFilesInDirRecursive(Corpora[i], nullptr, &AllFiles, /*TopDir*/true); - Printf("MERGE-OUTER: %zd files, %zd in the initial corpus\n", - AllFiles.size(), NumFilesInFirstCorpus); - auto CFPath = DirPlusFile(TmpDir(), - "libFuzzerTemp." + std::to_string(GetPid()) + ".txt"); - // Write the control file. - RemoveFile(CFPath); - std::ofstream ControlFile(CFPath); - ControlFile << AllFiles.size() << "\n"; - ControlFile << NumFilesInFirstCorpus << "\n"; - for (auto &Path: AllFiles) - ControlFile << Path << "\n"; - if (!ControlFile) { - Printf("MERGE-OUTER: failed to write to the control file: %s\n", - CFPath.c_str()); - exit(1); - } - ControlFile.close(); - - // Execute the inner process untill it passes. - // Every inner process should execute at least one input. - std::string BaseCmd = CloneArgsWithoutX(Args, "keep-all-flags"); - for (size_t i = 1; i <= AllFiles.size(); i++) { - Printf("MERGE-OUTER: attempt %zd\n", i); - auto ExitCode = - ExecuteCommand(BaseCmd + " -merge_control_file=" + CFPath); - if (!ExitCode) { - Printf("MERGE-OUTER: succesfull in %zd attempt(s)\n", i); - break; - } - } - // Read the control file and do the merge. - Merger M; - std::ifstream IF(CFPath); - IF.seekg(0, IF.end); - Printf("MERGE-OUTER: the control file has %zd bytes\n", (size_t)IF.tellg()); - IF.seekg(0, IF.beg); - M.ParseOrExit(IF, true); - IF.close(); - std::vector<std::string> NewFiles; - size_t NumNewFeatures = M.Merge(&NewFiles); - Printf("MERGE-OUTER: %zd new files with %zd new features added\n", - NewFiles.size(), NumNewFeatures); - for (auto &F: NewFiles) - WriteToOutputCorpus(FileToVector(F)); - // We are done, delete the control file. - RemoveFile(CFPath); -} - -} // namespace fuzzer diff --git a/gnu/llvm/lib/Fuzzer/FuzzerMerge.h b/gnu/llvm/lib/Fuzzer/FuzzerMerge.h deleted file mode 100644 index 8a2fe5d74f8..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerMerge.h +++ /dev/null @@ -1,70 +0,0 @@ -//===- FuzzerMerge.h - merging corpa ----------------------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Merging Corpora. -// -// The task: -// Take the existing corpus (possibly empty) and merge new inputs into -// it so that only inputs with new coverage ('features') are added. -// The process should tolerate the crashes, OOMs, leaks, etc. -// -// Algorithm: -// The outter process collects the set of files and writes their names -// into a temporary "control" file, then repeatedly launches the inner -// process until all inputs are processed. -// The outer process does not actually execute the target code. -// -// The inner process reads the control file and sees a) list of all the inputs -// and b) the last processed input. Then it starts processing the inputs one -// by one. Before processing every input it writes one line to control file: -// STARTED INPUT_ID INPUT_SIZE -// After processing an input it write another line: -// DONE INPUT_ID Feature1 Feature2 Feature3 ... -// If a crash happens while processing an input the last line in the control -// file will be "STARTED INPUT_ID" and so the next process will know -// where to resume. -// -// Once all inputs are processed by the innner process(es) the outer process -// reads the control files and does the merge based entirely on the contents -// of control file. -// It uses a single pass greedy algorithm choosing first the smallest inputs -// within the same size the inputs that have more new features. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_MERGE_H -#define LLVM_FUZZER_MERGE_H - -#include "FuzzerDefs.h" - -#include <istream> -#include <set> - -namespace fuzzer { - -struct MergeFileInfo { - std::string Name; - size_t Size = 0; - std::vector<uint32_t> Features; -}; - -struct Merger { - std::vector<MergeFileInfo> Files; - size_t NumFilesInFirstCorpus = 0; - size_t FirstNotProcessedFile = 0; - std::string LastFailure; - - bool Parse(std::istream &IS, bool ParseCoverage); - bool Parse(const std::string &Str, bool ParseCoverage); - void ParseOrExit(std::istream &IS, bool ParseCoverage); - size_t Merge(std::vector<std::string> *NewFiles); -}; - -} // namespace fuzzer - -#endif // LLVM_FUZZER_MERGE_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerMutate.cpp b/gnu/llvm/lib/Fuzzer/FuzzerMutate.cpp deleted file mode 100644 index 30e5b43c083..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerMutate.cpp +++ /dev/null @@ -1,278 +0,0 @@ -//===- FuzzerMutate.cpp - Mutate a test input -----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Mutate a test input. -//===----------------------------------------------------------------------===// - -#include <cstring> - -#include "FuzzerInternal.h" - -#include <algorithm> - -namespace fuzzer { - -struct Mutator { - size_t (MutationDispatcher::*Fn)(uint8_t *Data, size_t Size, size_t Max); - const char *Name; -}; - -struct DictionaryEntry { - Unit Word; - size_t PositionHint; -}; - -struct MutationDispatcher::Impl { - std::vector<DictionaryEntry> ManualDictionary; - std::vector<DictionaryEntry> AutoDictionary; - std::vector<Mutator> Mutators; - std::vector<Mutator> CurrentMutatorSequence; - std::vector<DictionaryEntry> CurrentDictionaryEntrySequence; - const std::vector<Unit> *Corpus = nullptr; - FuzzerRandomBase &Rand; - - void Add(Mutator M) { Mutators.push_back(M); } - Impl(FuzzerRandomBase &Rand) : Rand(Rand) { - Add({&MutationDispatcher::Mutate_EraseByte, "EraseByte"}); - Add({&MutationDispatcher::Mutate_InsertByte, "InsertByte"}); - Add({&MutationDispatcher::Mutate_ChangeByte, "ChangeByte"}); - Add({&MutationDispatcher::Mutate_ChangeBit, "ChangeBit"}); - Add({&MutationDispatcher::Mutate_ShuffleBytes, "ShuffleBytes"}); - Add({&MutationDispatcher::Mutate_ChangeASCIIInteger, "ChangeASCIIInt"}); - Add({&MutationDispatcher::Mutate_CrossOver, "CrossOver"}); - Add({&MutationDispatcher::Mutate_AddWordFromManualDictionary, - "AddFromManualDict"}); - Add({&MutationDispatcher::Mutate_AddWordFromAutoDictionary, - "AddFromAutoDict"}); - } - void SetCorpus(const std::vector<Unit> *Corpus) { this->Corpus = Corpus; } - size_t AddWordFromDictionary(const std::vector<DictionaryEntry> &D, - uint8_t *Data, size_t Size, size_t MaxSize); -}; - -static char FlipRandomBit(char X, FuzzerRandomBase &Rand) { - int Bit = Rand(8); - char Mask = 1 << Bit; - char R; - if (X & (1 << Bit)) - R = X & ~Mask; - else - R = X | Mask; - assert(R != X); - return R; -} - -static char RandCh(FuzzerRandomBase &Rand) { - if (Rand.RandBool()) return Rand(256); - const char *Special = "!*'();:@&=+$,/?%#[]123ABCxyz-`~."; - return Special[Rand(sizeof(Special) - 1)]; -} - -size_t MutationDispatcher::Mutate_ShuffleBytes(uint8_t *Data, size_t Size, - size_t MaxSize) { - assert(Size); - size_t ShuffleAmount = - Rand(std::min(Size, (size_t)8)) + 1; // [1,8] and <= Size. - size_t ShuffleStart = Rand(Size - ShuffleAmount); - assert(ShuffleStart + ShuffleAmount <= Size); - std::random_shuffle(Data + ShuffleStart, Data + ShuffleStart + ShuffleAmount, - Rand); - return Size; -} - -size_t MutationDispatcher::Mutate_EraseByte(uint8_t *Data, size_t Size, - size_t MaxSize) { - assert(Size); - if (Size == 1) return 0; - size_t Idx = Rand(Size); - // Erase Data[Idx]. - memmove(Data + Idx, Data + Idx + 1, Size - Idx - 1); - return Size - 1; -} - -size_t MutationDispatcher::Mutate_InsertByte(uint8_t *Data, size_t Size, - size_t MaxSize) { - if (Size == MaxSize) return 0; - size_t Idx = Rand(Size + 1); - // Insert new value at Data[Idx]. - memmove(Data + Idx + 1, Data + Idx, Size - Idx); - Data[Idx] = RandCh(Rand); - return Size + 1; -} - -size_t MutationDispatcher::Mutate_ChangeByte(uint8_t *Data, size_t Size, - size_t MaxSize) { - size_t Idx = Rand(Size); - Data[Idx] = RandCh(Rand); - return Size; -} - -size_t MutationDispatcher::Mutate_ChangeBit(uint8_t *Data, size_t Size, - size_t MaxSize) { - size_t Idx = Rand(Size); - Data[Idx] = FlipRandomBit(Data[Idx], Rand); - return Size; -} - -size_t MutationDispatcher::Mutate_AddWordFromManualDictionary(uint8_t *Data, - size_t Size, - size_t MaxSize) { - return MDImpl->AddWordFromDictionary(MDImpl->ManualDictionary, Data, Size, - MaxSize); -} - -size_t MutationDispatcher::Mutate_AddWordFromAutoDictionary(uint8_t *Data, - size_t Size, - size_t MaxSize) { - return MDImpl->AddWordFromDictionary(MDImpl->AutoDictionary, Data, Size, - MaxSize); -} - -size_t MutationDispatcher::Impl::AddWordFromDictionary( - const std::vector<DictionaryEntry> &D, uint8_t *Data, size_t Size, - size_t MaxSize) { - if (D.empty()) return 0; - const DictionaryEntry &DE = D[Rand(D.size())]; - const Unit &Word = DE.Word; - size_t PositionHint = DE.PositionHint; - bool UsePositionHint = PositionHint != std::numeric_limits<size_t>::max() && - PositionHint + Word.size() < Size && Rand.RandBool(); - if (Rand.RandBool()) { // Insert Word. - if (Size + Word.size() > MaxSize) return 0; - size_t Idx = UsePositionHint ? PositionHint : Rand(Size + 1); - memmove(Data + Idx + Word.size(), Data + Idx, Size - Idx); - memcpy(Data + Idx, Word.data(), Word.size()); - Size += Word.size(); - } else { // Overwrite some bytes with Word. - if (Word.size() > Size) return 0; - size_t Idx = UsePositionHint ? PositionHint : Rand(Size - Word.size()); - memcpy(Data + Idx, Word.data(), Word.size()); - } - CurrentDictionaryEntrySequence.push_back(DE); - return Size; -} - -size_t MutationDispatcher::Mutate_ChangeASCIIInteger(uint8_t *Data, size_t Size, - size_t MaxSize) { - size_t B = Rand(Size); - while (B < Size && !isdigit(Data[B])) B++; - if (B == Size) return 0; - size_t E = B; - while (E < Size && isdigit(Data[E])) E++; - assert(B < E); - // now we have digits in [B, E). - // strtol and friends don't accept non-zero-teminated data, parse it manually. - uint64_t Val = Data[B] - '0'; - for (size_t i = B + 1; i < E; i++) - Val = Val * 10 + Data[i] - '0'; - - // Mutate the integer value. - switch(Rand(5)) { - case 0: Val++; break; - case 1: Val--; break; - case 2: Val /= 2; break; - case 3: Val *= 2; break; - case 4: Val = Rand(Val * Val); break; - default: assert(0); - } - // Just replace the bytes with the new ones, don't bother moving bytes. - for (size_t i = B; i < E; i++) { - size_t Idx = E + B - i - 1; - assert(Idx >= B && Idx < E); - Data[Idx] = (Val % 10) + '0'; - Val /= 10; - } - return Size; -} - -size_t MutationDispatcher::Mutate_CrossOver(uint8_t *Data, size_t Size, - size_t MaxSize) { - auto Corpus = MDImpl->Corpus; - if (!Corpus || Corpus->size() < 2 || Size == 0) return 0; - size_t Idx = Rand(Corpus->size()); - const Unit &Other = (*Corpus)[Idx]; - if (Other.empty()) return 0; - Unit U(MaxSize); - size_t NewSize = - CrossOver(Data, Size, Other.data(), Other.size(), U.data(), U.size()); - assert(NewSize > 0 && "CrossOver returned empty unit"); - assert(NewSize <= MaxSize && "CrossOver returned overisized unit"); - memcpy(Data, U.data(), NewSize); - return NewSize; -} - -void MutationDispatcher::StartMutationSequence() { - MDImpl->CurrentMutatorSequence.clear(); - MDImpl->CurrentDictionaryEntrySequence.clear(); -} - -void MutationDispatcher::PrintMutationSequence() { - Printf("MS: %zd ", MDImpl->CurrentMutatorSequence.size()); - for (auto M : MDImpl->CurrentMutatorSequence) - Printf("%s-", M.Name); - if (!MDImpl->CurrentDictionaryEntrySequence.empty()) { - Printf(" DE: "); - for (auto DE : MDImpl->CurrentDictionaryEntrySequence) { - Printf("\""); - PrintASCII(DE.Word, "\"-"); - } - } -} - -// Mutates Data in place, returns new size. -size_t MutationDispatcher::Mutate(uint8_t *Data, size_t Size, size_t MaxSize) { - assert(MaxSize > 0); - assert(Size <= MaxSize); - if (Size == 0) { - for (size_t i = 0; i < MaxSize; i++) - Data[i] = RandCh(Rand); - return MaxSize; - } - assert(Size > 0); - // Some mutations may fail (e.g. can't insert more bytes if Size == MaxSize), - // in which case they will return 0. - // Try several times before returning un-mutated data. - for (int Iter = 0; Iter < 10; Iter++) { - size_t MutatorIdx = Rand(MDImpl->Mutators.size()); - auto M = MDImpl->Mutators[MutatorIdx]; - size_t NewSize = (this->*(M.Fn))(Data, Size, MaxSize); - if (NewSize) { - MDImpl->CurrentMutatorSequence.push_back(M); - return NewSize; - } - } - return Size; -} - -void MutationDispatcher::SetCorpus(const std::vector<Unit> *Corpus) { - MDImpl->SetCorpus(Corpus); -} - -void MutationDispatcher::AddWordToManualDictionary(const Unit &Word) { - MDImpl->ManualDictionary.push_back( - {Word, std::numeric_limits<size_t>::max()}); -} - -void MutationDispatcher::AddWordToAutoDictionary(const Unit &Word, - size_t PositionHint) { - static const size_t kMaxAutoDictSize = 1 << 14; - if (MDImpl->AutoDictionary.size() >= kMaxAutoDictSize) return; - MDImpl->AutoDictionary.push_back({Word, PositionHint}); -} - -void MutationDispatcher::ClearAutoDictionary() { - MDImpl->AutoDictionary.clear(); -} - -MutationDispatcher::MutationDispatcher(FuzzerRandomBase &Rand) : Rand(Rand) { - MDImpl = new Impl(Rand); -} - -MutationDispatcher::~MutationDispatcher() { delete MDImpl; } - -} // namespace fuzzer diff --git a/gnu/llvm/lib/Fuzzer/FuzzerMutate.h b/gnu/llvm/lib/Fuzzer/FuzzerMutate.h deleted file mode 100644 index d3c0b001246..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerMutate.h +++ /dev/null @@ -1,145 +0,0 @@ -//===- FuzzerMutate.h - Internal header for the Fuzzer ----------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// fuzzer::MutationDispatcher -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_MUTATE_H -#define LLVM_FUZZER_MUTATE_H - -#include "FuzzerDefs.h" -#include "FuzzerDictionary.h" -#include "FuzzerRandom.h" - -namespace fuzzer { - -class MutationDispatcher { -public: - MutationDispatcher(Random &Rand, const FuzzingOptions &Options); - ~MutationDispatcher() {} - /// Indicate that we are about to start a new sequence of mutations. - void StartMutationSequence(); - /// Print the current sequence of mutations. - void PrintMutationSequence(); - /// Indicate that the current sequence of mutations was successfull. - void RecordSuccessfulMutationSequence(); - /// Mutates data by invoking user-provided mutator. - size_t Mutate_Custom(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by invoking user-provided crossover. - size_t Mutate_CustomCrossOver(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by shuffling bytes. - size_t Mutate_ShuffleBytes(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by erasing bytes. - size_t Mutate_EraseBytes(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by inserting a byte. - size_t Mutate_InsertByte(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by inserting several repeated bytes. - size_t Mutate_InsertRepeatedBytes(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by chanding one byte. - size_t Mutate_ChangeByte(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by chanding one bit. - size_t Mutate_ChangeBit(uint8_t *Data, size_t Size, size_t MaxSize); - /// Mutates data by copying/inserting a part of data into a different place. - size_t Mutate_CopyPart(uint8_t *Data, size_t Size, size_t MaxSize); - - /// Mutates data by adding a word from the manual dictionary. - size_t Mutate_AddWordFromManualDictionary(uint8_t *Data, size_t Size, - size_t MaxSize); - - /// Mutates data by adding a word from the temporary automatic dictionary. - size_t Mutate_AddWordFromTemporaryAutoDictionary(uint8_t *Data, size_t Size, - size_t MaxSize); - - /// Mutates data by adding a word from the TORC. - size_t Mutate_AddWordFromTORC(uint8_t *Data, size_t Size, size_t MaxSize); - - /// Mutates data by adding a word from the persistent automatic dictionary. - size_t Mutate_AddWordFromPersistentAutoDictionary(uint8_t *Data, size_t Size, - size_t MaxSize); - - /// Tries to find an ASCII integer in Data, changes it to another ASCII int. - size_t Mutate_ChangeASCIIInteger(uint8_t *Data, size_t Size, size_t MaxSize); - /// Change a 1-, 2-, 4-, or 8-byte integer in interesting ways. - size_t Mutate_ChangeBinaryInteger(uint8_t *Data, size_t Size, size_t MaxSize); - - /// CrossOver Data with some other element of the corpus. - size_t Mutate_CrossOver(uint8_t *Data, size_t Size, size_t MaxSize); - - /// Applies one of the configured mutations. - /// Returns the new size of data which could be up to MaxSize. - size_t Mutate(uint8_t *Data, size_t Size, size_t MaxSize); - /// Applies one of the default mutations. Provided as a service - /// to mutation authors. - size_t DefaultMutate(uint8_t *Data, size_t Size, size_t MaxSize); - - /// Creates a cross-over of two pieces of Data, returns its size. - size_t CrossOver(const uint8_t *Data1, size_t Size1, const uint8_t *Data2, - size_t Size2, uint8_t *Out, size_t MaxOutSize); - - void AddWordToManualDictionary(const Word &W); - - void AddWordToAutoDictionary(DictionaryEntry DE); - void ClearAutoDictionary(); - void PrintRecommendedDictionary(); - - void SetCorpus(const InputCorpus *Corpus) { this->Corpus = Corpus; } - - Random &GetRand() { return Rand; } - -private: - - struct Mutator { - size_t (MutationDispatcher::*Fn)(uint8_t *Data, size_t Size, size_t Max); - const char *Name; - }; - - size_t AddWordFromDictionary(Dictionary &D, uint8_t *Data, size_t Size, - size_t MaxSize); - size_t MutateImpl(uint8_t *Data, size_t Size, size_t MaxSize, - const std::vector<Mutator> &Mutators); - - size_t InsertPartOf(const uint8_t *From, size_t FromSize, uint8_t *To, - size_t ToSize, size_t MaxToSize); - size_t CopyPartOf(const uint8_t *From, size_t FromSize, uint8_t *To, - size_t ToSize); - size_t ApplyDictionaryEntry(uint8_t *Data, size_t Size, size_t MaxSize, - DictionaryEntry &DE); - - template <class T> - DictionaryEntry MakeDictionaryEntryFromCMP(T Arg1, T Arg2, - const uint8_t *Data, size_t Size); - - Random &Rand; - const FuzzingOptions &Options; - - // Dictionary provided by the user via -dict=DICT_FILE. - Dictionary ManualDictionary; - // Temporary dictionary modified by the fuzzer itself, - // recreated periodically. - Dictionary TempAutoDictionary; - // Persistent dictionary modified by the fuzzer, consists of - // entries that led to successfull discoveries in the past mutations. - Dictionary PersistentAutoDictionary; - - std::vector<Mutator> CurrentMutatorSequence; - std::vector<DictionaryEntry *> CurrentDictionaryEntrySequence; - - static const size_t kCmpDictionaryEntriesDequeSize = 16; - DictionaryEntry CmpDictionaryEntriesDeque[kCmpDictionaryEntriesDequeSize]; - size_t CmpDictionaryEntriesDequeIdx = 0; - - const InputCorpus *Corpus = nullptr; - std::vector<uint8_t> MutateInPlaceHere; - - std::vector<Mutator> Mutators; - std::vector<Mutator> DefaultMutators; -}; - -} // namespace fuzzer - -#endif // LLVM_FUZZER_MUTATE_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerOptions.h b/gnu/llvm/lib/Fuzzer/FuzzerOptions.h deleted file mode 100644 index 6f72205600b..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerOptions.h +++ /dev/null @@ -1,70 +0,0 @@ -//===- FuzzerOptions.h - Internal header for the Fuzzer ---------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// fuzzer::FuzzingOptions -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_OPTIONS_H -#define LLVM_FUZZER_OPTIONS_H - -#include "FuzzerDefs.h" - -namespace fuzzer { - -struct FuzzingOptions { - int Verbosity = 1; - size_t MaxLen = 0; - bool ExperimentalLenControl = false; - int UnitTimeoutSec = 300; - int TimeoutExitCode = 77; - int ErrorExitCode = 77; - int MaxTotalTimeSec = 0; - int RssLimitMb = 0; - bool DoCrossOver = true; - int MutateDepth = 5; - bool UseCounters = false; - bool UseIndirCalls = true; - bool UseMemcmp = true; - bool UseMemmem = true; - bool UseCmp = false; - bool UseValueProfile = false; - bool Shrink = false; - int ReloadIntervalSec = 1; - bool ShuffleAtStartUp = true; - bool PreferSmall = true; - size_t MaxNumberOfRuns = -1L; - int ReportSlowUnits = 10; - bool OnlyASCII = false; - std::string OutputCorpus; - std::string ArtifactPrefix = "./"; - std::string ExactArtifactPath; - std::string ExitOnSrcPos; - std::string ExitOnItem; - bool SaveArtifacts = true; - bool PrintNEW = true; // Print a status line when new units are found; - bool OutputCSV = false; - bool PrintNewCovPcs = false; - bool PrintFinalStats = false; - bool PrintCorpusStats = false; - bool PrintCoverage = false; - bool DumpCoverage = false; - bool DetectLeaks = true; - int TraceMalloc = 0; - bool HandleAbrt = false; - bool HandleBus = false; - bool HandleFpe = false; - bool HandleIll = false; - bool HandleInt = false; - bool HandleSegv = false; - bool HandleTerm = false; - bool HandleXfsz = false; -}; - -} // namespace fuzzer - -#endif // LLVM_FUZZER_OPTIONS_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerRandom.h b/gnu/llvm/lib/Fuzzer/FuzzerRandom.h deleted file mode 100644 index b1be0bb935f..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerRandom.h +++ /dev/null @@ -1,36 +0,0 @@ -//===- FuzzerRandom.h - Internal header for the Fuzzer ----------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// fuzzer::Random -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_RANDOM_H -#define LLVM_FUZZER_RANDOM_H - -#include <random> - -namespace fuzzer { -class Random { - public: - Random(unsigned int seed) : R(seed) {} - size_t Rand() { return R(); } - size_t RandBool() { return Rand() % 2; } - size_t operator()(size_t n) { return n ? Rand() % n : 0; } - intptr_t operator()(intptr_t From, intptr_t To) { - assert(From < To); - intptr_t RangeSize = To - From + 1; - return operator()(RangeSize) + From; - } - std::mt19937 &Get_mt19937() { return R; } - private: - std::mt19937 R; -}; - -} // namespace fuzzer - -#endif // LLVM_FUZZER_RANDOM_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerSHA1.cpp b/gnu/llvm/lib/Fuzzer/FuzzerSHA1.cpp deleted file mode 100644 index b42a04854cd..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerSHA1.cpp +++ /dev/null @@ -1,202 +0,0 @@ -//===- FuzzerSHA1.h - Private copy of the SHA1 implementation ---*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// This code is taken from public domain -// (http://oauth.googlecode.com/svn/code/c/liboauth/src/sha1.c) -// and modified by adding anonymous namespace, adding an interface -// function fuzzer::ComputeSHA1() and removing unnecessary code. -// -// lib/Fuzzer can not use SHA1 implementation from openssl because -// openssl may not be available and because we may be fuzzing openssl itself. -// For the same reason we do not want to depend on SHA1 from LLVM tree. -//===----------------------------------------------------------------------===// - -#include "FuzzerInternal.h" - -/* This code is public-domain - it is based on libcrypt - * placed in the public domain by Wei Dai and other contributors. - */ - -#include <stdint.h> -#include <string.h> - -namespace { // Added for LibFuzzer - -#ifdef __BIG_ENDIAN__ -# define SHA_BIG_ENDIAN -#elif defined __LITTLE_ENDIAN__ -/* override */ -#elif defined __BYTE_ORDER -# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SHA_BIG_ENDIAN -# endif -#else // ! defined __LITTLE_ENDIAN__ -# include <endian.h> // machine/endian.h -# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SHA_BIG_ENDIAN -# endif -#endif - - -/* header */ - -#define HASH_LENGTH 20 -#define BLOCK_LENGTH 64 - -typedef struct sha1nfo { - uint32_t buffer[BLOCK_LENGTH/4]; - uint32_t state[HASH_LENGTH/4]; - uint32_t byteCount; - uint8_t bufferOffset; - uint8_t keyBuffer[BLOCK_LENGTH]; - uint8_t innerHash[HASH_LENGTH]; -} sha1nfo; - -/* public API - prototypes - TODO: doxygen*/ - -/** - */ -void sha1_init(sha1nfo *s); -/** - */ -void sha1_writebyte(sha1nfo *s, uint8_t data); -/** - */ -void sha1_write(sha1nfo *s, const char *data, size_t len); -/** - */ -uint8_t* sha1_result(sha1nfo *s); - - -/* code */ -#define SHA1_K0 0x5a827999 -#define SHA1_K20 0x6ed9eba1 -#define SHA1_K40 0x8f1bbcdc -#define SHA1_K60 0xca62c1d6 - -void sha1_init(sha1nfo *s) { - s->state[0] = 0x67452301; - s->state[1] = 0xefcdab89; - s->state[2] = 0x98badcfe; - s->state[3] = 0x10325476; - s->state[4] = 0xc3d2e1f0; - s->byteCount = 0; - s->bufferOffset = 0; -} - -uint32_t sha1_rol32(uint32_t number, uint8_t bits) { - return ((number << bits) | (number >> (32-bits))); -} - -void sha1_hashBlock(sha1nfo *s) { - uint8_t i; - uint32_t a,b,c,d,e,t; - - a=s->state[0]; - b=s->state[1]; - c=s->state[2]; - d=s->state[3]; - e=s->state[4]; - for (i=0; i<80; i++) { - if (i>=16) { - t = s->buffer[(i+13)&15] ^ s->buffer[(i+8)&15] ^ s->buffer[(i+2)&15] ^ s->buffer[i&15]; - s->buffer[i&15] = sha1_rol32(t,1); - } - if (i<20) { - t = (d ^ (b & (c ^ d))) + SHA1_K0; - } else if (i<40) { - t = (b ^ c ^ d) + SHA1_K20; - } else if (i<60) { - t = ((b & c) | (d & (b | c))) + SHA1_K40; - } else { - t = (b ^ c ^ d) + SHA1_K60; - } - t+=sha1_rol32(a,5) + e + s->buffer[i&15]; - e=d; - d=c; - c=sha1_rol32(b,30); - b=a; - a=t; - } - s->state[0] += a; - s->state[1] += b; - s->state[2] += c; - s->state[3] += d; - s->state[4] += e; -} - -void sha1_addUncounted(sha1nfo *s, uint8_t data) { - uint8_t * const b = (uint8_t*) s->buffer; -#ifdef SHA_BIG_ENDIAN - b[s->bufferOffset] = data; -#else - b[s->bufferOffset ^ 3] = data; -#endif - s->bufferOffset++; - if (s->bufferOffset == BLOCK_LENGTH) { - sha1_hashBlock(s); - s->bufferOffset = 0; - } -} - -void sha1_writebyte(sha1nfo *s, uint8_t data) { - ++s->byteCount; - sha1_addUncounted(s, data); -} - -void sha1_write(sha1nfo *s, const char *data, size_t len) { - for (;len--;) sha1_writebyte(s, (uint8_t) *data++); -} - -void sha1_pad(sha1nfo *s) { - // Implement SHA-1 padding (fips180-2 §5.1.1) - - // Pad with 0x80 followed by 0x00 until the end of the block - sha1_addUncounted(s, 0x80); - while (s->bufferOffset != 56) sha1_addUncounted(s, 0x00); - - // Append length in the last 8 bytes - sha1_addUncounted(s, 0); // We're only using 32 bit lengths - sha1_addUncounted(s, 0); // But SHA-1 supports 64 bit lengths - sha1_addUncounted(s, 0); // So zero pad the top bits - sha1_addUncounted(s, s->byteCount >> 29); // Shifting to multiply by 8 - sha1_addUncounted(s, s->byteCount >> 21); // as SHA-1 supports bitstreams as well as - sha1_addUncounted(s, s->byteCount >> 13); // byte. - sha1_addUncounted(s, s->byteCount >> 5); - sha1_addUncounted(s, s->byteCount << 3); -} - -uint8_t* sha1_result(sha1nfo *s) { - // Pad to complete the last block - sha1_pad(s); - -#ifndef SHA_BIG_ENDIAN - // Swap byte order back - int i; - for (i=0; i<5; i++) { - s->state[i]= - (((s->state[i])<<24)& 0xff000000) - | (((s->state[i])<<8) & 0x00ff0000) - | (((s->state[i])>>8) & 0x0000ff00) - | (((s->state[i])>>24)& 0x000000ff); - } -#endif - - // Return pointer to hash (20 characters) - return (uint8_t*) s->state; -} - -} // namespace; Added for LibFuzzer - -// The rest is added for LibFuzzer -void fuzzer::ComputeSHA1(const uint8_t *Data, size_t Len, uint8_t *Out) { - sha1nfo s; - sha1_init(&s); - sha1_write(&s, (const char*)Data, Len); - memcpy(Out, sha1_result(&s), HASH_LENGTH); -} diff --git a/gnu/llvm/lib/Fuzzer/FuzzerSHA1.h b/gnu/llvm/lib/Fuzzer/FuzzerSHA1.h deleted file mode 100644 index 3b5e6e807f4..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerSHA1.h +++ /dev/null @@ -1,33 +0,0 @@ -//===- FuzzerSHA1.h - Internal header for the SHA1 utils --------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// SHA1 utils. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_SHA1_H -#define LLVM_FUZZER_SHA1_H - -#include "FuzzerDefs.h" -#include <cstddef> -#include <stdint.h> - -namespace fuzzer { - -// Private copy of SHA1 implementation. -static const int kSHA1NumBytes = 20; - -// Computes SHA1 hash of 'Len' bytes in 'Data', writes kSHA1NumBytes to 'Out'. -void ComputeSHA1(const uint8_t *Data, size_t Len, uint8_t *Out); - -std::string Sha1ToString(const uint8_t Sha1[kSHA1NumBytes]); - -std::string Hash(const Unit &U); - -} // namespace fuzzer - -#endif // LLVM_FUZZER_SHA1_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerShmem.h b/gnu/llvm/lib/Fuzzer/FuzzerShmem.h deleted file mode 100644 index 53568e0acb6..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerShmem.h +++ /dev/null @@ -1,69 +0,0 @@ -//===- FuzzerShmem.h - shared memory interface ------------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// SharedMemoryRegion -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_SHMEM_H -#define LLVM_FUZZER_SHMEM_H - -#include <algorithm> -#include <cstring> -#include <string> - -#include "FuzzerDefs.h" - -namespace fuzzer { - -class SharedMemoryRegion { - public: - bool Create(const char *Name); - bool Open(const char *Name); - bool Destroy(const char *Name); - uint8_t *GetData() { return Data; } - void PostServer() {Post(0);} - void WaitServer() {Wait(0);} - void PostClient() {Post(1);} - void WaitClient() {Wait(1);} - - size_t WriteByteArray(const uint8_t *Bytes, size_t N) { - assert(N <= kShmemSize - sizeof(N)); - memcpy(GetData(), &N, sizeof(N)); - memcpy(GetData() + sizeof(N), Bytes, N); - assert(N == ReadByteArraySize()); - return N; - } - size_t ReadByteArraySize() { - size_t Res; - memcpy(&Res, GetData(), sizeof(Res)); - return Res; - } - uint8_t *GetByteArray() { return GetData() + sizeof(size_t); } - - bool IsServer() const { return Data && IAmServer; } - bool IsClient() const { return Data && !IAmServer; } - -private: - - static const size_t kShmemSize = 1 << 22; - bool IAmServer; - std::string Path(const char *Name); - std::string SemName(const char *Name, int Idx); - void Post(int Idx); - void Wait(int Idx); - - bool Map(int fd); - uint8_t *Data = nullptr; - void *Semaphore[2]; -}; - -extern SharedMemoryRegion SMR; - -} // namespace fuzzer - -#endif // LLVM_FUZZER_SHMEM_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerShmemPosix.cpp b/gnu/llvm/lib/Fuzzer/FuzzerShmemPosix.cpp deleted file mode 100644 index 50cdcfb509d..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerShmemPosix.cpp +++ /dev/null @@ -1,103 +0,0 @@ -//===- FuzzerShmemPosix.cpp - Posix shared memory ---------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// SharedMemoryRegion -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_POSIX - -#include "FuzzerIO.h" -#include "FuzzerShmem.h" - -#include <errno.h> -#include <fcntl.h> -#include <semaphore.h> -#include <stdio.h> -#include <stdlib.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <unistd.h> - -namespace fuzzer { - -std::string SharedMemoryRegion::Path(const char *Name) { - return DirPlusFile(TmpDir(), Name); -} - -std::string SharedMemoryRegion::SemName(const char *Name, int Idx) { - std::string Res(Name); - return Res + (char)('0' + Idx); -} - -bool SharedMemoryRegion::Map(int fd) { - Data = - (uint8_t *)mmap(0, kShmemSize, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0); - if (Data == (uint8_t*)-1) - return false; - return true; -} - -bool SharedMemoryRegion::Create(const char *Name) { - int fd = open(Path(Name).c_str(), O_CREAT | O_RDWR, 0777); - if (fd < 0) return false; - if (ftruncate(fd, kShmemSize) < 0) return false; - if (!Map(fd)) - return false; - for (int i = 0; i < 2; i++) { - sem_unlink(SemName(Name, i).c_str()); - Semaphore[i] = sem_open(SemName(Name, i).c_str(), O_CREAT, 0644, 0); - if (Semaphore[i] == (void *)-1) - return false; - } - IAmServer = true; - return true; -} - -bool SharedMemoryRegion::Open(const char *Name) { - int fd = open(Path(Name).c_str(), O_RDWR); - if (fd < 0) return false; - struct stat stat_res; - if (0 != fstat(fd, &stat_res)) - return false; - assert(stat_res.st_size == kShmemSize); - if (!Map(fd)) - return false; - for (int i = 0; i < 2; i++) { - Semaphore[i] = sem_open(SemName(Name, i).c_str(), 0); - if (Semaphore[i] == (void *)-1) - return false; - } - IAmServer = false; - return true; -} - -bool SharedMemoryRegion::Destroy(const char *Name) { - return 0 == unlink(Path(Name).c_str()); -} - -void SharedMemoryRegion::Post(int Idx) { - assert(Idx == 0 || Idx == 1); - sem_post((sem_t*)Semaphore[Idx]); -} - -void SharedMemoryRegion::Wait(int Idx) { - assert(Idx == 0 || Idx == 1); - for (int i = 0; i < 10 && sem_wait((sem_t*)Semaphore[Idx]); i++) { - // sem_wait may fail if interrupted by a signal. - sleep(i); - if (i) - Printf("%s: sem_wait[%d] failed %s\n", i < 9 ? "WARNING" : "ERROR", i, - strerror(errno)); - if (i == 9) abort(); - } -} - -} // namespace fuzzer - -#endif // LIBFUZZER_POSIX diff --git a/gnu/llvm/lib/Fuzzer/FuzzerShmemWindows.cpp b/gnu/llvm/lib/Fuzzer/FuzzerShmemWindows.cpp deleted file mode 100644 index d330ebf4fd0..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerShmemWindows.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//===- FuzzerShmemWindows.cpp - Posix shared memory -------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// SharedMemoryRegion -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_WINDOWS - -#include "FuzzerIO.h" -#include "FuzzerShmem.h" - -#include <fcntl.h> -#include <stdio.h> -#include <sys/stat.h> -#include <sys/types.h> - -namespace fuzzer { - -std::string SharedMemoryRegion::Path(const char *Name) { - return DirPlusFile(TmpDir(), Name); -} - -std::string SharedMemoryRegion::SemName(const char *Name, int Idx) { - std::string Res(Name); - return Res + (char)('0' + Idx); -} - -bool SharedMemoryRegion::Map(int fd) { - assert(0 && "UNIMPLEMENTED"); - return false; -} - -bool SharedMemoryRegion::Create(const char *Name) { - assert(0 && "UNIMPLEMENTED"); - return false; -} - -bool SharedMemoryRegion::Open(const char *Name) { - assert(0 && "UNIMPLEMENTED"); - return false; -} - -bool SharedMemoryRegion::Destroy(const char *Name) { - assert(0 && "UNIMPLEMENTED"); - return false; -} - -void SharedMemoryRegion::Post(int Idx) { - assert(0 && "UNIMPLEMENTED"); -} - -void SharedMemoryRegion::Wait(int Idx) { - Semaphore[1] = nullptr; - assert(0 && "UNIMPLEMENTED"); -} - -} // namespace fuzzer - -#endif // LIBFUZZER_WINDOWS diff --git a/gnu/llvm/lib/Fuzzer/FuzzerTracePC.cpp b/gnu/llvm/lib/Fuzzer/FuzzerTracePC.cpp deleted file mode 100644 index 46c43d0c17f..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerTracePC.cpp +++ /dev/null @@ -1,71 +0,0 @@ -//===- FuzzerTracePC.cpp - PC tracing--------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Trace PCs. -// This module implements __sanitizer_cov_trace_pc, a callback required -// for -fsanitize-coverage=trace-pc instrumentation. -// -//===----------------------------------------------------------------------===// - -#include "FuzzerInternal.h" - -namespace fuzzer { - -void PcCoverageMap::Reset() { memset(Map, 0, sizeof(Map)); } - -void PcCoverageMap::Update(uintptr_t Addr) { - uintptr_t Idx = Addr % kMapSizeInBits; - uintptr_t WordIdx = Idx / kBitsInWord; - uintptr_t BitIdx = Idx % kBitsInWord; - Map[WordIdx] |= 1UL << BitIdx; -} - -size_t PcCoverageMap::MergeFrom(const PcCoverageMap &Other) { - uintptr_t Res = 0; - for (size_t i = 0; i < kMapSizeInWords; i++) - Res += __builtin_popcountl(Map[i] |= Other.Map[i]); - return Res; -} - -static PcCoverageMap CurrentMap; -static thread_local uintptr_t Prev; - -void PcMapResetCurrent() { - if (Prev) { - Prev = 0; - CurrentMap.Reset(); - } -} - -size_t PcMapMergeInto(PcCoverageMap *Map) { - if (!Prev) - return 0; - return Map->MergeFrom(CurrentMap); -} - -static void HandlePC(uint32_t PC) { - // We take 12 bits of PC and mix it with the previous PCs. - uintptr_t Next = (Prev << 5) ^ (PC & 4095); - CurrentMap.Update(Next); - Prev = Next; -} - -} // namespace fuzzer - -extern "C" { -void __sanitizer_cov_trace_pc() { - fuzzer::HandlePC(static_cast<uint32_t>( - reinterpret_cast<uintptr_t>(__builtin_return_address(0)))); -} - -void __sanitizer_cov_trace_pc_indir(int *) { - // Stub to allow linking with code built with - // -fsanitize=indirect-calls,trace-pc. - // This isn't used currently. -} -} diff --git a/gnu/llvm/lib/Fuzzer/FuzzerTracePC.h b/gnu/llvm/lib/Fuzzer/FuzzerTracePC.h deleted file mode 100644 index 47280ba7faa..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerTracePC.h +++ /dev/null @@ -1,37 +0,0 @@ -//===- FuzzerTracePC.h - INTERNAL - Path tracer. --------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Trace PCs. -// This module implements __sanitizer_cov_trace_pc, a callback required -// for -fsanitize-coverage=trace-pc instrumentation. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_TRACE_PC_H -#define LLVM_FUZZER_TRACE_PC_H - -namespace fuzzer { -struct PcCoverageMap { - static const size_t kMapSizeInBits = 65371; // Prime. - static const size_t kMapSizeInBitsAligned = 65536; // 2^16 - static const size_t kBitsInWord = (sizeof(uintptr_t) * 8); - static const size_t kMapSizeInWords = kMapSizeInBitsAligned / kBitsInWord; - - void Reset(); - inline void Update(uintptr_t Addr); - size_t MergeFrom(const PcCoverageMap &Other); - - uintptr_t Map[kMapSizeInWords] __attribute__((aligned(512))); -}; - -// Clears the current PC Map. -void PcMapResetCurrent(); -// Merges the current PC Map into the combined one, and clears the former. -size_t PcMapMergeInto(PcCoverageMap *Map); -} - -#endif diff --git a/gnu/llvm/lib/Fuzzer/FuzzerUtil.cpp b/gnu/llvm/lib/Fuzzer/FuzzerUtil.cpp deleted file mode 100644 index d7226cfce96..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerUtil.cpp +++ /dev/null @@ -1,212 +0,0 @@ -//===- FuzzerUtil.cpp - Misc utils ----------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Misc utils. -//===----------------------------------------------------------------------===// - -#include "FuzzerInternal.h" -#include <sstream> -#include <iomanip> -#include <sys/time.h> -#include <cassert> -#include <cstring> -#include <signal.h> -#include <sstream> -#include <unistd.h> - -namespace fuzzer { - -void Print(const Unit &v, const char *PrintAfter) { - for (auto x : v) - Printf("0x%x,", (unsigned) x); - Printf("%s", PrintAfter); -} - -void PrintASCIIByte(uint8_t Byte) { - if (Byte == '\\') - Printf("\\\\"); - else if (Byte == '"') - Printf("\\\""); - else if (Byte >= 32 && Byte < 127) - Printf("%c", Byte); - else - Printf("\\x%02x", Byte); -} - -void PrintASCII(const uint8_t *Data, size_t Size, const char *PrintAfter) { - for (size_t i = 0; i < Size; i++) - PrintASCIIByte(Data[i]); - Printf("%s", PrintAfter); -} - -void PrintASCII(const Unit &U, const char *PrintAfter) { - for (auto X : U) - PrintASCIIByte(X); - Printf("%s", PrintAfter); -} - -std::string Hash(const Unit &U) { - uint8_t Hash[kSHA1NumBytes]; - ComputeSHA1(U.data(), U.size(), Hash); - std::stringstream SS; - for (int i = 0; i < kSHA1NumBytes; i++) - SS << std::hex << std::setfill('0') << std::setw(2) << (unsigned)Hash[i]; - return SS.str(); -} - -static void AlarmHandler(int, siginfo_t *, void *) { - Fuzzer::StaticAlarmCallback(); -} - -void SetTimer(int Seconds) { - struct itimerval T {{Seconds, 0}, {Seconds, 0}}; - int Res = setitimer(ITIMER_REAL, &T, nullptr); - assert(Res == 0); - struct sigaction sigact; - memset(&sigact, 0, sizeof(sigact)); - sigact.sa_sigaction = AlarmHandler; - Res = sigaction(SIGALRM, &sigact, 0); - assert(Res == 0); -} - -int NumberOfCpuCores() { - FILE *F = popen("nproc", "r"); - int N = 0; - fscanf(F, "%d", &N); - fclose(F); - return N; -} - -int ExecuteCommand(const std::string &Command) { - return system(Command.c_str()); -} - -bool ToASCII(Unit &U) { - bool Changed = false; - for (auto &X : U) { - auto NewX = X; - NewX &= 127; - if (!isspace(NewX) && !isprint(NewX)) - NewX = ' '; - Changed |= NewX != X; - X = NewX; - } - return Changed; -} - -bool IsASCII(const Unit &U) { - for (auto X : U) - if (!(isprint(X) || isspace(X))) return false; - return true; -} - -bool ParseOneDictionaryEntry(const std::string &Str, Unit *U) { - U->clear(); - if (Str.empty()) return false; - size_t L = 0, R = Str.size() - 1; // We are parsing the range [L,R]. - // Skip spaces from both sides. - while (L < R && isspace(Str[L])) L++; - while (R > L && isspace(Str[R])) R--; - if (R - L < 2) return false; - // Check the closing " - if (Str[R] != '"') return false; - R--; - // Find the opening " - while (L < R && Str[L] != '"') L++; - if (L >= R) return false; - assert(Str[L] == '\"'); - L++; - assert(L <= R); - for (size_t Pos = L; Pos <= R; Pos++) { - uint8_t V = (uint8_t)Str[Pos]; - if (!isprint(V) && !isspace(V)) return false; - if (V =='\\') { - // Handle '\\' - if (Pos + 1 <= R && (Str[Pos + 1] == '\\' || Str[Pos + 1] == '"')) { - U->push_back(Str[Pos + 1]); - Pos++; - continue; - } - // Handle '\xAB' - if (Pos + 3 <= R && Str[Pos + 1] == 'x' - && isxdigit(Str[Pos + 2]) && isxdigit(Str[Pos + 3])) { - char Hex[] = "0xAA"; - Hex[2] = Str[Pos + 2]; - Hex[3] = Str[Pos + 3]; - U->push_back(strtol(Hex, nullptr, 16)); - Pos += 3; - continue; - } - return false; // Invalid escape. - } else { - // Any other character. - U->push_back(V); - } - } - return true; -} - -bool ParseDictionaryFile(const std::string &Text, std::vector<Unit> *Units) { - if (Text.empty()) { - Printf("ParseDictionaryFile: file does not exist or is empty\n"); - return false; - } - std::istringstream ISS(Text); - Units->clear(); - Unit U; - int LineNo = 0; - std::string S; - while (std::getline(ISS, S, '\n')) { - LineNo++; - size_t Pos = 0; - while (Pos < S.size() && isspace(S[Pos])) Pos++; // Skip spaces. - if (Pos == S.size()) continue; // Empty line. - if (S[Pos] == '#') continue; // Comment line. - if (ParseOneDictionaryEntry(S, &U)) { - Units->push_back(U); - } else { - Printf("ParseDictionaryFile: error in line %d\n\t\t%s\n", LineNo, - S.c_str()); - return false; - } - } - return true; -} - -int GetPid() { return getpid(); } - - -std::string Base64(const Unit &U) { - static const char Table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - std::string Res; - size_t i; - for (i = 0; i + 2 < U.size(); i += 3) { - uint32_t x = (U[i] << 16) + (U[i + 1] << 8) + U[i + 2]; - Res += Table[(x >> 18) & 63]; - Res += Table[(x >> 12) & 63]; - Res += Table[(x >> 6) & 63]; - Res += Table[x & 63]; - } - if (i + 1 == U.size()) { - uint32_t x = (U[i] << 16); - Res += Table[(x >> 18) & 63]; - Res += Table[(x >> 12) & 63]; - Res += "=="; - } else if (i + 2 == U.size()) { - uint32_t x = (U[i] << 16) + (U[i + 1] << 8); - Res += Table[(x >> 18) & 63]; - Res += Table[(x >> 12) & 63]; - Res += Table[(x >> 6) & 63]; - Res += "="; - } - return Res; -} - -} // namespace fuzzer diff --git a/gnu/llvm/lib/Fuzzer/FuzzerUtil.h b/gnu/llvm/lib/Fuzzer/FuzzerUtil.h deleted file mode 100644 index 08058c56e4c..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerUtil.h +++ /dev/null @@ -1,72 +0,0 @@ -//===- FuzzerUtil.h - Internal header for the Fuzzer Utils ------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Util functions. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_UTIL_H -#define LLVM_FUZZER_UTIL_H - -#include "FuzzerDefs.h" - -namespace fuzzer { - -void PrintHexArray(const Unit &U, const char *PrintAfter = ""); - -void PrintHexArray(const uint8_t *Data, size_t Size, - const char *PrintAfter = ""); - -void PrintASCII(const uint8_t *Data, size_t Size, const char *PrintAfter = ""); - -void PrintASCII(const Unit &U, const char *PrintAfter = ""); - -// Changes U to contain only ASCII (isprint+isspace) characters. -// Returns true iff U has been changed. -bool ToASCII(uint8_t *Data, size_t Size); - -bool IsASCII(const Unit &U); - -bool IsASCII(const uint8_t *Data, size_t Size); - -std::string Base64(const Unit &U); - -void PrintPC(const char *SymbolizedFMT, const char *FallbackFMT, uintptr_t PC); - -std::string DescribePC(const char *SymbolizedFMT, uintptr_t PC); - -unsigned NumberOfCpuCores(); - -bool ExecuteCommandAndReadOutput(const std::string &Command, std::string *Out); - -// Platform specific functions. -void SetSignalHandler(const FuzzingOptions& Options); - -void SleepSeconds(int Seconds); - -unsigned long GetPid(); - -size_t GetPeakRSSMb(); - -int ExecuteCommand(const std::string &Command); - -FILE *OpenProcessPipe(const char *Command, const char *Mode); - -const void *SearchMemory(const void *haystack, size_t haystacklen, - const void *needle, size_t needlelen); - -std::string CloneArgsWithoutX(const std::vector<std::string> &Args, - const char *X1, const char *X2); - -inline std::string CloneArgsWithoutX(const std::vector<std::string> &Args, - const char *X) { - return CloneArgsWithoutX(Args, X, X); -} - -} // namespace fuzzer - -#endif // LLVM_FUZZER_UTIL_H diff --git a/gnu/llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp b/gnu/llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp deleted file mode 100644 index 9674368c355..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp +++ /dev/null @@ -1,152 +0,0 @@ -//===- FuzzerUtilDarwin.cpp - Misc utils ----------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Misc utils for Darwin. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_APPLE - -#include "FuzzerIO.h" -#include <mutex> -#include <signal.h> -#include <spawn.h> -#include <sys/wait.h> - -// There is no header for this on macOS so declare here -extern "C" char **environ; - -namespace fuzzer { - -static std::mutex SignalMutex; -// Global variables used to keep track of how signal handling should be -// restored. They should **not** be accessed without holding `SignalMutex`. -static int ActiveThreadCount = 0; -static struct sigaction OldSigIntAction; -static struct sigaction OldSigQuitAction; -static sigset_t OldBlockedSignalsSet; - -// This is a reimplementation of Libc's `system()`. On Darwin the Libc -// implementation contains a mutex which prevents it from being used -// concurrently. This implementation **can** be used concurrently. It sets the -// signal handlers when the first thread enters and restores them when the last -// thread finishes execution of the function and ensures this is not racey by -// using a mutex. -int ExecuteCommand(const std::string &Command) { - posix_spawnattr_t SpawnAttributes; - if (posix_spawnattr_init(&SpawnAttributes)) - return -1; - // Block and ignore signals of the current process when the first thread - // enters. - { - std::lock_guard<std::mutex> Lock(SignalMutex); - if (ActiveThreadCount == 0) { - static struct sigaction IgnoreSignalAction; - sigset_t BlockedSignalsSet; - memset(&IgnoreSignalAction, 0, sizeof(IgnoreSignalAction)); - IgnoreSignalAction.sa_handler = SIG_IGN; - - if (sigaction(SIGINT, &IgnoreSignalAction, &OldSigIntAction) == -1) { - Printf("Failed to ignore SIGINT\n"); - (void)posix_spawnattr_destroy(&SpawnAttributes); - return -1; - } - if (sigaction(SIGQUIT, &IgnoreSignalAction, &OldSigQuitAction) == -1) { - Printf("Failed to ignore SIGQUIT\n"); - // Try our best to restore the signal handlers. - (void)sigaction(SIGINT, &OldSigIntAction, NULL); - (void)posix_spawnattr_destroy(&SpawnAttributes); - return -1; - } - - (void)sigemptyset(&BlockedSignalsSet); - (void)sigaddset(&BlockedSignalsSet, SIGCHLD); - if (sigprocmask(SIG_BLOCK, &BlockedSignalsSet, &OldBlockedSignalsSet) == - -1) { - Printf("Failed to block SIGCHLD\n"); - // Try our best to restore the signal handlers. - (void)sigaction(SIGQUIT, &OldSigQuitAction, NULL); - (void)sigaction(SIGINT, &OldSigIntAction, NULL); - (void)posix_spawnattr_destroy(&SpawnAttributes); - return -1; - } - } - ++ActiveThreadCount; - } - - // NOTE: Do not introduce any new `return` statements past this - // point. It is important that `ActiveThreadCount` always be decremented - // when leaving this function. - - // Make sure the child process uses the default handlers for the - // following signals rather than inheriting what the parent has. - sigset_t DefaultSigSet; - (void)sigemptyset(&DefaultSigSet); - (void)sigaddset(&DefaultSigSet, SIGQUIT); - (void)sigaddset(&DefaultSigSet, SIGINT); - (void)posix_spawnattr_setsigdefault(&SpawnAttributes, &DefaultSigSet); - // Make sure the child process doesn't block SIGCHLD - (void)posix_spawnattr_setsigmask(&SpawnAttributes, &OldBlockedSignalsSet); - short SpawnFlags = POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK; - (void)posix_spawnattr_setflags(&SpawnAttributes, SpawnFlags); - - pid_t Pid; - char **Environ = environ; // Read from global - const char *CommandCStr = Command.c_str(); - const char *Argv[] = {"sh", "-c", CommandCStr, NULL}; - int ErrorCode = 0, ProcessStatus = 0; - // FIXME: We probably shouldn't hardcode the shell path. - ErrorCode = posix_spawn(&Pid, "/bin/sh", NULL, &SpawnAttributes, - (char *const *)Argv, Environ); - (void)posix_spawnattr_destroy(&SpawnAttributes); - if (!ErrorCode) { - pid_t SavedPid = Pid; - do { - // Repeat until call completes uninterrupted. - Pid = waitpid(SavedPid, &ProcessStatus, /*options=*/0); - } while (Pid == -1 && errno == EINTR); - if (Pid == -1) { - // Fail for some other reason. - ProcessStatus = -1; - } - } else if (ErrorCode == ENOMEM || ErrorCode == EAGAIN) { - // Fork failure. - ProcessStatus = -1; - } else { - // Shell execution failure. - ProcessStatus = W_EXITCODE(127, 0); - } - - // Restore the signal handlers of the current process when the last thread - // using this function finishes. - { - std::lock_guard<std::mutex> Lock(SignalMutex); - --ActiveThreadCount; - if (ActiveThreadCount == 0) { - bool FailedRestore = false; - if (sigaction(SIGINT, &OldSigIntAction, NULL) == -1) { - Printf("Failed to restore SIGINT handling\n"); - FailedRestore = true; - } - if (sigaction(SIGQUIT, &OldSigQuitAction, NULL) == -1) { - Printf("Failed to restore SIGQUIT handling\n"); - FailedRestore = true; - } - if (sigprocmask(SIG_BLOCK, &OldBlockedSignalsSet, NULL) == -1) { - Printf("Failed to unblock SIGCHLD\n"); - FailedRestore = true; - } - if (FailedRestore) - ProcessStatus = -1; - } - } - return ProcessStatus; -} - -} // namespace fuzzer - -#endif // LIBFUZZER_APPLE diff --git a/gnu/llvm/lib/Fuzzer/FuzzerUtilLinux.cpp b/gnu/llvm/lib/Fuzzer/FuzzerUtilLinux.cpp deleted file mode 100644 index dfe7e6f4e18..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerUtilLinux.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===- FuzzerUtilLinux.cpp - Misc utils for Linux. ------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Misc utils for Linux. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_LINUX - -#include <stdlib.h> - -namespace fuzzer { - -int ExecuteCommand(const std::string &Command) { - return system(Command.c_str()); -} - -} // namespace fuzzer - -#endif // LIBFUZZER_LINUX diff --git a/gnu/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp b/gnu/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp deleted file mode 100644 index e8d48dc81a3..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp +++ /dev/null @@ -1,123 +0,0 @@ -//===- FuzzerUtilPosix.cpp - Misc utils for Posix. ------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Misc utils implementation using Posix API. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_POSIX -#include "FuzzerIO.h" -#include "FuzzerInternal.h" -#include <cassert> -#include <chrono> -#include <cstring> -#include <errno.h> -#include <iomanip> -#include <signal.h> -#include <sstream> -#include <stdio.h> -#include <sys/resource.h> -#include <sys/syscall.h> -#include <sys/time.h> -#include <sys/types.h> -#include <thread> -#include <unistd.h> - -namespace fuzzer { - -static void AlarmHandler(int, siginfo_t *, void *) { - Fuzzer::StaticAlarmCallback(); -} - -static void CrashHandler(int, siginfo_t *, void *) { - Fuzzer::StaticCrashSignalCallback(); -} - -static void InterruptHandler(int, siginfo_t *, void *) { - Fuzzer::StaticInterruptCallback(); -} - -static void FileSizeExceedHandler(int, siginfo_t *, void *) { - Fuzzer::StaticFileSizeExceedCallback(); -} - -static void SetSigaction(int signum, - void (*callback)(int, siginfo_t *, void *)) { - struct sigaction sigact; - memset(&sigact, 0, sizeof(sigact)); - sigact.sa_sigaction = callback; - if (sigaction(signum, &sigact, 0)) { - Printf("libFuzzer: sigaction failed with %d\n", errno); - exit(1); - } -} - -void SetTimer(int Seconds) { - struct itimerval T { - {Seconds, 0}, { Seconds, 0 } - }; - if (setitimer(ITIMER_REAL, &T, nullptr)) { - Printf("libFuzzer: setitimer failed with %d\n", errno); - exit(1); - } - SetSigaction(SIGALRM, AlarmHandler); -} - -void SetSignalHandler(const FuzzingOptions& Options) { - if (Options.UnitTimeoutSec > 0) - SetTimer(Options.UnitTimeoutSec / 2 + 1); - if (Options.HandleInt) - SetSigaction(SIGINT, InterruptHandler); - if (Options.HandleTerm) - SetSigaction(SIGTERM, InterruptHandler); - if (Options.HandleSegv) - SetSigaction(SIGSEGV, CrashHandler); - if (Options.HandleBus) - SetSigaction(SIGBUS, CrashHandler); - if (Options.HandleAbrt) - SetSigaction(SIGABRT, CrashHandler); - if (Options.HandleIll) - SetSigaction(SIGILL, CrashHandler); - if (Options.HandleFpe) - SetSigaction(SIGFPE, CrashHandler); - if (Options.HandleXfsz) - SetSigaction(SIGXFSZ, FileSizeExceedHandler); -} - -void SleepSeconds(int Seconds) { - sleep(Seconds); // Use C API to avoid coverage from instrumented libc++. -} - -unsigned long GetPid() { return (unsigned long)getpid(); } - -size_t GetPeakRSSMb() { - struct rusage usage; - if (getrusage(RUSAGE_SELF, &usage)) - return 0; - if (LIBFUZZER_LINUX) { - // ru_maxrss is in KiB - return usage.ru_maxrss >> 10; - } else if (LIBFUZZER_APPLE) { - // ru_maxrss is in bytes - return usage.ru_maxrss >> 20; - } - assert(0 && "GetPeakRSSMb() is not implemented for your platform"); - return 0; -} - -FILE *OpenProcessPipe(const char *Command, const char *Mode) { - return popen(Command, Mode); -} - -const void *SearchMemory(const void *Data, size_t DataLen, const void *Patt, - size_t PattLen) { - return memmem(Data, DataLen, Patt, PattLen); -} - -} // namespace fuzzer - -#endif // LIBFUZZER_POSIX diff --git a/gnu/llvm/lib/Fuzzer/FuzzerUtilWindows.cpp b/gnu/llvm/lib/Fuzzer/FuzzerUtilWindows.cpp deleted file mode 100644 index 3ca1f2c8f56..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerUtilWindows.cpp +++ /dev/null @@ -1,183 +0,0 @@ -//===- FuzzerUtilWindows.cpp - Misc utils for Windows. --------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Misc utils implementation for Windows. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_WINDOWS -#include "FuzzerIO.h" -#include "FuzzerInternal.h" -#include <cassert> -#include <chrono> -#include <cstring> -#include <errno.h> -#include <iomanip> -#include <signal.h> -#include <sstream> -#include <stdio.h> -#include <sys/types.h> -#include <windows.h> -#include <Psapi.h> - -namespace fuzzer { - -static const FuzzingOptions* HandlerOpt = nullptr; - -LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo) { - switch (ExceptionInfo->ExceptionRecord->ExceptionCode) { - case EXCEPTION_ACCESS_VIOLATION: - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - case EXCEPTION_STACK_OVERFLOW: - if (HandlerOpt->HandleSegv) - Fuzzer::StaticCrashSignalCallback(); - break; - case EXCEPTION_DATATYPE_MISALIGNMENT: - case EXCEPTION_IN_PAGE_ERROR: - if (HandlerOpt->HandleBus) - Fuzzer::StaticCrashSignalCallback(); - break; - case EXCEPTION_ILLEGAL_INSTRUCTION: - case EXCEPTION_PRIV_INSTRUCTION: - if (HandlerOpt->HandleIll) - Fuzzer::StaticCrashSignalCallback(); - break; - case EXCEPTION_FLT_DENORMAL_OPERAND: - case EXCEPTION_FLT_DIVIDE_BY_ZERO: - case EXCEPTION_FLT_INEXACT_RESULT: - case EXCEPTION_FLT_INVALID_OPERATION: - case EXCEPTION_FLT_OVERFLOW: - case EXCEPTION_FLT_STACK_CHECK: - case EXCEPTION_FLT_UNDERFLOW: - case EXCEPTION_INT_DIVIDE_BY_ZERO: - case EXCEPTION_INT_OVERFLOW: - if (HandlerOpt->HandleFpe) - Fuzzer::StaticCrashSignalCallback(); - break; - // TODO: handle (Options.HandleXfsz) - } - return EXCEPTION_CONTINUE_SEARCH; -} - -BOOL WINAPI CtrlHandler(DWORD dwCtrlType) { - switch (dwCtrlType) { - case CTRL_C_EVENT: - if (HandlerOpt->HandleInt) - Fuzzer::StaticInterruptCallback(); - return TRUE; - case CTRL_BREAK_EVENT: - if (HandlerOpt->HandleTerm) - Fuzzer::StaticInterruptCallback(); - return TRUE; - } - return FALSE; -} - -void CALLBACK AlarmHandler(PVOID, BOOLEAN) { - Fuzzer::StaticAlarmCallback(); -} - -class TimerQ { - HANDLE TimerQueue; - public: - TimerQ() : TimerQueue(NULL) {}; - ~TimerQ() { - if (TimerQueue) - DeleteTimerQueueEx(TimerQueue, NULL); - }; - void SetTimer(int Seconds) { - if (!TimerQueue) { - TimerQueue = CreateTimerQueue(); - if (!TimerQueue) { - Printf("libFuzzer: CreateTimerQueue failed.\n"); - exit(1); - } - } - HANDLE Timer; - if (!CreateTimerQueueTimer(&Timer, TimerQueue, AlarmHandler, NULL, - Seconds*1000, Seconds*1000, 0)) { - Printf("libFuzzer: CreateTimerQueueTimer failed.\n"); - exit(1); - } - }; -}; - -static TimerQ Timer; - -static void CrashHandler(int) { Fuzzer::StaticCrashSignalCallback(); } - -void SetSignalHandler(const FuzzingOptions& Options) { - HandlerOpt = &Options; - - if (Options.UnitTimeoutSec > 0) - Timer.SetTimer(Options.UnitTimeoutSec / 2 + 1); - - if (Options.HandleInt || Options.HandleTerm) - if (!SetConsoleCtrlHandler(CtrlHandler, TRUE)) { - DWORD LastError = GetLastError(); - Printf("libFuzzer: SetConsoleCtrlHandler failed (Error code: %lu).\n", - LastError); - exit(1); - } - - if (Options.HandleSegv || Options.HandleBus || Options.HandleIll || - Options.HandleFpe) - if (!AddVectoredExceptionHandler(1, ExceptionHandler)) { - Printf("libFuzzer: AddVectoredExceptionHandler failed.\n"); - exit(1); - } - - if (Options.HandleAbrt) - if (SIG_ERR == signal(SIGABRT, CrashHandler)) { - Printf("libFuzzer: signal failed with %d\n", errno); - exit(1); - } -} - -void SleepSeconds(int Seconds) { Sleep(Seconds * 1000); } - -unsigned long GetPid() { return GetCurrentProcessId(); } - -size_t GetPeakRSSMb() { - PROCESS_MEMORY_COUNTERS info; - if (!GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info))) - return 0; - return info.PeakWorkingSetSize >> 20; -} - -FILE *OpenProcessPipe(const char *Command, const char *Mode) { - return _popen(Command, Mode); -} - -int ExecuteCommand(const std::string &Command) { - return system(Command.c_str()); -} - -const void *SearchMemory(const void *Data, size_t DataLen, const void *Patt, - size_t PattLen) { - // TODO: make this implementation more efficient. - const char *Cdata = (const char *)Data; - const char *Cpatt = (const char *)Patt; - - if (!Data || !Patt || DataLen == 0 || PattLen == 0 || DataLen < PattLen) - return NULL; - - if (PattLen == 1) - return memchr(Data, *Cpatt, DataLen); - - const char *End = Cdata + DataLen - PattLen + 1; - - for (const char *It = Cdata; It < End; ++It) - if (It[0] == Cpatt[0] && memcmp(It, Cpatt, PattLen) == 0) - return It; - - return NULL; -} - -} // namespace fuzzer - -#endif // LIBFUZZER_WINDOWS diff --git a/gnu/llvm/lib/Fuzzer/FuzzerValueBitMap.h b/gnu/llvm/lib/Fuzzer/FuzzerValueBitMap.h deleted file mode 100644 index 0692acd13ee..00000000000 --- a/gnu/llvm/lib/Fuzzer/FuzzerValueBitMap.h +++ /dev/null @@ -1,87 +0,0 @@ -//===- FuzzerValueBitMap.h - INTERNAL - Bit map -----------------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// ValueBitMap. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_FUZZER_VALUE_BIT_MAP_H -#define LLVM_FUZZER_VALUE_BIT_MAP_H - -#include "FuzzerDefs.h" - -namespace fuzzer { - -// A bit map containing kMapSizeInWords bits. -struct ValueBitMap { - static const size_t kMapSizeInBits = 65371; // Prime. - static const size_t kMapSizeInBitsAligned = 65536; // 2^16 - static const size_t kBitsInWord = (sizeof(uintptr_t) * 8); - static const size_t kMapSizeInWords = kMapSizeInBitsAligned / kBitsInWord; - public: - static const size_t kNumberOfItems = kMapSizeInBits; - // Clears all bits. - void Reset() { memset(Map, 0, sizeof(Map)); } - - // Computes a hash function of Value and sets the corresponding bit. - // Returns true if the bit was changed from 0 to 1. - inline bool AddValue(uintptr_t Value) { - uintptr_t Idx = Value < kMapSizeInBits ? Value : Value % kMapSizeInBits; - uintptr_t WordIdx = Idx / kBitsInWord; - uintptr_t BitIdx = Idx % kBitsInWord; - uintptr_t Old = Map[WordIdx]; - uintptr_t New = Old | (1UL << BitIdx); - Map[WordIdx] = New; - return New != Old; - } - - inline bool Get(uintptr_t Idx) { - assert(Idx < kMapSizeInBits); - uintptr_t WordIdx = Idx / kBitsInWord; - uintptr_t BitIdx = Idx % kBitsInWord; - return Map[WordIdx] & (1UL << BitIdx); - } - - size_t GetNumBitsSinceLastMerge() const { return NumBits; } - - // Merges 'Other' into 'this', clears 'Other', updates NumBits, - // returns true if new bits were added. - ATTRIBUTE_TARGET_POPCNT - bool MergeFrom(ValueBitMap &Other) { - uintptr_t Res = 0; - size_t OldNumBits = NumBits; - for (size_t i = 0; i < kMapSizeInWords; i++) { - auto O = Other.Map[i]; - auto M = Map[i]; - if (O) { - Map[i] = (M |= O); - Other.Map[i] = 0; - } - if (M) - Res += __builtin_popcountl(M); - } - NumBits = Res; - return OldNumBits < NumBits; - } - - template <class Callback> - void ForEach(Callback CB) { - for (size_t i = 0; i < kMapSizeInWords; i++) - if (uintptr_t M = Map[i]) - for (size_t j = 0; j < sizeof(M) * 8; j++) - if (M & ((uintptr_t)1 << j)) - CB(i * sizeof(M) * 8 + j); - } - - private: - size_t NumBits = 0; - uintptr_t Map[kMapSizeInWords] __attribute__((aligned(512))); -}; - -} // namespace fuzzer - -#endif // LLVM_FUZZER_VALUE_BIT_MAP_H diff --git a/gnu/llvm/lib/Fuzzer/afl/afl_driver.cpp b/gnu/llvm/lib/Fuzzer/afl/afl_driver.cpp deleted file mode 100644 index 0f789981d74..00000000000 --- a/gnu/llvm/lib/Fuzzer/afl/afl_driver.cpp +++ /dev/null @@ -1,287 +0,0 @@ -//===- afl_driver.cpp - a glue between AFL and libFuzzer --------*- C++ -* ===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -//===----------------------------------------------------------------------===// - -/* This file allows to fuzz libFuzzer-style target functions - (LLVMFuzzerTestOneInput) with AFL using AFL's persistent (in-process) mode. - -Usage: -################################################################################ -cat << EOF > test_fuzzer.cc -#include <stdint.h> -#include <stddef.h> -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - if (size > 0 && data[0] == 'H') - if (size > 1 && data[1] == 'I') - if (size > 2 && data[2] == '!') - __builtin_trap(); - return 0; -} -EOF -# Build your target with -fsanitize-coverage=trace-pc using fresh clang. -clang -g -fsanitize-coverage=trace-pc test_fuzzer.cc -c -# Build afl-llvm-rt.o.c from the AFL distribution. -clang -c -w $AFL_HOME/llvm_mode/afl-llvm-rt.o.c -# Build this file, link it with afl-llvm-rt.o.o and the target code. -clang++ afl_driver.cpp test_fuzzer.o afl-llvm-rt.o.o -# Run AFL: -rm -rf IN OUT; mkdir IN OUT; echo z > IN/z; -$AFL_HOME/afl-fuzz -i IN -o OUT ./a.out -################################################################################ -Environment Variables: -There are a few environment variables that can be set to use features that -afl-fuzz doesn't have. - -AFL_DRIVER_STDERR_DUPLICATE_FILENAME: Setting this *appends* stderr to the file -specified. If the file does not exist, it is created. This is useful for getting -stack traces (when using ASAN for example) or original error messages on hard to -reproduce bugs. - -AFL_DRIVER_EXTRA_STATS_FILENAME: Setting this causes afl_driver to write extra -statistics to the file specified. Currently these are peak_rss_mb -(the peak amount of virtual memory used in MB) and slowest_unit_time_secs. If -the file does not exist it is created. If the file does exist then -afl_driver assumes it was restarted by afl-fuzz and will try to read old -statistics from the file. If that fails then the process will quit. - -*/ -#include <assert.h> -#include <stdio.h> -#include <stdint.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <errno.h> -#include <signal.h> -#include <sys/resource.h> -#include <sys/time.h> -// Platform detection. Copied from FuzzerInternal.h -#ifdef __linux__ -#define LIBFUZZER_LINUX 1 -#define LIBFUZZER_APPLE 0 -#elif __APPLE__ -#define LIBFUZZER_LINUX 0 -#define LIBFUZZER_APPLE 1 -#else -#error "Support for your platform has not been implemented" -#endif - -// Used to avoid repeating error checking boilerplate. If cond is false, a -// fatal error has occured in the program. In this event print error_message -// to stderr and abort(). Otherwise do nothing. Note that setting -// AFL_DRIVER_STDERR_DUPLICATE_FILENAME may cause error_message to be appended -// to the file as well, if the error occurs after the duplication is performed. -#define CHECK_ERROR(cond, error_message) \ - if (!(cond)) { \ - fprintf(stderr, (error_message)); \ - abort(); \ - } - -// libFuzzer interface is thin, so we don't include any libFuzzer headers. -extern "C" { -int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); -__attribute__((weak)) int LLVMFuzzerInitialize(int *argc, char ***argv); -} - -// Notify AFL about persistent mode. -static volatile char AFL_PERSISTENT[] = "##SIG_AFL_PERSISTENT##"; -extern "C" int __afl_persistent_loop(unsigned int); -static volatile char suppress_warning2 = AFL_PERSISTENT[0]; - -// Notify AFL about deferred forkserver. -static volatile char AFL_DEFER_FORKSVR[] = "##SIG_AFL_DEFER_FORKSRV##"; -extern "C" void __afl_manual_init(); -static volatile char suppress_warning1 = AFL_DEFER_FORKSVR[0]; - -// Input buffer. -static const size_t kMaxAflInputSize = 1 << 20; -static uint8_t AflInputBuf[kMaxAflInputSize]; - -// Variables we need for writing to the extra stats file. -static FILE *extra_stats_file = NULL; -static uint32_t previous_peak_rss = 0; -static time_t slowest_unit_time_secs = 0; -static const int kNumExtraStats = 2; -static const char *kExtraStatsFormatString = "peak_rss_mb : %u\n" - "slowest_unit_time_sec : %u\n"; - -// Copied from FuzzerUtil.cpp. -size_t GetPeakRSSMb() { - struct rusage usage; - if (getrusage(RUSAGE_SELF, &usage)) - return 0; - if (LIBFUZZER_LINUX) { - // ru_maxrss is in KiB - return usage.ru_maxrss >> 10; - } else if (LIBFUZZER_APPLE) { - // ru_maxrss is in bytes - return usage.ru_maxrss >> 20; - } - assert(0 && "GetPeakRSSMb() is not implemented for your platform"); - return 0; -} - -// Based on SetSigaction in FuzzerUtil.cpp -static void SetSigaction(int signum, - void (*callback)(int, siginfo_t *, void *)) { - struct sigaction sigact; - memset(&sigact, 0, sizeof(sigact)); - sigact.sa_sigaction = callback; - if (sigaction(signum, &sigact, 0)) { - fprintf(stderr, "libFuzzer: sigaction failed with %d\n", errno); - exit(1); - } -} - -// Write extra stats to the file specified by the user. If none is specified -// this function will never be called. -static void write_extra_stats() { - uint32_t peak_rss = GetPeakRSSMb(); - - if (peak_rss < previous_peak_rss) - peak_rss = previous_peak_rss; - - int chars_printed = fprintf(extra_stats_file, kExtraStatsFormatString, - peak_rss, slowest_unit_time_secs); - - CHECK_ERROR(chars_printed != 0, "Failed to write extra_stats_file"); - - CHECK_ERROR(fclose(extra_stats_file) == 0, - "Failed to close extra_stats_file"); -} - -// Call write_extra_stats before we exit. -static void crash_handler(int, siginfo_t *, void *) { - // Make sure we don't try calling write_extra_stats again if we crashed while - // trying to call it. - static bool first_crash = true; - CHECK_ERROR(first_crash, - "Crashed in crash signal handler. This is a bug in the fuzzer."); - - first_crash = false; - write_extra_stats(); -} - -// If the user has specified an extra_stats_file through the environment -// variable AFL_DRIVER_EXTRA_STATS_FILENAME, then perform necessary set up -// to write stats to it on exit. If no file is specified, do nothing. Otherwise -// install signal and exit handlers to write to the file when the process exits. -// Then if the file doesn't exist create it and set extra stats to 0. But if it -// does exist then read the initial values of the extra stats from the file -// and check that the file is writable. -static void maybe_initialize_extra_stats() { - // If AFL_DRIVER_EXTRA_STATS_FILENAME isn't set then we have nothing to do. - char *extra_stats_filename = getenv("AFL_DRIVER_EXTRA_STATS_FILENAME"); - if (!extra_stats_filename) - return; - - // Open the file and find the previous peak_rss_mb value. - // This is necessary because the fuzzing process is restarted after N - // iterations are completed. So we may need to get this value from a previous - // process to be accurate. - extra_stats_file = fopen(extra_stats_filename, "r"); - - // If extra_stats_file already exists: read old stats from it. - if (extra_stats_file) { - int matches = fscanf(extra_stats_file, kExtraStatsFormatString, - &previous_peak_rss, &slowest_unit_time_secs); - - // Make sure we have read a real extra stats file and that we have used it - // to set slowest_unit_time_secs and previous_peak_rss. - CHECK_ERROR(matches == kNumExtraStats, "Extra stats file is corrupt"); - - CHECK_ERROR(fclose(extra_stats_file) == 0, "Failed to close file"); - - // Now open the file for writing. - extra_stats_file = fopen(extra_stats_filename, "w"); - CHECK_ERROR(extra_stats_file, - "Failed to open extra stats file for writing"); - } else { - // Looks like this is the first time in a fuzzing job this is being called. - extra_stats_file = fopen(extra_stats_filename, "w+"); - CHECK_ERROR(extra_stats_file, "failed to create extra stats file"); - } - - // Make sure that crash_handler gets called on any kind of fatal error. - int crash_signals[] = {SIGSEGV, SIGBUS, SIGABRT, SIGILL, SIGFPE, SIGINT, - SIGTERM}; - - const size_t num_signals = sizeof(crash_signals) / sizeof(crash_signals[0]); - - for (size_t idx = 0; idx < num_signals; idx++) - SetSigaction(crash_signals[idx], crash_handler); - - // Make sure it gets called on other kinds of exits. - atexit(write_extra_stats); -} - -// If the user asks us to duplicate stderr, then do it. -static void maybe_duplicate_stderr() { - char* stderr_duplicate_filename = - getenv("AFL_DRIVER_STDERR_DUPLICATE_FILENAME"); - - if (!stderr_duplicate_filename) - return; - - FILE* stderr_duplicate_stream = - freopen(stderr_duplicate_filename, "a+", stderr); - - if (!stderr_duplicate_stream) { - fprintf( - stderr, - "Failed to duplicate stderr to AFL_DRIVER_STDERR_DUPLICATE_FILENAME"); - abort(); - } -} - -int main(int argc, char **argv) { - fprintf(stderr, "Running in AFl-fuzz mode\nUsage:\n" - "afl-fuzz [afl-flags] %s [N] " - "-- run N fuzzing iterations before " - "re-spawning the process (default: 1000)\n", - argv[0]); - if (LLVMFuzzerInitialize) - LLVMFuzzerInitialize(&argc, &argv); - // Do any other expensive one-time initialization here. - - maybe_duplicate_stderr(); - maybe_initialize_extra_stats(); - - __afl_manual_init(); - - int N = 1000; - if (argc >= 2) - N = atoi(argv[1]); - assert(N > 0); - time_t unit_time_secs; - while (__afl_persistent_loop(N)) { - ssize_t n_read = read(0, AflInputBuf, kMaxAflInputSize); - if (n_read > 0) { - // Copy AflInputBuf into a separate buffer to let asan find buffer - // overflows. Don't use unique_ptr/etc to avoid extra dependencies. - uint8_t *copy = new uint8_t[n_read]; - memcpy(copy, AflInputBuf, n_read); - - struct timeval unit_start_time; - CHECK_ERROR(gettimeofday(&unit_start_time, NULL) == 0, - "Calling gettimeofday failed"); - - LLVMFuzzerTestOneInput(copy, n_read); - - struct timeval unit_stop_time; - CHECK_ERROR(gettimeofday(&unit_stop_time, NULL) == 0, - "Calling gettimeofday failed"); - - // Update slowest_unit_time_secs if we see a new max. - unit_time_secs = unit_stop_time.tv_sec - unit_start_time.tv_sec; - if (slowest_unit_time_secs < unit_time_secs) - slowest_unit_time_secs = unit_time_secs; - - delete[] copy; - } - } -} diff --git a/gnu/llvm/lib/Fuzzer/build.sh b/gnu/llvm/lib/Fuzzer/build.sh deleted file mode 100755 index 27c148ad43d..00000000000 --- a/gnu/llvm/lib/Fuzzer/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -LIBFUZZER_SRC_DIR=$(dirname $0) -for f in $LIBFUZZER_SRC_DIR/*.cpp; do - clang -g -O2 -fno-omit-frame-pointer -std=c++11 $f -c & -done -wait -rm -f libFuzzer.a -ar ru libFuzzer.a Fuzzer*.o -rm -f Fuzzer*.o - diff --git a/gnu/llvm/lib/Fuzzer/cxx.dict b/gnu/llvm/lib/Fuzzer/cxx.dict deleted file mode 100644 index 41350f47558..00000000000 --- a/gnu/llvm/lib/Fuzzer/cxx.dict +++ /dev/null @@ -1,122 +0,0 @@ -"++" -"--" -"<<" -">>" -"+=" -"-=" -"*=" -"/=" -">>=" -"<<=" -"&=" -"|=" -"^=" -"%=" -"!=" -"&&" -"||" -"==" -">=" -"<=" -"->" -"alignas" -"alignof" -"and" -"and_eq" -"asm" -"auto" -"bitand" -"bitor" -"bool" -"break" -"case" -"catch" -"char" -"char16_t" -"char32_t" -"class" -"compl" -"concept" -"const" -"constexpr" -"const_cast" -"continue" -"decltype" -"default" -"delete" -"do" -"double" -"dynamic_cast" -"else" -"enum" -"explicit" -"export" -"extern" -"false" -"float" -"for" -"friend" -"goto" -"if" -"inline" -"int" -"long" -"mutable" -"namespace" -"new" -"noexcept" -"not" -"not_eq" -"nullptr" -"operator" -"or" -"or_eq" -"private" -"protected" -"public" -"register" -"reinterpret_cast" -"requires" -"return" -"short" -"signed" -"sizeof" -"static" -"static_assert" -"static_cast" -"struct" -"switch" -"template" -"this" -"thread_local" -"throw" -"true" -"try" -"typedef" -"typeid" -"typename" -"union" -"unsigned" -"using" -"virtual" -"void" -"volatile" -"wchar_t" -"while" -"xor" -"xor_eq" -"if" -"elif" -"else" -"endif" -"defined" -"ifdef" -"ifndef" -"define" -"undef" -"include" -"line" -"error" -"pragma" -"override" -"final" diff --git a/gnu/llvm/lib/Fuzzer/standalone/StandaloneFuzzTargetMain.c b/gnu/llvm/lib/Fuzzer/standalone/StandaloneFuzzTargetMain.c deleted file mode 100644 index 0d76ea49e79..00000000000 --- a/gnu/llvm/lib/Fuzzer/standalone/StandaloneFuzzTargetMain.c +++ /dev/null @@ -1,41 +0,0 @@ -/*===- StandaloneFuzzTargetMain.c - standalone main() for fuzz targets. ---===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// This main() function can be linked to a fuzz target (i.e. a library -// that exports LLVMFuzzerTestOneInput() and possibly LLVMFuzzerInitialize()) -// instead of libFuzzer. This main() function will not perform any fuzzing -// but will simply feed all input files one by one to the fuzz target. -// -// Use this file to provide reproducers for bugs when linking against libFuzzer -// or other fuzzing engine is undesirable. -//===----------------------------------------------------------------------===*/ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> - -extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size); -__attribute__((weak)) extern int LLVMFuzzerInitialize(int *argc, char ***argv); -int main(int argc, char **argv) { - fprintf(stderr, "StandaloneFuzzTargetMain: running %d inputs\n", argc - 1); - if (LLVMFuzzerInitialize) - LLVMFuzzerInitialize(&argc, &argv); - for (int i = 1; i < argc; i++) { - fprintf(stderr, "Running: %s\n", argv[i]); - FILE *f = fopen(argv[i], "r"); - assert(f); - fseek(f, 0, SEEK_END); - size_t len = ftell(f); - fseek(f, 0, SEEK_SET); - unsigned char *buf = (unsigned char*)malloc(len); - size_t n_read = fread(buf, 1, len, f); - assert(n_read == len); - LLVMFuzzerTestOneInput(buf, len); - free(buf); - fprintf(stderr, "Done: %s: (%zd bytes)\n", argv[i], n_read); - } -} diff --git a/gnu/llvm/lib/Fuzzer/test/AFLDriverTest.cpp b/gnu/llvm/lib/Fuzzer/test/AFLDriverTest.cpp deleted file mode 100644 index 3dd0b611730..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/AFLDriverTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Contains dummy functions used to avoid dependency on AFL. -#include <stdint.h> -#include <stdlib.h> - -extern "C" void __afl_manual_init() {} - -extern "C" int __afl_persistent_loop(unsigned int) { - return 0; -} - -// This declaration exists to prevent the Darwin linker -// from complaining about this being a missing weak symbol. -extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { - return 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp b/gnu/llvm/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp deleted file mode 100644 index 577481431ae..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// abs(x) < 0 and y == Const puzzle, 64-bit variant. -#include <cstring> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstdio> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 16) return 0; - int64_t x; - uint64_t y; - memcpy(&x, Data, sizeof(x)); - memcpy(&y, Data + sizeof(x), sizeof(y)); - if (labs(x) < 0 && y == 0xbaddcafedeadbeefUL) { - printf("BINGO; Found the target, exiting; x = 0x%lx y 0x%lx\n", x, y); - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/AbsNegAndConstantTest.cpp b/gnu/llvm/lib/Fuzzer/test/AbsNegAndConstantTest.cpp deleted file mode 100644 index 69075a454c9..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/AbsNegAndConstantTest.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// abs(x) < 0 and y == Const puzzle. -#include <cstring> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstdio> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 8) return 0; - int x; - unsigned y; - memcpy(&x, Data, sizeof(x)); - memcpy(&y, Data + sizeof(x), sizeof(y)); - if (abs(x) < 0 && y == 0xbaddcafe) { - printf("BINGO; Found the target, exiting; x = 0x%x y 0x%x\n", x, y); - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/AccumulateAllocationsTest.cpp b/gnu/llvm/lib/Fuzzer/test/AccumulateAllocationsTest.cpp deleted file mode 100644 index 604d8fa299a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/AccumulateAllocationsTest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test with a more mallocs than frees, but no leak. -#include <cstdint> -#include <cstddef> - -const int kAllocatedPointersSize = 10000; -int NumAllocatedPointers = 0; -int *AllocatedPointers[kAllocatedPointersSize]; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (NumAllocatedPointers < kAllocatedPointersSize) - AllocatedPointers[NumAllocatedPointers++] = new int; - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/BadStrcmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/BadStrcmpTest.cpp deleted file mode 100644 index ba2b068f741..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/BadStrcmpTest.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test that we don't creash in case of bad strcmp params. -#include <cstddef> -#include <cstdint> -#include <cstring> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size != 10) return 0; - // Data is not zero-terminated, so this call is bad. - // Still, there are cases when such calles appear, see e.g. - // https://bugs.llvm.org/show_bug.cgi?id=32357 - Sink = strcmp(reinterpret_cast<const char*>(Data), "123456789"); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/BogusInitializeTest.cpp b/gnu/llvm/lib/Fuzzer/test/BogusInitializeTest.cpp deleted file mode 100644 index c7e81a5478b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/BogusInitializeTest.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Make sure LLVMFuzzerInitialize does not change argv[0]. -#include <stddef.h> -#include <stdint.h> - -extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { - ***argv = 'X'; - return 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/BufferOverflowOnInput.cpp b/gnu/llvm/lib/Fuzzer/test/BufferOverflowOnInput.cpp deleted file mode 100644 index b9d14052aee..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/BufferOverflowOnInput.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile bool SeedLargeBuffer; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - assert(Data); - if (Size >= 4) - SeedLargeBuffer = true; - if (Size == 3 && SeedLargeBuffer && Data[3]) { - std::cout << "Woops, reading Data[3] w/o crashing\n"; - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/CMakeLists.txt b/gnu/llvm/lib/Fuzzer/test/CMakeLists.txt deleted file mode 100644 index cd0b167eb38..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CMakeLists.txt +++ /dev/null @@ -1,118 +0,0 @@ -# Build all these tests with -O0, otherwise optimizations may merge some -# basic blocks and we'll fail to discover the targets. -# Also enable the coverage instrumentation back (it is disabled -# for the Fuzzer lib) -set(CMAKE_CXX_FLAGS_RELEASE "${LIBFUZZER_FLAGS_BASE} -O0 -fsanitize-coverage=edge,indirect-calls") - -set(DFSanTests - MemcmpTest - SimpleCmpTest - StrcmpTest - StrncmpTest - SwitchTest - ) - -set(Tests - CallerCalleeTest - CounterTest - FourIndependentBranchesTest - FullCoverageSetTest - MemcmpTest - NullDerefTest - SimpleCmpTest - SimpleDictionaryTest - SimpleHashTest - SimpleTest - StrcmpTest - StrncmpTest - SwitchTest - ThreadedTest - TimeoutTest - ) - -set(CustomMainTests - UserSuppliedFuzzerTest - ) - -set(UninstrumentedTests - UninstrumentedTest - ) - -set(TraceBBTests - SimpleTest - ) - -set(TestBinaries) - -foreach(Test ${Tests}) - add_executable(LLVMFuzzer-${Test} - ${Test}.cpp - ) - target_link_libraries(LLVMFuzzer-${Test} - LLVMFuzzer - ) - set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}) -endforeach() - -foreach(Test ${CustomMainTests}) - add_executable(LLVMFuzzer-${Test} - ${Test}.cpp - ) - target_link_libraries(LLVMFuzzer-${Test} - LLVMFuzzerNoMain - ) - set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}) -endforeach() - - -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg - ) - -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg - ) - -include_directories(..) -include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) - -add_executable(LLVMFuzzer-Unittest - FuzzerUnittest.cpp - $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects> - ) - -target_link_libraries(LLVMFuzzer-Unittest - gtest - gtest_main - ) - -set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest) - -add_subdirectory(dfsan) - -foreach(Test ${DFSanTests}) - set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan) -endforeach() - -add_subdirectory(uninstrumented) - -foreach(Test ${UninstrumentedTests}) - set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-Uninstrumented) -endforeach() - -add_subdirectory(trace-bb) - -foreach(Test ${TraceBBTests}) - set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-TraceBB) -endforeach() - -set_target_properties(${TestBinaries} - PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - -add_lit_testsuite(check-fuzzer "Running Fuzzer tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${TestBinaries} FileCheck not - ) diff --git a/gnu/llvm/lib/Fuzzer/test/CallerCalleeTest.cpp b/gnu/llvm/lib/Fuzzer/test/CallerCalleeTest.cpp deleted file mode 100644 index 150b2fc0405..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CallerCalleeTest.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// Simple test for a fuzzer. -// Try to find the target using the indirect caller-callee pairs. -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstring> -#include <iostream> - -typedef void (*F)(); -static F t[256]; - -void f34() { - std::cerr << "BINGO\n"; - exit(1); -} -void f23() { t[(unsigned)'d'] = f34;} -void f12() { t[(unsigned)'c'] = f23;} -void f01() { t[(unsigned)'b'] = f12;} -void f00() {} - -static F t0[256] = { - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, - f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, f00, -}; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 4) return 0; - // Spoof the counters. - for (int i = 0; i < 200; i++) { - f23(); - f12(); - f01(); - } - memcpy(t, t0, sizeof(t)); - t[(unsigned)'a'] = f01; - t[Data[0]](); - t[Data[1]](); - t[Data[2]](); - t[Data[3]](); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/CleanseTest.cpp b/gnu/llvm/lib/Fuzzer/test/CleanseTest.cpp deleted file mode 100644 index ee184570126..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CleanseTest.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test the the fuzzer is able to 'cleanse' the reproducer -// by replacing all irrelevant bytes with garbage. -#include <cstddef> -#include <cstdint> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size >= 20 && Data[1] == '1' && Data[5] == '5' && Data[10] == 'A' && - Data[19] == 'Z') - abort(); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/CounterTest.cpp b/gnu/llvm/lib/Fuzzer/test/CounterTest.cpp deleted file mode 100644 index b61f419c499..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CounterTest.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Test for a fuzzer: must find the case where a particular basic block is -// executed many times. -#include <iostream> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - int Num = 0; - for (size_t i = 0; i < Size; i++) - if (Data[i] == 'A' + i) - Num++; - if (Num >= 4) { - std::cerr << "BINGO!\n"; - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/CustomCrossOverAndMutateTest.cpp b/gnu/llvm/lib/Fuzzer/test/CustomCrossOverAndMutateTest.cpp deleted file mode 100644 index 74fc939534c..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CustomCrossOverAndMutateTest.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test that libFuzzer does not crash when LLVMFuzzerMutate called from -// LLVMFuzzerCustomCrossOver. -#include <algorithm> -#include <cstddef> -#include <cstdint> -#include <cstdlib> -#include <string.h> -#include <string> -#include <vector> - -#include "FuzzerInterface.h" - -static volatile int sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - std::string Str(reinterpret_cast<const char *>(Data), Size); - if (Size && Data[0] == '0') - sink++; - return 0; -} - -extern "C" size_t LLVMFuzzerCustomCrossOver(const uint8_t *Data1, size_t Size1, - const uint8_t *Data2, size_t Size2, - uint8_t *Out, size_t MaxOutSize, - unsigned int Seed) { - std::vector<uint8_t> Buffer(MaxOutSize * 10); - LLVMFuzzerMutate(Buffer.data(), Buffer.size(), Buffer.size()); - size_t Size = std::min(Size1, MaxOutSize); - memcpy(Out, Data1, Size); - return Size; -} diff --git a/gnu/llvm/lib/Fuzzer/test/CustomCrossOverTest.cpp b/gnu/llvm/lib/Fuzzer/test/CustomCrossOverTest.cpp deleted file mode 100644 index 2ab5781155f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CustomCrossOverTest.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a cutom mutator. -#include <assert.h> -#include <cstddef> -#include <cstdint> -#include <cstdlib> -#include <iostream> -#include <random> -#include <string.h> - -#include "FuzzerInterface.h" - -static const char *Separator = "-_^_-"; -static const char *Target = "012-_^_-abc"; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - assert(Data); - std::string Str(reinterpret_cast<const char *>(Data), Size); - - if (Str.find(Target) != std::string::npos) { - std::cout << "BINGO; Found the target, exiting\n"; - exit(1); - } - return 0; -} - -extern "C" size_t LLVMFuzzerCustomCrossOver(const uint8_t *Data1, size_t Size1, - const uint8_t *Data2, size_t Size2, - uint8_t *Out, size_t MaxOutSize, - unsigned int Seed) { - static bool Printed; - static size_t SeparatorLen = strlen(Separator); - - if (!Printed) { - std::cerr << "In LLVMFuzzerCustomCrossover\n"; - Printed = true; - } - - std::mt19937 R(Seed); - - size_t Offset1 = 0; - size_t Len1 = R() % (Size1 - Offset1); - size_t Offset2 = 0; - size_t Len2 = R() % (Size2 - Offset2); - size_t Size = Len1 + Len2 + SeparatorLen; - - if (Size > MaxOutSize) - return 0; - - memcpy(Out, Data1 + Offset1, Len1); - memcpy(Out + Len1, Separator, SeparatorLen); - memcpy(Out + Len1 + SeparatorLen, Data2 + Offset2, Len2); - - return Len1 + Len2 + SeparatorLen; -} diff --git a/gnu/llvm/lib/Fuzzer/test/CustomMutatorTest.cpp b/gnu/llvm/lib/Fuzzer/test/CustomMutatorTest.cpp deleted file mode 100644 index 4f84519a90e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CustomMutatorTest.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a cutom mutator. -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -#include "FuzzerInterface.h" - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - assert(Data); - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - std::cout << "BINGO; Found the target, exiting\n"; - exit(1); - } - } - } - return 0; -} - -extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size, - size_t MaxSize, unsigned int Seed) { - static bool Printed; - if (!Printed) { - std::cerr << "In LLVMFuzzerCustomMutator\n"; - Printed = true; - } - return LLVMFuzzerMutate(Data, Size, MaxSize); -} diff --git a/gnu/llvm/lib/Fuzzer/test/CxxStringEqTest.cpp b/gnu/llvm/lib/Fuzzer/test/CxxStringEqTest.cpp deleted file mode 100644 index 924851c5ad5..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/CxxStringEqTest.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. Must find a specific string -// used in std::string operator ==. -#include <cstddef> -#include <cstdint> -#include <cstdlib> -#include <iostream> -#include <string> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - std::string Str((const char*)Data, Size); - bool Eq = Str == "FooBar"; - Sink = Str == "123456"; // Try to confuse the fuzzer - if (Eq) { - std::cout << "BINGO; Found the target, exiting\n"; - std::cout.flush(); - abort(); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/DSO1.cpp b/gnu/llvm/lib/Fuzzer/test/DSO1.cpp deleted file mode 100644 index 4a293890f4b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/DSO1.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Source code for a simple DSO. - -int DSO1(int a) { - if (a < 123456) - return 0; - return 1; -} - -void Uncovered1() { } diff --git a/gnu/llvm/lib/Fuzzer/test/DSO2.cpp b/gnu/llvm/lib/Fuzzer/test/DSO2.cpp deleted file mode 100644 index 04b308d193a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/DSO2.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Source code for a simple DSO. - -int DSO2(int a) { - if (a < 3598235) - return 0; - return 1; -} - -void Uncovered2() {} diff --git a/gnu/llvm/lib/Fuzzer/test/DSOTestExtra.cpp b/gnu/llvm/lib/Fuzzer/test/DSOTestExtra.cpp deleted file mode 100644 index a2274d070eb..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/DSOTestExtra.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Source code for a simple DSO. - -int DSOTestExtra(int a) { - if (a < 452345) - return 0; - return 1; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/DSOTestMain.cpp b/gnu/llvm/lib/Fuzzer/test/DSOTestMain.cpp deleted file mode 100644 index 3e225d88612..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/DSOTestMain.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Source code for a simple DSO. - -#include <cstdint> -#include <cstdlib> -#include <cstring> -#include <cstdio> -extern int DSO1(int a); -extern int DSO2(int a); -extern int DSOTestExtra(int a); - -static volatile int *nil = 0; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - int x, y, z; - if (Size < sizeof(int) * 3) { - x = y = z = 0; - } else { - memcpy(&x, Data + 0 * sizeof(int), sizeof(int)); - memcpy(&y, Data + 1 * sizeof(int), sizeof(int)); - memcpy(&z, Data + 2 * sizeof(int), sizeof(int)); - } - int sum = DSO1(x) + DSO2(y) + (z ? DSOTestExtra(z) : 0); - if (sum == 3) { - fprintf(stderr, "BINGO %d %d %d\n", x, y, z); - *nil = 0; - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/DivTest.cpp b/gnu/llvm/lib/Fuzzer/test/DivTest.cpp deleted file mode 100644 index 63f6960f4e9..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/DivTest.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer: find the interesting argument for div. -#include <assert.h> -#include <cstdint> -#include <cstring> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 4) return 0; - int a; - memcpy(&a, Data, 4); - Sink = 12345678 / (987654 - a); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/EmptyTest.cpp b/gnu/llvm/lib/Fuzzer/test/EmptyTest.cpp deleted file mode 100644 index 5e843308fa5..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/EmptyTest.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -// A fuzzer with empty target function. - -#include <cstdint> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/EquivalenceATest.cpp b/gnu/llvm/lib/Fuzzer/test/EquivalenceATest.cpp deleted file mode 100644 index 7d1ebb0f6a4..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/EquivalenceATest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> - -// Test for libFuzzer's "equivalence" fuzzing, part A. -extern "C" void LLVMFuzzerAnnounceOutput(const uint8_t *Data, size_t Size); -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - // fprintf(stderr, "A %zd\n", Size); - uint8_t Result[50]; - if (Size > 50) Size = 50; - for (size_t i = 0; i < Size; i++) - Result[Size - i - 1] = Data[i]; - LLVMFuzzerAnnounceOutput(Result, Size); - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/EquivalenceBTest.cpp b/gnu/llvm/lib/Fuzzer/test/EquivalenceBTest.cpp deleted file mode 100644 index b1de208b57f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/EquivalenceBTest.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> - -// Test for libFuzzer's "equivalence" fuzzing, part B. -extern "C" void LLVMFuzzerAnnounceOutput(const uint8_t *Data, size_t Size); -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - // fprintf(stderr, "B %zd\n", Size); - uint8_t Result[50]; - if (Size > 50) Size = 50; - for (size_t i = 0; i < Size; i++) - Result[Size - i - 1] = Data[i]; - - // Be a bit different from EquivalenceATest - if (Size > 10 && Data[5] == 'B' && Data[6] == 'C' && Data[7] == 'D') { - static int c; - if (!c) - fprintf(stderr, "ZZZZZZZ\n"); - c = 1; - Result[2]++; - } - - LLVMFuzzerAnnounceOutput(Result, Size); - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/FlagsTest.cpp b/gnu/llvm/lib/Fuzzer/test/FlagsTest.cpp deleted file mode 100644 index ac64b9d48df..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/FlagsTest.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Parse some flags -#include <string> -#include <vector> - -static std::vector<std::string> Flags; - -extern "C" int LLVMFuzzerInitialize(int *Argc, char ***Argv) { - // Parse --flags and anything after -ignore_remaining_args=1 is passed. - int I = 1; - while (I < *Argc) { - std::string S((*Argv)[I++]); - if (S == "-ignore_remaining_args=1") - break; - if (S.substr(0, 2) == "--") - Flags.push_back(S); - } - while (I < *Argc) - Flags.push_back(std::string((*Argv)[I++])); - - return 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - fprintf(stderr, "BINGO "); - for (auto Flag : Flags) - fprintf(stderr, "%s ", Flag.c_str()); - fprintf(stderr, "\n"); - exit(0); -} diff --git a/gnu/llvm/lib/Fuzzer/test/FourIndependentBranchesTest.cpp b/gnu/llvm/lib/Fuzzer/test/FourIndependentBranchesTest.cpp deleted file mode 100644 index 6007dd4a027..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/FourIndependentBranchesTest.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "FUZZ". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - int bits = 0; - if (Size > 0 && Data[0] == 'F') bits |= 1; - if (Size > 1 && Data[1] == 'U') bits |= 2; - if (Size > 2 && Data[2] == 'Z') bits |= 4; - if (Size > 3 && Data[3] == 'Z') bits |= 8; - if (bits == 15) { - std::cerr << "BINGO!\n"; - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/FullCoverageSetTest.cpp b/gnu/llvm/lib/Fuzzer/test/FullCoverageSetTest.cpp deleted file mode 100644 index a868084a0ce..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/FullCoverageSetTest.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "FUZZER". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - int bits = 0; - if (Size > 0 && Data[0] == 'F') bits |= 1; - if (Size > 1 && Data[1] == 'U') bits |= 2; - if (Size > 2 && Data[2] == 'Z') bits |= 4; - if (Size > 3 && Data[3] == 'Z') bits |= 8; - if (Size > 4 && Data[4] == 'E') bits |= 16; - if (Size > 5 && Data[5] == 'R') bits |= 32; - if (bits == 63) { - std::cerr << "BINGO!\n"; - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp b/gnu/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp deleted file mode 100644 index b33e0c96145..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp +++ /dev/null @@ -1,402 +0,0 @@ -#include "FuzzerInternal.h" -#include "gtest/gtest.h" -#include <set> - -using namespace fuzzer; - -// For now, have LLVMFuzzerTestOneInput just to make it link. -// Later we may want to make unittests that actually call LLVMFuzzerTestOneInput. -extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - abort(); -} - -TEST(Fuzzer, CrossOver) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - Unit A({0, 1, 2}), B({5, 6, 7}); - Unit C; - Unit Expected[] = { - { 0 }, - { 0, 1 }, - { 0, 5 }, - { 0, 1, 2 }, - { 0, 1, 5 }, - { 0, 5, 1 }, - { 0, 5, 6 }, - { 0, 1, 2, 5 }, - { 0, 1, 5, 2 }, - { 0, 1, 5, 6 }, - { 0, 5, 1, 2 }, - { 0, 5, 1, 6 }, - { 0, 5, 6, 1 }, - { 0, 5, 6, 7 }, - { 0, 1, 2, 5, 6 }, - { 0, 1, 5, 2, 6 }, - { 0, 1, 5, 6, 2 }, - { 0, 1, 5, 6, 7 }, - { 0, 5, 1, 2, 6 }, - { 0, 5, 1, 6, 2 }, - { 0, 5, 1, 6, 7 }, - { 0, 5, 6, 1, 2 }, - { 0, 5, 6, 1, 7 }, - { 0, 5, 6, 7, 1 }, - { 0, 1, 2, 5, 6, 7 }, - { 0, 1, 5, 2, 6, 7 }, - { 0, 1, 5, 6, 2, 7 }, - { 0, 1, 5, 6, 7, 2 }, - { 0, 5, 1, 2, 6, 7 }, - { 0, 5, 1, 6, 2, 7 }, - { 0, 5, 1, 6, 7, 2 }, - { 0, 5, 6, 1, 2, 7 }, - { 0, 5, 6, 1, 7, 2 }, - { 0, 5, 6, 7, 1, 2 } - }; - for (size_t Len = 1; Len < 8; Len++) { - std::set<Unit> FoundUnits, ExpectedUnitsWitThisLength; - for (int Iter = 0; Iter < 3000; Iter++) { - C.resize(Len); - size_t NewSize = MD.CrossOver(A.data(), A.size(), B.data(), B.size(), - C.data(), C.size()); - C.resize(NewSize); - FoundUnits.insert(C); - } - for (const Unit &U : Expected) - if (U.size() <= Len) - ExpectedUnitsWitThisLength.insert(U); - EXPECT_EQ(ExpectedUnitsWitThisLength, FoundUnits); - } -} - -TEST(Fuzzer, Hash) { - uint8_t A[] = {'a', 'b', 'c'}; - fuzzer::Unit U(A, A + sizeof(A)); - EXPECT_EQ("a9993e364706816aba3e25717850c26c9cd0d89d", fuzzer::Hash(U)); - U.push_back('d'); - EXPECT_EQ("81fe8bfe87576c3ecb22426f8e57847382917acf", fuzzer::Hash(U)); -} - -typedef size_t (MutationDispatcher::*Mutator)(uint8_t *Data, size_t Size, - size_t MaxSize); - -void TestEraseByte(Mutator M, int NumIter) { - uint8_t REM0[8] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t REM1[8] = {0x00, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t REM2[8] = {0x00, 0x11, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t REM3[8] = {0x00, 0x11, 0x22, 0x44, 0x55, 0x66, 0x77}; - uint8_t REM4[8] = {0x00, 0x11, 0x22, 0x33, 0x55, 0x66, 0x77}; - uint8_t REM5[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x66, 0x77}; - uint8_t REM6[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x77}; - uint8_t REM7[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - int FoundMask = 0; - for (int i = 0; i < NumIter; i++) { - uint8_t T[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - size_t NewSize = (MD.*M)(T, sizeof(T), sizeof(T)); - if (NewSize == 7 && !memcmp(REM0, T, 7)) FoundMask |= 1 << 0; - if (NewSize == 7 && !memcmp(REM1, T, 7)) FoundMask |= 1 << 1; - if (NewSize == 7 && !memcmp(REM2, T, 7)) FoundMask |= 1 << 2; - if (NewSize == 7 && !memcmp(REM3, T, 7)) FoundMask |= 1 << 3; - if (NewSize == 7 && !memcmp(REM4, T, 7)) FoundMask |= 1 << 4; - if (NewSize == 7 && !memcmp(REM5, T, 7)) FoundMask |= 1 << 5; - if (NewSize == 7 && !memcmp(REM6, T, 7)) FoundMask |= 1 << 6; - if (NewSize == 7 && !memcmp(REM7, T, 7)) FoundMask |= 1 << 7; - } - EXPECT_EQ(FoundMask, 255); -} - -TEST(FuzzerMutate, EraseByte1) { - TestEraseByte(&MutationDispatcher::Mutate_EraseByte, 100); -} -TEST(FuzzerMutate, EraseByte2) { - TestEraseByte(&MutationDispatcher::Mutate, 1000); -} - -void TestInsertByte(Mutator M, int NumIter) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - int FoundMask = 0; - uint8_t INS0[8] = {0xF1, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - uint8_t INS1[8] = {0x00, 0xF2, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - uint8_t INS2[8] = {0x00, 0x11, 0xF3, 0x22, 0x33, 0x44, 0x55, 0x66}; - uint8_t INS3[8] = {0x00, 0x11, 0x22, 0xF4, 0x33, 0x44, 0x55, 0x66}; - uint8_t INS4[8] = {0x00, 0x11, 0x22, 0x33, 0xF5, 0x44, 0x55, 0x66}; - uint8_t INS5[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0xF6, 0x55, 0x66}; - uint8_t INS6[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0xF7, 0x66}; - uint8_t INS7[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0xF8}; - for (int i = 0; i < NumIter; i++) { - uint8_t T[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - size_t NewSize = (MD.*M)(T, 7, 8); - if (NewSize == 8 && !memcmp(INS0, T, 8)) FoundMask |= 1 << 0; - if (NewSize == 8 && !memcmp(INS1, T, 8)) FoundMask |= 1 << 1; - if (NewSize == 8 && !memcmp(INS2, T, 8)) FoundMask |= 1 << 2; - if (NewSize == 8 && !memcmp(INS3, T, 8)) FoundMask |= 1 << 3; - if (NewSize == 8 && !memcmp(INS4, T, 8)) FoundMask |= 1 << 4; - if (NewSize == 8 && !memcmp(INS5, T, 8)) FoundMask |= 1 << 5; - if (NewSize == 8 && !memcmp(INS6, T, 8)) FoundMask |= 1 << 6; - if (NewSize == 8 && !memcmp(INS7, T, 8)) FoundMask |= 1 << 7; - } - EXPECT_EQ(FoundMask, 255); -} - -TEST(FuzzerMutate, InsertByte1) { - TestInsertByte(&MutationDispatcher::Mutate_InsertByte, 1 << 15); -} -TEST(FuzzerMutate, InsertByte2) { - TestInsertByte(&MutationDispatcher::Mutate, 1 << 17); -} - -void TestChangeByte(Mutator M, int NumIter) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - int FoundMask = 0; - uint8_t CH0[8] = {0xF0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH1[8] = {0x00, 0xF1, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH2[8] = {0x00, 0x11, 0xF2, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH3[8] = {0x00, 0x11, 0x22, 0xF3, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH4[8] = {0x00, 0x11, 0x22, 0x33, 0xF4, 0x55, 0x66, 0x77}; - uint8_t CH5[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0xF5, 0x66, 0x77}; - uint8_t CH6[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0xF5, 0x77}; - uint8_t CH7[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0xF7}; - for (int i = 0; i < NumIter; i++) { - uint8_t T[9] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - size_t NewSize = (MD.*M)(T, 8, 9); - if (NewSize == 8 && !memcmp(CH0, T, 8)) FoundMask |= 1 << 0; - if (NewSize == 8 && !memcmp(CH1, T, 8)) FoundMask |= 1 << 1; - if (NewSize == 8 && !memcmp(CH2, T, 8)) FoundMask |= 1 << 2; - if (NewSize == 8 && !memcmp(CH3, T, 8)) FoundMask |= 1 << 3; - if (NewSize == 8 && !memcmp(CH4, T, 8)) FoundMask |= 1 << 4; - if (NewSize == 8 && !memcmp(CH5, T, 8)) FoundMask |= 1 << 5; - if (NewSize == 8 && !memcmp(CH6, T, 8)) FoundMask |= 1 << 6; - if (NewSize == 8 && !memcmp(CH7, T, 8)) FoundMask |= 1 << 7; - } - EXPECT_EQ(FoundMask, 255); -} - -TEST(FuzzerMutate, ChangeByte1) { - TestChangeByte(&MutationDispatcher::Mutate_ChangeByte, 1 << 15); -} -TEST(FuzzerMutate, ChangeByte2) { - TestChangeByte(&MutationDispatcher::Mutate, 1 << 17); -} - -void TestChangeBit(Mutator M, int NumIter) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - int FoundMask = 0; - uint8_t CH0[8] = {0x01, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH1[8] = {0x00, 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH2[8] = {0x00, 0x11, 0x02, 0x33, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH3[8] = {0x00, 0x11, 0x22, 0x37, 0x44, 0x55, 0x66, 0x77}; - uint8_t CH4[8] = {0x00, 0x11, 0x22, 0x33, 0x54, 0x55, 0x66, 0x77}; - uint8_t CH5[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x54, 0x66, 0x77}; - uint8_t CH6[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x76, 0x77}; - uint8_t CH7[8] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0xF7}; - for (int i = 0; i < NumIter; i++) { - uint8_t T[9] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}; - size_t NewSize = (MD.*M)(T, 8, 9); - if (NewSize == 8 && !memcmp(CH0, T, 8)) FoundMask |= 1 << 0; - if (NewSize == 8 && !memcmp(CH1, T, 8)) FoundMask |= 1 << 1; - if (NewSize == 8 && !memcmp(CH2, T, 8)) FoundMask |= 1 << 2; - if (NewSize == 8 && !memcmp(CH3, T, 8)) FoundMask |= 1 << 3; - if (NewSize == 8 && !memcmp(CH4, T, 8)) FoundMask |= 1 << 4; - if (NewSize == 8 && !memcmp(CH5, T, 8)) FoundMask |= 1 << 5; - if (NewSize == 8 && !memcmp(CH6, T, 8)) FoundMask |= 1 << 6; - if (NewSize == 8 && !memcmp(CH7, T, 8)) FoundMask |= 1 << 7; - } - EXPECT_EQ(FoundMask, 255); -} - -TEST(FuzzerMutate, ChangeBit1) { - TestChangeBit(&MutationDispatcher::Mutate_ChangeBit, 1 << 16); -} -TEST(FuzzerMutate, ChangeBit2) { - TestChangeBit(&MutationDispatcher::Mutate, 1 << 18); -} - -void TestShuffleBytes(Mutator M, int NumIter) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - int FoundMask = 0; - uint8_t CH0[7] = {0x00, 0x22, 0x11, 0x33, 0x44, 0x55, 0x66}; - uint8_t CH1[7] = {0x11, 0x00, 0x33, 0x22, 0x44, 0x55, 0x66}; - uint8_t CH2[7] = {0x00, 0x33, 0x11, 0x22, 0x44, 0x55, 0x66}; - uint8_t CH3[7] = {0x00, 0x11, 0x22, 0x44, 0x55, 0x66, 0x33}; - uint8_t CH4[7] = {0x00, 0x11, 0x22, 0x33, 0x55, 0x44, 0x66}; - for (int i = 0; i < NumIter; i++) { - uint8_t T[7] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - size_t NewSize = (MD.*M)(T, 7, 7); - if (NewSize == 7 && !memcmp(CH0, T, 7)) FoundMask |= 1 << 0; - if (NewSize == 7 && !memcmp(CH1, T, 7)) FoundMask |= 1 << 1; - if (NewSize == 7 && !memcmp(CH2, T, 7)) FoundMask |= 1 << 2; - if (NewSize == 7 && !memcmp(CH3, T, 7)) FoundMask |= 1 << 3; - if (NewSize == 7 && !memcmp(CH4, T, 7)) FoundMask |= 1 << 4; - } - EXPECT_EQ(FoundMask, 31); -} - -TEST(FuzzerMutate, ShuffleBytes1) { - TestShuffleBytes(&MutationDispatcher::Mutate_ShuffleBytes, 1 << 15); -} -TEST(FuzzerMutate, ShuffleBytes2) { - TestShuffleBytes(&MutationDispatcher::Mutate, 1 << 19); -} - -void TestAddWordFromDictionary(Mutator M, int NumIter) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - uint8_t Word1[4] = {0xAA, 0xBB, 0xCC, 0xDD}; - uint8_t Word2[3] = {0xFF, 0xEE, 0xEF}; - MD.AddWordToManualDictionary(Unit(Word1, Word1 + sizeof(Word1))); - MD.AddWordToManualDictionary(Unit(Word2, Word2 + sizeof(Word2))); - int FoundMask = 0; - uint8_t CH0[7] = {0x00, 0x11, 0x22, 0xAA, 0xBB, 0xCC, 0xDD}; - uint8_t CH1[7] = {0x00, 0x11, 0xAA, 0xBB, 0xCC, 0xDD, 0x22}; - uint8_t CH2[7] = {0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0x11, 0x22}; - uint8_t CH3[7] = {0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22}; - uint8_t CH4[6] = {0x00, 0x11, 0x22, 0xFF, 0xEE, 0xEF}; - uint8_t CH5[6] = {0x00, 0x11, 0xFF, 0xEE, 0xEF, 0x22}; - uint8_t CH6[6] = {0x00, 0xFF, 0xEE, 0xEF, 0x11, 0x22}; - uint8_t CH7[6] = {0xFF, 0xEE, 0xEF, 0x00, 0x11, 0x22}; - for (int i = 0; i < NumIter; i++) { - uint8_t T[7] = {0x00, 0x11, 0x22}; - size_t NewSize = (MD.*M)(T, 3, 7); - if (NewSize == 7 && !memcmp(CH0, T, 7)) FoundMask |= 1 << 0; - if (NewSize == 7 && !memcmp(CH1, T, 7)) FoundMask |= 1 << 1; - if (NewSize == 7 && !memcmp(CH2, T, 7)) FoundMask |= 1 << 2; - if (NewSize == 7 && !memcmp(CH3, T, 7)) FoundMask |= 1 << 3; - if (NewSize == 6 && !memcmp(CH4, T, 6)) FoundMask |= 1 << 4; - if (NewSize == 6 && !memcmp(CH5, T, 6)) FoundMask |= 1 << 5; - if (NewSize == 6 && !memcmp(CH6, T, 6)) FoundMask |= 1 << 6; - if (NewSize == 6 && !memcmp(CH7, T, 6)) FoundMask |= 1 << 7; - } - EXPECT_EQ(FoundMask, 255); -} - -TEST(FuzzerMutate, AddWordFromDictionary1) { - TestAddWordFromDictionary( - &MutationDispatcher::Mutate_AddWordFromManualDictionary, 1 << 15); -} - -TEST(FuzzerMutate, AddWordFromDictionary2) { - TestAddWordFromDictionary(&MutationDispatcher::Mutate, 1 << 15); -} - -void TestAddWordFromDictionaryWithHint(Mutator M, int NumIter) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - uint8_t Word[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0xEE, 0xEF}; - size_t PosHint = 7777; - MD.AddWordToAutoDictionary(Unit(Word, Word + sizeof(Word)), PosHint); - int FoundMask = 0; - for (int i = 0; i < NumIter; i++) { - uint8_t T[10000]; - memset(T, 0, sizeof(T)); - size_t NewSize = (MD.*M)(T, 9000, 10000); - if (NewSize >= PosHint + sizeof(Word) && - !memcmp(Word, T + PosHint, sizeof(Word))) - FoundMask = 1; - } - EXPECT_EQ(FoundMask, 1); -} - -TEST(FuzzerMutate, AddWordFromDictionaryWithHint1) { - TestAddWordFromDictionaryWithHint( - &MutationDispatcher::Mutate_AddWordFromAutoDictionary, 1 << 5); -} - -TEST(FuzzerMutate, AddWordFromDictionaryWithHint2) { - TestAddWordFromDictionaryWithHint(&MutationDispatcher::Mutate, 1 << 10); -} - -void TestChangeASCIIInteger(Mutator M, int NumIter) { - FuzzerRandomLibc Rand(0); - MutationDispatcher MD(Rand); - - uint8_t CH0[8] = {'1', '2', '3', '4', '5', '6', '7', '7'}; - uint8_t CH1[8] = {'1', '2', '3', '4', '5', '6', '7', '9'}; - uint8_t CH2[8] = {'2', '4', '6', '9', '1', '3', '5', '6'}; - uint8_t CH3[8] = {'0', '6', '1', '7', '2', '8', '3', '9'}; - int FoundMask = 0; - for (int i = 0; i < NumIter; i++) { - uint8_t T[8] = {'1', '2', '3', '4', '5', '6', '7', '8'}; - size_t NewSize = (MD.*M)(T, 8, 8); - /**/ if (NewSize == 8 && !memcmp(CH0, T, 8)) FoundMask |= 1 << 0; - else if (NewSize == 8 && !memcmp(CH1, T, 8)) FoundMask |= 1 << 1; - else if (NewSize == 8 && !memcmp(CH2, T, 8)) FoundMask |= 1 << 2; - else if (NewSize == 8 && !memcmp(CH3, T, 8)) FoundMask |= 1 << 3; - else if (NewSize == 8) FoundMask |= 1 << 4; - } - EXPECT_EQ(FoundMask, 31); -} - -TEST(FuzzerMutate, ChangeASCIIInteger1) { - TestChangeASCIIInteger(&MutationDispatcher::Mutate_ChangeASCIIInteger, - 1 << 15); -} - -TEST(FuzzerMutate, ChangeASCIIInteger2) { - TestChangeASCIIInteger(&MutationDispatcher::Mutate, 1 << 15); -} - - -TEST(FuzzerDictionary, ParseOneDictionaryEntry) { - Unit U; - EXPECT_FALSE(ParseOneDictionaryEntry("", &U)); - EXPECT_FALSE(ParseOneDictionaryEntry(" ", &U)); - EXPECT_FALSE(ParseOneDictionaryEntry("\t ", &U)); - EXPECT_FALSE(ParseOneDictionaryEntry(" \" ", &U)); - EXPECT_FALSE(ParseOneDictionaryEntry(" zz\" ", &U)); - EXPECT_FALSE(ParseOneDictionaryEntry(" \"zz ", &U)); - EXPECT_FALSE(ParseOneDictionaryEntry(" \"\" ", &U)); - EXPECT_TRUE(ParseOneDictionaryEntry("\"a\"", &U)); - EXPECT_EQ(U, Unit({'a'})); - EXPECT_TRUE(ParseOneDictionaryEntry("\"abc\"", &U)); - EXPECT_EQ(U, Unit({'a', 'b', 'c'})); - EXPECT_TRUE(ParseOneDictionaryEntry("abc=\"abc\"", &U)); - EXPECT_EQ(U, Unit({'a', 'b', 'c'})); - EXPECT_FALSE(ParseOneDictionaryEntry("\"\\\"", &U)); - EXPECT_TRUE(ParseOneDictionaryEntry("\"\\\\\"", &U)); - EXPECT_EQ(U, Unit({'\\'})); - EXPECT_TRUE(ParseOneDictionaryEntry("\"\\xAB\"", &U)); - EXPECT_EQ(U, Unit({0xAB})); - EXPECT_TRUE(ParseOneDictionaryEntry("\"\\xABz\\xDE\"", &U)); - EXPECT_EQ(U, Unit({0xAB, 'z', 0xDE})); - EXPECT_TRUE(ParseOneDictionaryEntry("\"#\"", &U)); - EXPECT_EQ(U, Unit({'#'})); - EXPECT_TRUE(ParseOneDictionaryEntry("\"\\\"\"", &U)); - EXPECT_EQ(U, Unit({'"'})); -} - -TEST(FuzzerDictionary, ParseDictionaryFile) { - std::vector<Unit> Units; - EXPECT_FALSE(ParseDictionaryFile("zzz\n", &Units)); - EXPECT_FALSE(ParseDictionaryFile("", &Units)); - EXPECT_TRUE(ParseDictionaryFile("\n", &Units)); - EXPECT_EQ(Units.size(), 0U); - EXPECT_TRUE(ParseDictionaryFile("#zzzz a b c d\n", &Units)); - EXPECT_EQ(Units.size(), 0U); - EXPECT_TRUE(ParseDictionaryFile(" #zzzz\n", &Units)); - EXPECT_EQ(Units.size(), 0U); - EXPECT_TRUE(ParseDictionaryFile(" #zzzz\n", &Units)); - EXPECT_EQ(Units.size(), 0U); - EXPECT_TRUE(ParseDictionaryFile(" #zzzz\naaa=\"aa\"", &Units)); - EXPECT_EQ(Units, std::vector<Unit>({Unit({'a', 'a'})})); - EXPECT_TRUE( - ParseDictionaryFile(" #zzzz\naaa=\"aa\"\n\nabc=\"abc\"", &Units)); - EXPECT_EQ(Units, - std::vector<Unit>({Unit({'a', 'a'}), Unit({'a', 'b', 'c'})})); -} - -TEST(FuzzerUtil, Base64) { - EXPECT_EQ("", Base64({})); - EXPECT_EQ("YQ==", Base64({'a'})); - EXPECT_EQ("eA==", Base64({'x'})); - EXPECT_EQ("YWI=", Base64({'a', 'b'})); - EXPECT_EQ("eHk=", Base64({'x', 'y'})); - EXPECT_EQ("YWJj", Base64({'a', 'b', 'c'})); - EXPECT_EQ("eHl6", Base64({'x', 'y', 'z'})); - EXPECT_EQ("YWJjeA==", Base64({'a', 'b', 'c', 'x'})); - EXPECT_EQ("YWJjeHk=", Base64({'a', 'b', 'c', 'x', 'y'})); - EXPECT_EQ("YWJjeHl6", Base64({'a', 'b', 'c', 'x', 'y', 'z'})); -} diff --git a/gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp b/gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp deleted file mode 100644 index d40ff2f7936..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Make sure LLVMFuzzerInitialize is called. -#include <assert.h> -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -static char *argv0; - -extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { - assert(argc > 0); - argv0 = **argv; - return 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (strncmp(reinterpret_cast<const char*>(Data), argv0, Size)) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/LargeTest.cpp b/gnu/llvm/lib/Fuzzer/test/LargeTest.cpp deleted file mode 100644 index 83ed6197180..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/LargeTest.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// A fuzz target with lots of edges. -#include <cstdint> -#include <cstdlib> - -static inline void break_optimization(const void *arg) { - __asm__ __volatile__("" : : "r" (arg) : "memory"); -} - -#define A \ - do { \ - i++; \ - c++; \ - if (Data[(i + __LINE__) % Size] == (c % 256)) \ - break_optimization(Data); \ - else \ - break_optimization(0); \ - } while (0) - -// for (int i = 0, n = Data[(__LINE__ - 1) % Size] % 16; i < n; i++) - -#define B do{A; A; A; A; A; A; A; A; A; A; A; A; A; A; A; A; A; A; }while(0) -#define C do{B; B; B; B; B; B; B; B; B; B; B; B; B; B; B; B; B; B; }while(0) -#define D do{C; C; C; C; C; C; C; C; C; C; C; C; C; C; C; C; C; C; }while(0) -#define E do{D; D; D; D; D; D; D; D; D; D; D; D; D; D; D; D; D; D; }while(0) - -volatile int sink; -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (!Size) return 0; - int c = 0; - int i = 0; - D; - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/LeakTest.cpp b/gnu/llvm/lib/Fuzzer/test/LeakTest.cpp deleted file mode 100644 index 22e5164050e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/LeakTest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test with a leak. -#include <cstdint> -#include <cstddef> - -static volatile void *Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && *Data == 'H') { - Sink = new int; - Sink = nullptr; - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/LeakTimeoutTest.cpp b/gnu/llvm/lib/Fuzzer/test/LeakTimeoutTest.cpp deleted file mode 100644 index 4f31b3e52c1..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/LeakTimeoutTest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test with a leak. -#include <cstdint> -#include <cstddef> - -static volatile int *Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (!Size) return 0; - Sink = new int; - Sink = new int; - while (Sink) *Sink = 0; // Infinite loop. - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/LoadTest.cpp b/gnu/llvm/lib/Fuzzer/test/LoadTest.cpp deleted file mode 100644 index c1780d5c7bd..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/LoadTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer: find interesting value of array index. -#include <assert.h> -#include <cstdint> -#include <cstring> -#include <cstddef> -#include <iostream> - -static volatile int Sink; -const int kArraySize = 1234567; -int array[kArraySize]; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 8) return 0; - size_t a = 0; - memcpy(&a, Data, 8); - Sink = array[a % (kArraySize + 1)]; - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/Memcmp64BytesTest.cpp b/gnu/llvm/lib/Fuzzer/test/Memcmp64BytesTest.cpp deleted file mode 100644 index 5b6cb707173..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/Memcmp64BytesTest.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find a particular string. -#include <cassert> -#include <cstdint> -#include <cstdio> -#include <cstdlib> -#include <cstring> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - const char kString64Bytes[] = - "123456789 123456789 123456789 123456789 123456789 123456789 1234"; - assert(sizeof(kString64Bytes) == 65); - if (Size >= 64 && memcmp(Data, kString64Bytes, 64) == 0) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/MemcmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/MemcmpTest.cpp deleted file mode 100644 index c19c95717bb..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/MemcmpTest.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find a particular string. -#include <cstring> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - // TODO: check other sizes. - if (Size >= 8 && memcmp(Data, "01234567", 8) == 0) { - if (Size >= 12 && memcmp(Data + 8, "ABCD", 4) == 0) { - if (Size >= 14 && memcmp(Data + 12, "XY", 2) == 0) { - if (Size >= 16 && memcmp(Data + 14, "KLM", 3) == 0) { - if (Size >= 27 && memcmp(Data + 17, "ABCDE-GHIJ", 10) == 0){ - fprintf(stderr, "BINGO %zd\n", Size); - for (size_t i = 0; i < Size; i++) { - uint8_t C = Data[i]; - if (C >= 32 && C < 127) - fprintf(stderr, "%c", C); - } - fprintf(stderr, "\n"); - exit(1); - } - } - } - } - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/NotinstrumentedTest.cpp b/gnu/llvm/lib/Fuzzer/test/NotinstrumentedTest.cpp deleted file mode 100644 index 91418990b19..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/NotinstrumentedTest.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// This test should not be instrumented. -#include <cstddef> -#include <cstdint> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/NthRunCrashTest.cpp b/gnu/llvm/lib/Fuzzer/test/NthRunCrashTest.cpp deleted file mode 100644 index b43e69e51b2..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/NthRunCrashTest.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Crash on the N-th execution. -#include <cstdint> -#include <cstddef> -#include <iostream> - -static int Counter; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Counter++ == 1000) { - std::cout << "BINGO; Found the target, exiting\n"; - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/NullDerefOnEmptyTest.cpp b/gnu/llvm/lib/Fuzzer/test/NullDerefOnEmptyTest.cpp deleted file mode 100644 index 153710920a5..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/NullDerefOnEmptyTest.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find the empty string. -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int *Null = 0; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size == 0) { - std::cout << "Found the target, dereferencing NULL\n"; - *Null = 1; - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/NullDerefTest.cpp b/gnu/llvm/lib/Fuzzer/test/NullDerefTest.cpp deleted file mode 100644 index 200c56ccbbc..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/NullDerefTest.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; -static volatile int *Null = 0; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - std::cout << "Found the target, dereferencing NULL\n"; - *Null = 1; - } - } - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/OneHugeAllocTest.cpp b/gnu/llvm/lib/Fuzzer/test/OneHugeAllocTest.cpp deleted file mode 100644 index 617fa20fa2e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/OneHugeAllocTest.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Tests OOM handling when there is a single large allocation. -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstring> -#include <iostream> -#include <unistd.h> - -static volatile char *SinkPtr; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - if (Size > 1 && Data[1] == 'i') { - if (Size > 2 && Data[2] == '!') { - size_t kSize = (size_t)1 << 31; - char *p = new char[kSize]; - memset(p, 0, kSize); - SinkPtr = p; - delete [] p; - } - } - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp b/gnu/llvm/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp deleted file mode 100644 index ea23a601aa2..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Tests OOM handling. -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstring> -#include <iostream> - -static volatile char *SinkPtr; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - if (Size > 1 && Data[1] == 'i') { - if (Size > 2 && Data[2] == '!') { - size_t kSize = 0xff000000U; - char *p = new char[kSize]; - SinkPtr = p; - delete [] p; - } - } - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/OutOfMemoryTest.cpp b/gnu/llvm/lib/Fuzzer/test/OutOfMemoryTest.cpp deleted file mode 100644 index e5c9f0a038f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/OutOfMemoryTest.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Tests OOM handling. -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstring> -#include <iostream> -#include <unistd.h> - -static volatile char *SinkPtr; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - if (Size > 1 && Data[1] == 'i') { - if (Size > 2 && Data[2] == '!') { - while (true) { - size_t kSize = 1 << 28; - char *p = new char[kSize]; - memset(p, 0, kSize); - SinkPtr = p; - sleep(1); - } - } - } - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/OverwriteInputTest.cpp b/gnu/llvm/lib/Fuzzer/test/OverwriteInputTest.cpp deleted file mode 100644 index e688682346a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/OverwriteInputTest.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. Make sure we abort if Data is overwritten. -#include <cstdint> -#include <iostream> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size) - *const_cast<uint8_t*>(Data) = 1; - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/RepeatedBytesTest.cpp b/gnu/llvm/lib/Fuzzer/test/RepeatedBytesTest.cpp deleted file mode 100644 index 2fa6c78c26d..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/RepeatedBytesTest.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find repeated bytes. -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - assert(Data); - // Looking for AAAAAAAAAAAAAAAAAAAAAA or some such. - size_t CurA = 0, MaxA = 0; - for (size_t i = 0; i < Size; i++) { - // Make sure there are no conditionals in the loop so that - // coverage can't help the fuzzer. - int EQ = Data[i] == 'A'; - CurA = EQ * (CurA + 1); - int GT = CurA > MaxA; - MaxA = GT * CurA + (!GT) * MaxA; - } - if (MaxA >= 20) { - std::cout << "BINGO; Found the target (Max: " << MaxA << "), exiting\n"; - exit(0); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/RepeatedMemcmp.cpp b/gnu/llvm/lib/Fuzzer/test/RepeatedMemcmp.cpp deleted file mode 100644 index a327bbee781..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/RepeatedMemcmp.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - - -#include <cstring> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - int Matches = 0; - for (size_t i = 0; i + 2 < Size; i += 3) { - const char *Pat = i % 2 ? "foo" : "bar"; - if (!memcmp(Data + i, Pat, 3)) - Matches++; - } - if (Matches > 20) { - fprintf(stderr, "BINGO!\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/ShrinkControlFlowSimpleTest.cpp b/gnu/llvm/lib/Fuzzer/test/ShrinkControlFlowSimpleTest.cpp deleted file mode 100644 index 0afd26df23a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/ShrinkControlFlowSimpleTest.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test that we can find the minimal item in the corpus (3 bytes: "FUZ"). -#include <cstddef> -#include <cstdint> -#include <cstdio> -#include <cstdlib> -#include <cstring> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 2) return 0; - if (Data[0] == 'F' && Data[Size / 2] == 'U' && Data[Size - 1] == 'Z') - Sink++; - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp b/gnu/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp deleted file mode 100644 index 0fd7c5e9a1f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test that we can find the minimal item in the corpus (3 bytes: "FUZ"). -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstring> -#include <cstdio> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - int8_t Ids[256]; - memset(Ids, -1, sizeof(Ids)); - for (size_t i = 0; i < Size; i++) - if (Ids[Data[i]] == -1) - Ids[Data[i]] = i; - int F = Ids[(unsigned char)'F']; - int U = Ids[(unsigned char)'U']; - int Z = Ids[(unsigned char)'Z']; - if (F >= 0 && U > F && Z > U) { - Sink++; - //fprintf(stderr, "IDS: %d %d %d\n", F, U, Z); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/ShrinkValueProfileTest.cpp b/gnu/llvm/lib/Fuzzer/test/ShrinkValueProfileTest.cpp deleted file mode 100644 index 026b8ce2659..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/ShrinkValueProfileTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test that we can find the minimal item in the corpus (3 bytes: "FUZ"). -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstring> -#include <cstdio> - -static volatile uint32_t Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < sizeof(uint32_t)) return 0; - uint32_t X, Y; - size_t Offset = Size < 8 ? 0 : Size / 2; - memcpy(&X, Data + Offset, sizeof(uint32_t)); - memcpy(&Y, "FUZZ", sizeof(uint32_t)); - Sink = X == Y; - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/SignedIntOverflowTest.cpp b/gnu/llvm/lib/Fuzzer/test/SignedIntOverflowTest.cpp deleted file mode 100644 index 7df32ad5793..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SignedIntOverflowTest.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test for signed-integer-overflow. -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> -#include <climits> - -static volatile int Sink; -static int Large = INT_MAX; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - assert(Data); - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - Large++; // int overflow. - } - } - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp deleted file mode 100644 index 8568c737efb..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find several narrow ranges. -#include <cstdint> -#include <cstdlib> -#include <cstring> -#include <cstdio> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 14) return 0; - uint64_t x = 0; - int64_t y = 0; - int z = 0; - unsigned short a = 0; - memcpy(&x, Data, 8); - memcpy(&y, Data + Size - 8, 8); - memcpy(&z, Data + Size / 2, sizeof(z)); - memcpy(&a, Data + Size / 2 + 4, sizeof(a)); - - if (x > 1234567890 && - x < 1234567895 && - y >= 987654321 && - y <= 987654325 && - z < -10000 && - z >= -10005 && - z != -10003 && - a == 4242) { - fprintf(stderr, "BINGO; Found the target: size %zd (%zd, %zd, %d, %d), exiting.\n", - Size, x, y, z, a); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/SimpleDictionaryTest.cpp b/gnu/llvm/lib/Fuzzer/test/SimpleDictionaryTest.cpp deleted file mode 100644 index b9cb2f0270a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SimpleDictionaryTest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Simple test for a fuzzer. -// The fuzzer must find a string based on dictionary words: -// "Elvis" -// "Presley" -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <cstring> -#include <iostream> - -static volatile int Zero = 0; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - const char *Expected = "ElvisPresley"; - if (Size < strlen(Expected)) return 0; - size_t Match = 0; - for (size_t i = 0; Expected[i]; i++) - if (Expected[i] + Zero == Data[i]) - Match++; - if (Match == strlen(Expected)) { - std::cout << "BINGO; Found the target, exiting\n"; - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/SimpleHashTest.cpp b/gnu/llvm/lib/Fuzzer/test/SimpleHashTest.cpp deleted file mode 100644 index 5bab3fa7f64..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SimpleHashTest.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// This test computes a checksum of the data (all but the last 4 bytes), -// and then compares the last 4 bytes with the computed value. -// A fuzzer with cmp traces is expected to defeat this check. -#include <cstdint> -#include <cstdlib> -#include <cstring> -#include <cstdio> - -// A modified jenkins_one_at_a_time_hash initialized by non-zero, -// so that simple_hash(0) != 0. See also -// https://en.wikipedia.org/wiki/Jenkins_hash_function -static uint32_t simple_hash(const uint8_t *Data, size_t Size) { - uint32_t Hash = 0x12039854; - for (uint32_t i = 0; i < Size; i++) { - Hash += Data[i]; - Hash += (Hash << 10); - Hash ^= (Hash >> 6); - } - Hash += (Hash << 3); - Hash ^= (Hash >> 11); - Hash += (Hash << 15); - return Hash; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 14) - return 0; - - uint32_t Hash = simple_hash(&Data[0], Size - 4); - uint32_t Want = reinterpret_cast<const uint32_t *>(&Data[Size - 4])[0]; - if (Hash != Want) - return 0; - fprintf(stderr, "BINGO; simple_hash defeated: %x == %x\n", (unsigned int)Hash, - (unsigned int)Want); - exit(1); - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/SimpleTest.cpp b/gnu/llvm/lib/Fuzzer/test/SimpleTest.cpp deleted file mode 100644 index 04225a889f5..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SimpleTest.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - assert(Data); - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - std::cout << "BINGO; Found the target, exiting\n"; - exit(0); - } - } - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/SimpleThreadedTest.cpp b/gnu/llvm/lib/Fuzzer/test/SimpleThreadedTest.cpp deleted file mode 100644 index 5f02d3f8457..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SimpleThreadedTest.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Threaded test for a fuzzer. The fuzzer should find "H" -#include <assert.h> -#include <cstdint> -#include <cstddef> -#include <cstring> -#include <iostream> -#include <thread> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - auto C = [&] { - if (Size >= 2 && Data[0] == 'H') { - std::cout << "BINGO; Found the target, exiting\n"; - abort(); - } - }; - std::thread T[] = {std::thread(C), std::thread(C), std::thread(C), - std::thread(C), std::thread(C), std::thread(C)}; - for (auto &X : T) - X.join(); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/SingleByteInputTest.cpp b/gnu/llvm/lib/Fuzzer/test/SingleByteInputTest.cpp deleted file mode 100644 index 72b58ba912e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SingleByteInputTest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer, need just one byte to crash. -#include <cstddef> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[Size/2] == 42) { - fprintf(stderr, "BINGO\n"); - abort(); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp deleted file mode 100644 index c73f68a7ee6..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find a particular string. -#include <cstring> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - char *S = (char*)Data; - if (Size >= 6 && !memcmp(S, "qwerty", 6)) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/SingleStrcmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/SingleStrcmpTest.cpp deleted file mode 100644 index 73470b527ee..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SingleStrcmpTest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find a particular string. -#include <cstring> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - char *S = (char*)Data; - if (Size >= 7 && !strcmp(S, "qwerty")) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp deleted file mode 100644 index dbcc464b0a7..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find a particular string. -#include <cstring> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - char *S = (char*)Data; - if (Size >= 6 && !strncmp(S, "qwerty", 6)) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/SpamyTest.cpp b/gnu/llvm/lib/Fuzzer/test/SpamyTest.cpp deleted file mode 100644 index d294d4dc53e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SpamyTest.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// The test spams to stderr and stdout. -#include <assert.h> -#include <cstdint> -#include <cstdio> -#include <cstddef> -#include <iostream> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - assert(Data); - printf("PRINTF_STDOUT\n"); - fflush(stdout); - fprintf(stderr, "PRINTF_STDERR\n"); - std::cout << "STREAM_COUT\n"; - std::cout.flush(); - std::cerr << "STREAM_CERR\n"; - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/StrcmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/StrcmpTest.cpp deleted file mode 100644 index 835819ae2f4..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/StrcmpTest.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Break through a series of strcmp. -#include <cstring> -#include <cstdint> -#include <cstdio> -#include <cstdlib> -#include <cassert> - -bool Eq(const uint8_t *Data, size_t Size, const char *Str) { - char Buff[1024]; - size_t Len = strlen(Str); - if (Size < Len) return false; - if (Len >= sizeof(Buff)) return false; - memcpy(Buff, (char*)Data, Len); - Buff[Len] = 0; - int res = strcmp(Buff, Str); - return res == 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Eq(Data, Size, "AAA") && - Size >= 3 && Eq(Data + 3, Size - 3, "BBBB") && - Size >= 7 && Eq(Data + 7, Size - 7, "CCCCCC") && - Size >= 14 && Data[13] == 42 - ) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/StrncmpOOBTest.cpp b/gnu/llvm/lib/Fuzzer/test/StrncmpOOBTest.cpp deleted file mode 100644 index f70b003afad..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/StrncmpOOBTest.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test that libFuzzer itself does not read out of bounds. -#include <assert.h> -#include <cstdint> -#include <cstring> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 5) return 0; - const char *Ch = reinterpret_cast<const char *>(Data); - if (Ch[Size - 3] == 'a') - Sink = strncmp(Ch + Size - 3, "abcdefg", 6); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/StrncmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/StrncmpTest.cpp deleted file mode 100644 index 55344d75e0b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/StrncmpTest.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find a particular string. -#include <cstring> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -static volatile int sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - // TODO: check other sizes. - char *S = (char*)Data; - if (Size >= 8 && strncmp(S, "123", 8)) - sink = 1; - if (Size >= 8 && strncmp(S, "01234567", 8) == 0) { - if (Size >= 12 && strncmp(S + 8, "ABCD", 4) == 0) { - if (Size >= 14 && strncmp(S + 12, "XY", 2) == 0) { - if (Size >= 16 && strncmp(S + 14, "KLM", 3) == 0) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - } - } - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/StrstrTest.cpp b/gnu/llvm/lib/Fuzzer/test/StrstrTest.cpp deleted file mode 100644 index 90d539b660a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/StrstrTest.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Test strstr and strcasestr hooks. -#include <string> -#include <string.h> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - std::string s(reinterpret_cast<const char*>(Data), Size); - if (strstr(s.c_str(), "FUZZ") && strcasestr(s.c_str(), "aBcD")) { - fprintf(stderr, "BINGO\n"); - exit(1); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/SwapCmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/SwapCmpTest.cpp deleted file mode 100644 index f79db4ccf71..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SwapCmpTest.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// The fuzzer must find several constants with swapped bytes. -#include <cstdint> -#include <cstdlib> -#include <cstring> -#include <cstdio> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 14) return 0; - uint64_t x = 0; - uint32_t y = 0; - uint16_t z = 0; - memcpy(&x, Data, sizeof(x)); - memcpy(&y, Data + Size / 2, sizeof(y)); - memcpy(&z, Data + Size - sizeof(z), sizeof(z)); - - x = __builtin_bswap64(x); - y = __builtin_bswap32(y); - z = __builtin_bswap16(z); - - if (x == 0x46555A5A5A5A5546ULL && - z == 0x4F4B && - y == 0x66757A7A && - true - ) { - if (Data[Size - 3] == 'z') { - fprintf(stderr, "BINGO; Found the target\n"); - exit(1); - } - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/Switch2Test.cpp b/gnu/llvm/lib/Fuzzer/test/Switch2Test.cpp deleted file mode 100644 index 3c6a3004907..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/Switch2Test.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find the interesting switch value. -#include <cstdint> -#include <cstdlib> -#include <cstdio> -#include <cstring> -#include <cstddef> - -int Switch(int a) { - switch(a) { - case 100001: return 1; - case 100002: return 2; - case 100003: return 4; - } - return 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - const int N = 3; - if (Size < N * sizeof(int)) return 0; - int Res = 0; - for (int i = 0; i < N; i++) { - int X; - memcpy(&X, Data + i * sizeof(int), sizeof(int)); - Res += Switch(X); - } - if (Res == 5 || Res == 3 || Res == 6 || Res == 7) { - fprintf(stderr, "BINGO; Found the target, exiting; Res=%d\n", Res); - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/SwitchTest.cpp b/gnu/llvm/lib/Fuzzer/test/SwitchTest.cpp deleted file mode 100644 index 5de7fff7452..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/SwitchTest.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the interesting switch value. -#include <cstdint> -#include <cstdlib> -#include <cstdio> -#include <cstring> -#include <cstddef> - -static volatile int Sink; - -template<class T> -bool Switch(const uint8_t *Data, size_t Size) { - T X; - if (Size < sizeof(X)) return false; - memcpy(&X, Data, sizeof(X)); - switch (X) { - case 1: Sink = __LINE__; break; - case 101: Sink = __LINE__; break; - case 1001: Sink = __LINE__; break; - case 10001: Sink = __LINE__; break; - case 100001: Sink = __LINE__; break; - case 1000001: Sink = __LINE__; break; - case 10000001: Sink = __LINE__; break; - case 100000001: return true; - } - return false; -} - -bool ShortSwitch(const uint8_t *Data, size_t Size) { - short X; - if (Size < sizeof(short)) return false; - memcpy(&X, Data, sizeof(short)); - switch(X) { - case 42: Sink = __LINE__; break; - case 402: Sink = __LINE__; break; - case 4002: Sink = __LINE__; break; - case 5002: Sink = __LINE__; break; - case 7002: Sink = __LINE__; break; - case 9002: Sink = __LINE__; break; - case 14002: Sink = __LINE__; break; - case 21402: return true; - } - return false; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size >= 4 && Switch<int>(Data, Size) && - Size >= 12 && Switch<uint64_t>(Data + 4, Size - 4) && - Size >= 14 && ShortSwitch(Data + 12, 2) - ) { - fprintf(stderr, "BINGO; Found the target, exiting\n"); - exit(1); - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/TableLookupTest.cpp b/gnu/llvm/lib/Fuzzer/test/TableLookupTest.cpp deleted file mode 100644 index 4d8ab0611cd..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/TableLookupTest.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Make sure the fuzzer eventually finds all possible values of a variable -// within a range. -#include <cassert> -#include <cstdint> -#include <cstdio> -#include <cstdlib> -#include <cstring> -#include <set> - -const size_t N = 1 << 12; - -// Define an array of counters that will be understood by libFuzzer -// as extra coverage signal. The array must be: -// * uint8_t -// * in the section named __libfuzzer_extra_counters. -// The target code may declare more than one such array. -// -// Use either `Counters[Idx] = 1` or `Counters[Idx]++;` -// depending on whether multiple occurrences of the event 'Idx' -// is important to distinguish from one occurrence. -#ifdef __linux__ -__attribute__((section("__libfuzzer_extra_counters"))) -#endif -static uint8_t Counters[N]; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - static std::set<uint16_t> SeenIdx; - if (Size != 4) return 0; - uint32_t Idx; - memcpy(&Idx, Data, 4); - Idx %= N; - assert(Counters[Idx] == 0); // libFuzzer should reset these between the runs. - // Or Counters[Idx]=1 if we don't care how many times this happened. - Counters[Idx]++; - SeenIdx.insert(Idx); - if (SeenIdx.size() == N) { - fprintf(stderr, "BINGO: found all values\n"); - abort(); - } - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/ThreadedLeakTest.cpp b/gnu/llvm/lib/Fuzzer/test/ThreadedLeakTest.cpp deleted file mode 100644 index 75110711087..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/ThreadedLeakTest.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// The fuzzer should find a leak in a non-main thread. -#include <cstdint> -#include <cstddef> -#include <thread> - -static volatile int *Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size == 0) return 0; - if (Data[0] != 'F') return 0; - std::thread T([&] { Sink = new int; }); - T.join(); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/ThreadedTest.cpp b/gnu/llvm/lib/Fuzzer/test/ThreadedTest.cpp deleted file mode 100644 index 7aa114a41f3..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/ThreadedTest.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Threaded test for a fuzzer. The fuzzer should not crash. -#include <assert.h> -#include <cstdint> -#include <cstddef> -#include <cstring> -#include <thread> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 8) return 0; - assert(Data); - auto C = [&] { - size_t Res = 0; - for (size_t i = 0; i < Size / 2; i++) - Res += memcmp(Data, Data + Size / 2, 4); - return Res; - }; - std::thread T[] = {std::thread(C), std::thread(C), std::thread(C), - std::thread(C), std::thread(C), std::thread(C)}; - for (auto &X : T) - X.join(); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/TimeoutEmptyTest.cpp b/gnu/llvm/lib/Fuzzer/test/TimeoutEmptyTest.cpp deleted file mode 100644 index 8066f480b65..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/TimeoutEmptyTest.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. The fuzzer must find the empty string. -#include <cstdint> -#include <cstddef> - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - static volatile int Zero = 0; - if (!Size) - while(!Zero) - ; - return 0; -} diff --git a/gnu/llvm/lib/Fuzzer/test/TimeoutTest.cpp b/gnu/llvm/lib/Fuzzer/test/TimeoutTest.cpp deleted file mode 100644 index 71790ded95a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/TimeoutTest.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - Sink = 2; - while (Sink) - ; - } - } - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/TraceMallocTest.cpp b/gnu/llvm/lib/Fuzzer/test/TraceMallocTest.cpp deleted file mode 100644 index 43e6950e185..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/TraceMallocTest.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Tests -trace_malloc -#include <assert.h> -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -int *Ptr; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (!Size) return 0; - if (*Data == 1) { - delete Ptr; - Ptr = nullptr; - } else if (*Data == 2) { - delete Ptr; - Ptr = new int; - } else if (*Data == 3) { - if (!Ptr) - Ptr = new int; - } - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/TwoDifferentBugsTest.cpp b/gnu/llvm/lib/Fuzzer/test/TwoDifferentBugsTest.cpp deleted file mode 100644 index 77d2cb1a25f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/TwoDifferentBugsTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. - -// Simple test for a fuzzer. This test may trigger two different bugs. -#include <cstddef> -#include <cstdint> -#include <cstdlib> -#include <iostream> - -static volatile int *Null = 0; - -void Foo() { Null[1] = 0; } -void Bar() { Null[2] = 0; } - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 10 && Data[0] == 'H') - Foo(); - if (Size >= 10 && Data[0] == 'H') - Bar(); - return 0; -} - diff --git a/gnu/llvm/lib/Fuzzer/test/afl-driver-extra-stats.test b/gnu/llvm/lib/Fuzzer/test/afl-driver-extra-stats.test deleted file mode 100644 index 81e384e7dad..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/afl-driver-extra-stats.test +++ /dev/null @@ -1,28 +0,0 @@ -; Test that not specifying an extra stats file isn't broken. -RUN: unset AFL_DRIVER_EXTRA_STATS_FILENAME -RUN: AFLDriverTest - -; Test that specifying an invalid extra stats file causes a crash. -RUN: ASAN_OPTIONS= AFL_DRIVER_EXTRA_STATS_FILENAME=%T not --crash AFLDriverTest - -; Test that specifying a corrupted stats file causes a crash. -echo "peak_rss_mb :0" > %t -ASAN_OPTIONS= AFL_DRIVER_EXTRA_STATS_FILENAME=%t not --crash AFLDriverTest - -; Test that specifying a valid nonexistent stats file works. -RUN: rm -f %t -RUN: AFL_DRIVER_EXTRA_STATS_FILENAME=%t AFLDriverTest -RUN: [[ $(grep "peak_rss_mb\|slowest_unit_time_sec" %t | wc -l) -eq 2 ]] - -; Test that specifying a valid preexisting stats file works. -RUN: printf "peak_rss_mb : 0\nslowest_unit_time_sec: 0\n" > %t -RUN: AFL_DRIVER_EXTRA_STATS_FILENAME=%t AFLDriverTest -; Check that both lines were printed. -RUN: [[ $(grep "peak_rss_mb\|slowest_unit_time_sec" %t | wc -l) -eq 2 ]] - -; Test that peak_rss_mb and slowest_unit_time_in_secs are only updated when necessary. -; Check that both lines have 9999 since there's no way we have exceeded that -; amount of time or virtual memory. -RUN: printf "peak_rss_mb : 9999\nslowest_unit_time_sec: 9999\n" > %t -RUN: AFL_DRIVER_EXTRA_STATS_FILENAME=%t AFLDriverTest -RUN: [[ $(grep "9999" %t | wc -l) -eq 2 ]] diff --git a/gnu/llvm/lib/Fuzzer/test/afl-driver-stderr.test b/gnu/llvm/lib/Fuzzer/test/afl-driver-stderr.test deleted file mode 100644 index c0f9c8398c2..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/afl-driver-stderr.test +++ /dev/null @@ -1,10 +0,0 @@ -; Test that not specifying a stderr file isn't broken. -RUN: unset AFL_DRIVER_STDERR_DUPLICATE_FILENAME -RUN: AFLDriverTest - -; Test that specifying an invalid file causes a crash. -RUN: ASAN_OPTIONS= AFL_DRIVER_STDERR_DUPLICATE_FILENAME="%T" not --crash AFLDriverTest - -; Test that a file is created when specified as the duplicate stderr. -RUN: AFL_DRIVER_STDERR_DUPLICATE_FILENAME=%t AFLDriverTest -RUN: stat %t diff --git a/gnu/llvm/lib/Fuzzer/test/afl-driver.test b/gnu/llvm/lib/Fuzzer/test/afl-driver.test deleted file mode 100644 index 6eab23cc363..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/afl-driver.test +++ /dev/null @@ -1,26 +0,0 @@ -REQUIRES: linux -RUN: echo -n "abc" > %t.file3 -RUN: echo -n "abcd" > %t.file4 - -RUN: AFLDriverTest < %t.file3 2>&1 | FileCheck %s --check-prefix=CHECK1 -CHECK1: __afl_persistent_loop calle, Count = 1000 -CHECK1: LLVMFuzzerTestOneInput called; Size = 3 - - -RUN: AFLDriverTest < %t.file3 -42 2>&1 | FileCheck %s --check-prefix=CHECK2 -CHECK2: __afl_persistent_loop calle, Count = 42 -CHECK2: LLVMFuzzerTestOneInput called; Size = 3 - - -RUN: AFLDriverTest < %t.file3 666 2>&1 | FileCheck %s --check-prefix=CHECK3 -CHECK3: WARNING: using the deprecated call style -CHECK3: __afl_persistent_loop calle, Count = 666 -CHECK3: LLVMFuzzerTestOneInput called; Size = 3 - - -RUN: AFLDriverTest %t.file3 2>&1 | FileCheck %s --check-prefix=CHECK4 -CHECK4: LLVMFuzzerTestOneInput called; Size = 3 - -RUN: AFLDriverTest %t.file3 %t.file4 2>&1 | FileCheck %s --check-prefix=CHECK5 -CHECK5: LLVMFuzzerTestOneInput called; Size = 3 -CHECK5: LLVMFuzzerTestOneInput called; Size = 4 diff --git a/gnu/llvm/lib/Fuzzer/test/bad-strcmp.test b/gnu/llvm/lib/Fuzzer/test/bad-strcmp.test deleted file mode 100644 index 9a2f3742a5f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/bad-strcmp.test +++ /dev/null @@ -1 +0,0 @@ -RUN: LLVMFuzzer-BadStrcmpTest -runs=100000 diff --git a/gnu/llvm/lib/Fuzzer/test/caller-callee.test b/gnu/llvm/lib/Fuzzer/test/caller-callee.test deleted file mode 100644 index 76a951c5e0e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/caller-callee.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-CallerCalleeTest -use_value_profile=1 -cross_over=0 -max_len=6 -seed=1 -runs=10000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/cleanse.test b/gnu/llvm/lib/Fuzzer/test/cleanse.test deleted file mode 100644 index ad08591d2fa..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/cleanse.test +++ /dev/null @@ -1,3 +0,0 @@ -RUN: echo -n 0123456789ABCDEFGHIZ > %t-in -RUN: LLVMFuzzer-CleanseTest -cleanse_crash=1 %t-in -exact_artifact_path=%t-out -RUN: echo -n ' 1 5 A Z' | diff - %t-out diff --git a/gnu/llvm/lib/Fuzzer/test/coverage.test b/gnu/llvm/lib/Fuzzer/test/coverage.test deleted file mode 100644 index fa11be502ef..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/coverage.test +++ /dev/null @@ -1,19 +0,0 @@ -CHECK: COVERAGE: -CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:13 -CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:14 -CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:16 -CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:19 -CHECK: COVERED_DIRS: {{.*}}lib/Fuzzer/test -RUN: not LLVMFuzzer-NullDerefTest -print_coverage=1 2>&1 | FileCheck %s - -RUN: LLVMFuzzer-DSOTest -print_coverage=1 -runs=0 2>&1 | FileCheck %s --check-prefix=DSO -DSO: COVERAGE: -DSO-DAG: COVERED:{{.*}}DSO1{{.*}}DSO1.cpp -DSO-DAG: COVERED:{{.*}}DSO2{{.*}}DSO2.cpp -DSO-DAG: COVERED:{{.*}}LLVMFuzzerTestOneInput{{.*}}DSOTestMain -DSO-DAG: UNCOVERED_LINE:{{.*}}DSO1{{.*}}DSO1.cpp -DSO-DAG: UNCOVERED_LINE:{{.*}}DSO2{{.*}}DSO2.cpp -DSO-DAG: UNCOVERED_FUNC: in Uncovered1 -DSO-DAG: UNCOVERED_FUNC: in Uncovered2 -DSO-DAG: UNCOVERED_LINE: in LLVMFuzzerTestOneInput -DSO-DAG: UNCOVERED_FILE:{{.*}}DSOTestExtra.cpp diff --git a/gnu/llvm/lib/Fuzzer/test/cxxstring.test b/gnu/llvm/lib/Fuzzer/test/cxxstring.test deleted file mode 100644 index 52168fc8c82..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/cxxstring.test +++ /dev/null @@ -1,4 +0,0 @@ -UNSUPPORTED: windows - -RUN: not LLVMFuzzer-CxxStringEqTest -seed=1 -runs=1000000 2>&1 | FileCheck %s -CHECK: BINGO diff --git a/gnu/llvm/lib/Fuzzer/test/dict1.txt b/gnu/llvm/lib/Fuzzer/test/dict1.txt deleted file mode 100644 index 520d0cc7b7d..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/dict1.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Dictionary for SimpleDictionaryTest - -a="Elvis" -b="Presley" diff --git a/gnu/llvm/lib/Fuzzer/test/disable-leaks.test b/gnu/llvm/lib/Fuzzer/test/disable-leaks.test deleted file mode 100644 index 467b64ccc6f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/disable-leaks.test +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES: lsan -RUN: LLVMFuzzer-AccumulateAllocationsTest -detect_leaks=1 -runs=100000 2>&1 | FileCheck %s --check-prefix=ACCUMULATE_ALLOCS -ACCUMULATE_ALLOCS: INFO: libFuzzer disabled leak detection after every mutation - diff --git a/gnu/llvm/lib/Fuzzer/test/dump_coverage.test b/gnu/llvm/lib/Fuzzer/test/dump_coverage.test deleted file mode 100644 index 9bd98daa361..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/dump_coverage.test +++ /dev/null @@ -1,16 +0,0 @@ -RUN: DIR=%t_workdir -RUN: BUILD_DIR=$(pwd) -RUN: rm -rf $DIR && mkdir -p $DIR && cd $DIR -RUN: not $BUILD_DIR/LLVMFuzzer-NullDerefTest -dump_coverage=1 2>&1 | FileCheck %s -RUN: $BUILD_DIR/LLVMFuzzer-DSOTest -dump_coverage=1 -runs=0 2>&1 | FileCheck %s --check-prefix=DSO -RUN: not $BUILD_DIR/LLVMFuzzer-NullDerefTest -dump_coverage=0 2>&1 | FileCheck %s --check-prefix=NOCOV -RUN: rm -rf $DIR - - -CHECK: SanitizerCoverage: ./LLVMFuzzer-NullDerefTest.{{.*}}.sancov {{.*}} PCs written - -DSO: SanitizerCoverage: ./LLVMFuzzer-DSOTest.{{.*}}.sancov {{.*}} PCs written -DSO-DAG: SanitizerCoverage: ./libLLVMFuzzer-DSO1.{{.*}}.sancov {{.*}} PCs written -DSO-DAG: SanitizerCoverage: ./libLLVMFuzzer-DSO2.{{.*}}.sancov {{.*}} PCs written - -NOCOV-NOT: SanitizerCoverage: {{.*}} PCs written diff --git a/gnu/llvm/lib/Fuzzer/test/equivalence-signals.test b/gnu/llvm/lib/Fuzzer/test/equivalence-signals.test deleted file mode 100644 index 81a7f37602c..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/equivalence-signals.test +++ /dev/null @@ -1,9 +0,0 @@ -REQUIRES: posix -# Run EquivalenceATest against itself with a small timeout -# to stress the signal handling and ensure that shmem doesn't mind -# the signals. - -RUN: LLVMFuzzer-EquivalenceATest -timeout=1 -run_equivalence_server=EQUIV_SIG_TEST & export APID=$! -RUN: sleep 3 -RUN: LLVMFuzzer-EquivalenceATest -timeout=1 -use_equivalence_server=EQUIV_SIG_TEST -runs=500000 2>&1 -RUN: kill -9 $APID diff --git a/gnu/llvm/lib/Fuzzer/test/equivalence.test b/gnu/llvm/lib/Fuzzer/test/equivalence.test deleted file mode 100644 index 015ba855c60..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/equivalence.test +++ /dev/null @@ -1,8 +0,0 @@ -REQUIRES: posix - -RUN: LLVMFuzzer-EquivalenceATest -run_equivalence_server=EQUIV_TEST & export APID=$! -RUN: sleep 3 -RUN: not LLVMFuzzer-EquivalenceBTest -use_equivalence_server=EQUIV_TEST -max_len=4096 2>&1 | FileCheck %s -CHECK: ERROR: libFuzzer: equivalence-mismatch. Sizes: {{.*}}; offset 2 -CHECK: SUMMARY: libFuzzer: equivalence-mismatch -RUN: kill -9 $APID diff --git a/gnu/llvm/lib/Fuzzer/test/extra-counters.test b/gnu/llvm/lib/Fuzzer/test/extra-counters.test deleted file mode 100644 index 61fce44784b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/extra-counters.test +++ /dev/null @@ -1,6 +0,0 @@ -REQUIRES: linux - -RUN: not LLVMFuzzer-TableLookupTest -print_final_stats=1 2>&1 | FileCheck %s -CHECK: BINGO -// Expecting >= 4096 new_units_added -CHECK: stat::new_units_added:{{.*[4][0-9][0-9][0-9]}} diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-customcrossover.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-customcrossover.test deleted file mode 100644 index 4be54d3f799..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-customcrossover.test +++ /dev/null @@ -1,10 +0,0 @@ -RUN: rm -rf %t/CustomCrossover -RUN: mkdir -p %t/CustomCrossover -RUN: echo "0123456789" > %t/CustomCrossover/digits -RUN: echo "abcdefghij" > %t/CustomCrossover/chars -RUN: not LLVMFuzzer-CustomCrossOverTest -seed=1 -use_memcmp=0 -runs=100000 -prune_corpus=0 %t/CustomCrossover 2>&1 | FileCheck %s --check-prefix=LLVMFuzzerCustomCrossover -RUN: rm -rf %t/CustomCrossover - -LLVMFuzzerCustomCrossover: In LLVMFuzzerCustomCrossover -LLVMFuzzerCustomCrossover: BINGO - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-customcrossoverandmutate.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-customcrossoverandmutate.test deleted file mode 100644 index 1e322ec0da6..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-customcrossoverandmutate.test +++ /dev/null @@ -1 +0,0 @@ -RUN: LLVMFuzzer-CustomCrossOverAndMutateTest -seed=1 -runs=100000 diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-custommutator.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-custommutator.test deleted file mode 100644 index fcd740bf545..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-custommutator.test +++ /dev/null @@ -1,4 +0,0 @@ -RUN: not LLVMFuzzer-CustomMutatorTest 2>&1 | FileCheck %s --check-prefix=LLVMFuzzerCustomMutator -LLVMFuzzerCustomMutator: In LLVMFuzzerCustomMutator -LLVMFuzzerCustomMutator: BINGO - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-dict.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-dict.test deleted file mode 100644 index dec002f6a37..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-dict.test +++ /dev/null @@ -1,6 +0,0 @@ -CHECK: BINGO -Done1000000: Done 1000000 runs in - -RUN: not LLVMFuzzer-SimpleDictionaryTest -dict=%S/dict1.txt -seed=1 -runs=1000003 2>&1 | FileCheck %s -RUN: LLVMFuzzer-SimpleDictionaryTest -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=Done1000000 - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-dirs.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-dirs.test deleted file mode 100644 index 3eaaf6b6bb5..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-dirs.test +++ /dev/null @@ -1,12 +0,0 @@ -RUN: rm -rf %t/SUB1 -RUN: mkdir -p %t/SUB1/SUB2/SUB3 -RUN: echo a > %t/SUB1/a -RUN: echo b > %t/SUB1/SUB2/b -RUN: echo c > %t/SUB1/SUB2/SUB3/c -RUN: LLVMFuzzer-SimpleTest %t/SUB1 -runs=0 2>&1 | FileCheck %s --check-prefix=SUBDIRS -SUBDIRS: READ units: 3 -RUN: rm -rf %t/SUB1 - -RUN: not LLVMFuzzer-SimpleTest NONEXISTENT_DIR 2>&1 | FileCheck %s --check-prefix=NONEXISTENT_DIR -NONEXISTENT_DIR: No such directory: NONEXISTENT_DIR; exiting - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-fdmask.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-fdmask.test deleted file mode 100644 index abbc4bd6412..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-fdmask.test +++ /dev/null @@ -1,30 +0,0 @@ -RUN: LLVMFuzzer-SpamyTest -runs=1 2>&1 | FileCheck %s --check-prefix=FD_MASK_0 -RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=0 2>&1 | FileCheck %s --check-prefix=FD_MASK_0 -RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=1 2>&1 | FileCheck %s --check-prefix=FD_MASK_1 -RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=2 2>&1 | FileCheck %s --check-prefix=FD_MASK_2 -RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=3 2>&1 | FileCheck %s --check-prefix=FD_MASK_3 - -FD_MASK_0: PRINTF_STDOUT -FD_MASK_0: PRINTF_STDERR -FD_MASK_0: STREAM_COUT -FD_MASK_0: STREAM_CERR -FD_MASK_0: INITED - -FD_MASK_1-NOT: PRINTF_STDOUT -FD_MASK_1: PRINTF_STDERR -FD_MASK_1-NOT: STREAM_COUT -FD_MASK_1: STREAM_CERR -FD_MASK_1: INITED - -FD_MASK_2: PRINTF_STDOUT -FD_MASK_2-NOT: PRINTF_STDERR -FD_MASK_2: STREAM_COUT -FD_MASK_2-NOTE: STREAM_CERR -FD_MASK_2: INITED - -FD_MASK_3-NOT: PRINTF_STDOUT -FD_MASK_3-NOT: PRINTF_STDERR -FD_MASK_3-NOT: STREAM_COUT -FD_MASK_3-NOT: STREAM_CERR -FD_MASK_3: INITED - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-finalstats.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-finalstats.test deleted file mode 100644 index 1cbcd10f049..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-finalstats.test +++ /dev/null @@ -1,11 +0,0 @@ -RUN: LLVMFuzzer-SimpleTest -seed=1 -runs=77 -print_final_stats=1 2>&1 | FileCheck %s --check-prefix=FINAL_STATS -FINAL_STATS: stat::number_of_executed_units: 77 -FINAL_STATS: stat::average_exec_per_sec: 0 -FINAL_STATS: stat::new_units_added: -FINAL_STATS: stat::slowest_unit_time_sec: 0 -FINAL_STATS: stat::peak_rss_mb: - -RUN: LLVMFuzzer-SimpleTest %S/dict1.txt -runs=33 -print_final_stats=1 2>&1 | FileCheck %s --check-prefix=FINAL_STATS1 -FINAL_STATS1: stat::number_of_executed_units: 33 -FINAL_STATS1: stat::peak_rss_mb: - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-flags.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-flags.test deleted file mode 100644 index a94faf20a58..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-flags.test +++ /dev/null @@ -1,8 +0,0 @@ -RUN: LLVMFuzzer-SimpleTest -foo_bar=1 2>&1 | FileCheck %s --check-prefix=FOO_BAR -FOO_BAR: WARNING: unrecognized flag '-foo_bar=1'; use -help=1 to list all flags -FOO_BAR: BINGO - -RUN: LLVMFuzzer-SimpleTest -runs=10 --max_len=100 2>&1 | FileCheck %s --check-prefix=DASH_DASH -DASH_DASH: WARNING: did you mean '-max_len=100' (single dash)? -DASH_DASH: INFO: A corpus is not provided, starting from an empty corpus - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-leak.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-leak.test deleted file mode 100644 index 59ba02cd7d2..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-leak.test +++ /dev/null @@ -1,31 +0,0 @@ -REQUIRES: lsan -RUN: not LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=1 2>&1 | FileCheck %s --check-prefix=LEAK_DURING -LEAK_DURING: ERROR: LeakSanitizer: detected memory leaks -LEAK_DURING: Direct leak of 4 byte(s) in 1 object(s) allocated from: -LEAK_DURING: INFO: to ignore leaks on libFuzzer side use -detect_leaks=0 -LEAK_DURING: Test unit written to ./leak- -LEAK_DURING-NOT: DONE -LEAK_DURING-NOT: Done - -RUN: not LLVMFuzzer-LeakTest -runs=0 -detect_leaks=1 %S 2>&1 | FileCheck %s --check-prefix=LEAK_IN_CORPUS -LEAK_IN_CORPUS: ERROR: LeakSanitizer: detected memory leaks -LEAK_IN_CORPUS: INFO: a leak has been found in the initial corpus. - - -RUN: not LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER -RUN: not LLVMFuzzer-LeakTest -runs=100000 2>&1 | FileCheck %s --check-prefix=LEAK_DURING -RUN: not LLVMFuzzer-ThreadedLeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER -RUN: not LLVMFuzzer-ThreadedLeakTest -runs=100000 2>&1 | FileCheck %s --check-prefix=LEAK_DURING -LEAK_AFTER: Done 100000 runs in -LEAK_AFTER: ERROR: LeakSanitizer: detected memory leaks - -RUN: not LLVMFuzzer-LeakTest -runs=100000 -max_len=1 2>&1 | FileCheck %s --check-prefix=MAX_LEN_1 -MAX_LEN_1: Test unit written to ./leak-7cf184f4c67ad58283ecb19349720b0cae756829 - -RUN: not LLVMFuzzer-LeakTimeoutTest -timeout=1 2>&1 | FileCheck %s --check-prefix=LEAK_TIMEOUT -LEAK_TIMEOUT: ERROR: libFuzzer: timeout after -LEAK_TIMEOUT-NOT: LeakSanitizer - -RUN: LLVMFuzzer-AccumulateAllocationsTest -detect_leaks=1 -runs=100000 2>&1 | FileCheck %s --check-prefix=ACCUMULATE_ALLOCS -ACCUMULATE_ALLOCS: INFO: libFuzzer disabled leak detection after every mutation - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-oom-with-profile.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-oom-with-profile.test deleted file mode 100644 index 391fd4bb0ff..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-oom-with-profile.test +++ /dev/null @@ -1,6 +0,0 @@ -REQUIRES: linux -RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s -CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb) -CHECK: Live Heap Allocations -CHECK: Test unit written to ./oom- -SUMMARY: libFuzzer: out-of-memory diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-oom.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-oom.test deleted file mode 100644 index 4cdff2142fd..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-oom.test +++ /dev/null @@ -1,4 +0,0 @@ -RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s -CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb) -CHECK: Test unit written to ./oom- -SUMMARY: libFuzzer: out-of-memory diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-printcovpcs.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-printcovpcs.test deleted file mode 100644 index 70b22c7a54b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-printcovpcs.test +++ /dev/null @@ -1,5 +0,0 @@ -RUN: LLVMFuzzer-SimpleTest -print_new_cov_pcs=1 2>&1 | FileCheck %s --check-prefix=PCS -PCS:{{^0x[a-f0-9]+}} -PCS:NEW -PCS:BINGO - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-runs.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-runs.test deleted file mode 100644 index 056c44782a1..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-runs.test +++ /dev/null @@ -1,8 +0,0 @@ -RUN: mkdir -p %t -RUN: echo abcd > %t/NthRunCrashTest.in -RUN: LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in -RUN: LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in -runs=10 -RUN: not LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in -runs=10000 2>&1 | FileCheck %s -RUN: rm %t/NthRunCrashTest.in -CHECK: BINGO - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-seed.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-seed.test deleted file mode 100644 index f1bdf9e4ae9..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-seed.test +++ /dev/null @@ -1,3 +0,0 @@ -RUN: LLVMFuzzer-SimpleCmpTest -seed=-1 -runs=0 2>&1 | FileCheck %s --check-prefix=CHECK_SEED_MINUS_ONE -CHECK_SEED_MINUS_ONE: Seed: 4294967295 - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-segv.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-segv.test deleted file mode 100644 index 330f03bcc49..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-segv.test +++ /dev/null @@ -1,5 +0,0 @@ -RUN: ASAN_OPTIONS=handle_segv=0 not LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=LIBFUZZER_OWN_SEGV_HANDLER -LIBFUZZER_OWN_SEGV_HANDLER: == ERROR: libFuzzer: deadly signal -LIBFUZZER_OWN_SEGV_HANDLER: SUMMARY: libFuzzer: deadly signal -LIBFUZZER_OWN_SEGV_HANDLER: Test unit written to ./crash- - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-singleinputs.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-singleinputs.test deleted file mode 100644 index a4faf2cea50..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-singleinputs.test +++ /dev/null @@ -1,13 +0,0 @@ -RUN: not LLVMFuzzer-NullDerefTest %S/hi.txt 2>&1 | FileCheck %s --check-prefix=SingleInput -SingleInput-NOT: Test unit written to ./crash- - -RUN: rm -rf %tmp/SINGLE_INPUTS -RUN: mkdir -p %tmp/SINGLE_INPUTS -RUN: echo aaa > %tmp/SINGLE_INPUTS/aaa -RUN: echo bbb > %tmp/SINGLE_INPUTS/bbb -RUN: LLVMFuzzer-SimpleTest %tmp/SINGLE_INPUTS/aaa %tmp/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS -RUN: rm -rf %tmp/SINGLE_INPUTS -SINGLE_INPUTS: LLVMFuzzer-SimpleTest: Running 2 inputs 1 time(s) each. -SINGLE_INPUTS: aaa in -SINGLE_INPUTS: bbb in - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-threaded.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-threaded.test deleted file mode 100644 index c58a33456cc..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-threaded.test +++ /dev/null @@ -1,7 +0,0 @@ -CHECK: Done 1000 runs in - -RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s -RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s -RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s -RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-timeout.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-timeout.test deleted file mode 100644 index c3a9e8a3a9e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-timeout.test +++ /dev/null @@ -1,13 +0,0 @@ -RUN: not LLVMFuzzer-TimeoutTest -timeout=1 2>&1 | FileCheck %s --check-prefix=TimeoutTest -TimeoutTest: ALARM: working on the last Unit for -TimeoutTest: Test unit written to ./timeout- -TimeoutTest: == ERROR: libFuzzer: timeout after -TimeoutTest: #0 -TimeoutTest: #1 -TimeoutTest: #2 -TimeoutTest: SUMMARY: libFuzzer: timeout - -RUN: not LLVMFuzzer-TimeoutTest -timeout=1 -test_single_input=%S/hi.txt 2>&1 | FileCheck %s --check-prefix=SingleInputTimeoutTest -SingleInputTimeoutTest: ALARM: working on the last Unit for -SingleInputTimeoutTest-NOT: Test unit written to ./timeout- - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-traces-hooks.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-traces-hooks.test deleted file mode 100644 index 71fe6f2daf1..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-traces-hooks.test +++ /dev/null @@ -1,25 +0,0 @@ -// FIXME: Support sanitizer hooks for memcmp and strcmp need -// to be implemented in the sanitizer runtime for platforms other -// than linux -REQUIRES: linux -CHECK: BINGO -Done1000000: Done 1000000 runs in - -RUN: not LLVMFuzzer-MemcmpTest -seed=4294967295 -runs=100000 2>&1 | FileCheck %s -RUN: LLVMFuzzer-MemcmpTest -use_memcmp=0 -seed=4294967295 -runs=1000000 2>&1 | FileCheck %s --check-prefix=Done1000000 - -RUN: not LLVMFuzzer-StrncmpTest -seed=2 -runs=100000 2>&1 | FileCheck %s -RUN: LLVMFuzzer-StrncmpTest -use_memcmp=0 -seed=3 -runs=1000000 2>&1 | FileCheck %s --check-prefix=Done1000000 - -RUN: not LLVMFuzzer-StrcmpTest -seed=4 -runs=200000 2>&1 | FileCheck %s -RUN: LLVMFuzzer-StrcmpTest -use_memcmp=0 -seed=5 -runs=1000000 2>&1 | FileCheck %s --check-prefix=Done1000000 - -RUN: not LLVMFuzzer-StrstrTest -seed=6 -runs=200000 2>&1 | FileCheck %s -RUN: LLVMFuzzer-StrstrTest -use_memmem=0 -seed=7 -runs=1000000 2>&1 | FileCheck %s --check-prefix=Done1000000 - -RUN: LLVMFuzzer-RepeatedMemcmp -seed=10 -runs=100000 2>&1 | FileCheck %s --check-prefix=RECOMMENDED_DICT -RECOMMENDED_DICT:###### Recommended dictionary. ###### -RECOMMENDED_DICT-DAG: "foo" -RECOMMENDED_DICT-DAG: "bar" -RECOMMENDED_DICT:###### End of recommended dictionary. ###### - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer-ubsan.test b/gnu/llvm/lib/Fuzzer/test/fuzzer-ubsan.test deleted file mode 100644 index 0e8ad6c94a1..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer-ubsan.test +++ /dev/null @@ -1,4 +0,0 @@ -RUN: not LLVMFuzzer-SignedIntOverflowTest-Ubsan 2>&1 | FileCheck %s -CHECK: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' -CHECK: Test unit written to ./crash- - diff --git a/gnu/llvm/lib/Fuzzer/test/fuzzer.test b/gnu/llvm/lib/Fuzzer/test/fuzzer.test deleted file mode 100644 index c63014f59d6..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/fuzzer.test +++ /dev/null @@ -1,36 +0,0 @@ -CHECK: BINGO -Done1000000: Done 1000000 runs in - -RUN: LLVMFuzzer-SimpleTest 2>&1 | FileCheck %s -RUN: not LLVMFuzzer-NullDerefTest -test_single_input=%S/hi.txt 2>&1 | FileCheck %s --check-prefix=SingleInput -SingleInput-NOT: Test unit written to ./crash- - -RUN: LLVMFuzzer-SimpleCmpTest -max_total_time=1 2>&1 | FileCheck %s --check-prefix=MaxTotalTime -MaxTotalTime: Done {{.*}} runs in {{.}} second(s) - -RUN: not LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest -NullDerefTest: Test unit written to ./crash- -RUN: not LLVMFuzzer-NullDerefTest -artifact_prefix=ZZZ 2>&1 | FileCheck %s --check-prefix=NullDerefTestPrefix -NullDerefTestPrefix: Test unit written to ZZZcrash- -RUN: not LLVMFuzzer-NullDerefTest -artifact_prefix=ZZZ -exact_artifact_path=FOOBAR 2>&1 | FileCheck %s --check-prefix=NullDerefTestExactPath -NullDerefTestExactPath: Test unit written to FOOBAR - -#not LLVMFuzzer-FullCoverageSetTest -timeout=15 -seed=1 -mutate_depth=2 -use_full_coverage_set=1 2>&1 | FileCheck %s - -RUN: not LLVMFuzzer-CounterTest -use_counters=1 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s - -RUN: not LLVMFuzzer-CallerCalleeTest -cross_over=0 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s -# This one is flaky, may actually find the goal even w/o use_indir_calls. -# LLVMFuzzer-CallerCalleeTest -use_indir_calls=0 -cross_over=0 -max_len=6 -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=Done1000000 - - -RUN: not LLVMFuzzer-UserSuppliedFuzzerTest -seed=1 -timeout=15 2>&1 | FileCheck %s - -RUN: not LLVMFuzzer-UninstrumentedTest-Uninstrumented 2>&1 | FileCheck %s --check-prefix=UNINSTRUMENTED -UNINSTRUMENTED: ERROR: __sanitizer_set_death_callback is not defined. Exiting. - -RUN: LLVMFuzzer-SimpleTest -print_new_cov_pcs=1 2>&1 | FileCheck %s --check-prefix=PCS -PCS:{{^0x[a-f0-9]+}} -PCS:NEW -PCS:BINGO - diff --git a/gnu/llvm/lib/Fuzzer/test/hi.txt b/gnu/llvm/lib/Fuzzer/test/hi.txt deleted file mode 100644 index 2f9031f0ec7..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/hi.txt +++ /dev/null @@ -1 +0,0 @@ -Hi!
\ No newline at end of file diff --git a/gnu/llvm/lib/Fuzzer/test/inline-8bit-counters.test b/gnu/llvm/lib/Fuzzer/test/inline-8bit-counters.test deleted file mode 100644 index 8747af81451..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/inline-8bit-counters.test +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES: linux -CHECK: INFO: Loaded 1 modules with {{.*}} inline 8-bit counters -CHECK: BINGO -RUN: LLVMFuzzer-SimpleTest-Inline8bitCounters -runs=1000000 -seed=1 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/inline-8bit-counters/CMakeLists.txt b/gnu/llvm/lib/Fuzzer/test/inline-8bit-counters/CMakeLists.txt deleted file mode 100644 index 088ab04fe6a..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/inline-8bit-counters/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# These tests are instrumented with -fsanitize-coverage=inline-8bit-counters - -set(CMAKE_CXX_FLAGS - "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=trace-pc-guard -fsanitize-coverage=inline-8bit-counters") - -set(Inline8bitCounterTests - SimpleTest - ) - -foreach(Test ${Inline8bitCounterTests}) - add_libfuzzer_test(${Test}-Inline8bitCounters SOURCES ../${Test}.cpp) -endforeach() diff --git a/gnu/llvm/lib/Fuzzer/test/lit.cfg b/gnu/llvm/lib/Fuzzer/test/lit.cfg deleted file mode 100644 index 2140a97668b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/lit.cfg +++ /dev/null @@ -1,15 +0,0 @@ -import lit.formats - -config.name = "LLVMFuzzer" -config.test_format = lit.formats.ShTest(True) -config.suffixes = ['.test'] -config.test_source_root = os.path.dirname(__file__) - -# Tweak PATH to include llvm tools dir and current exec dir. -llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) -if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)): - lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir) -path = os.path.pathsep.join((llvm_tools_dir, config.test_exec_root, - config.environment['PATH'])) -config.environment['PATH'] = path - diff --git a/gnu/llvm/lib/Fuzzer/test/lit.site.cfg.in b/gnu/llvm/lib/Fuzzer/test/lit.site.cfg.in deleted file mode 100644 index e520db8e881..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/lit.site.cfg.in +++ /dev/null @@ -1,3 +0,0 @@ -config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") diff --git a/gnu/llvm/lib/Fuzzer/test/merge-posix.test b/gnu/llvm/lib/Fuzzer/test/merge-posix.test deleted file mode 100644 index 47b90b98679..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/merge-posix.test +++ /dev/null @@ -1,23 +0,0 @@ -REQUIRES: posix - -RUN: rm -rf %tmp/T1 %tmp/T2 -RUN: mkdir -p %tmp/T1 %tmp/T2 - -RUN: echo F..... > %tmp/T1/1 -RUN: echo .U.... > %tmp/T1/2 -RUN: echo ..Z... > %tmp/T1/3 - -RUN: echo .....F > %tmp/T2/1 -RUN: echo ....U. > %tmp/T2/2 -RUN: echo ...Z.. > %tmp/T2/3 -RUN: echo ...Z.. > %tmp/T2/4 -RUN: echo ....E. > %tmp/T2/5 -RUN: echo .....R > %tmp/T2/6 - -# Check that we can report an error if file size exceeded -RUN: (ulimit -f 1; not LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ) -SIGXFSZ: ERROR: libFuzzer: file size exceeded - -# Check that we honor TMPDIR -RUN: TMPDIR=DIR_DOES_NOT_EXIST not LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=TMPDIR -TMPDIR: MERGE-OUTER: failed to write to the control file: DIR_DOES_NOT_EXIST/libFuzzerTemp diff --git a/gnu/llvm/lib/Fuzzer/test/merge-summary.test b/gnu/llvm/lib/Fuzzer/test/merge-summary.test deleted file mode 100644 index df9d62dec63..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/merge-summary.test +++ /dev/null @@ -1,15 +0,0 @@ -RUN: rm -rf %t/T1 %t/T2 -RUN: mkdir -p %t/T0 %t/T1 %t/T2 -RUN: echo ...Z.. > %t/T2/1 -RUN: echo ....E. > %t/T2/2 -RUN: echo .....R > %t/T2/3 -RUN: echo F..... > %t/T2/a -RUN: echo .U.... > %t/T2/b -RUN: echo ..Z... > %t/T2/c - -RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %t/T1 %t/T2 -save_coverage_summary=%t/SUMMARY 2>&1 | FileCheck %s --check-prefix=SAVE_SUMMARY -SAVE_SUMMARY: MERGE-OUTER: writing coverage summary for 6 files to {{.*}}SUMMARY -RUN: rm %t/T1/* -RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %t/T1 %t/T2 -load_coverage_summary=%t/SUMMARY 2>&1 | FileCheck %s --check-prefix=LOAD_SUMMARY -LOAD_SUMMARY: MERGE-OUTER: coverage summary loaded from {{.*}}SUMMAR -LOAD_SUMMARY: MERGE-OUTER: 0 new files with 0 new features added diff --git a/gnu/llvm/lib/Fuzzer/test/merge.test b/gnu/llvm/lib/Fuzzer/test/merge.test deleted file mode 100644 index 57ecc141bbf..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/merge.test +++ /dev/null @@ -1,29 +0,0 @@ -CHECK: BINGO - -RUN: rm -rf %tmp/T1 %tmp/T2 -RUN: mkdir -p %tmp/T1 %tmp/T2 -RUN: echo F..... > %tmp/T1/1 -RUN: echo .U.... > %tmp/T1/2 -RUN: echo ..Z... > %tmp/T1/3 - -# T1 has 3 elements, T2 is empty. -RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK1 -CHECK1: Merge: running the initial corpus {{.*}} of 3 units -CHECK1: Merge: written 0 out of 0 units - -RUN: echo ...Z.. > %tmp/T2/1 -RUN: echo ....E. > %tmp/T2/2 -RUN: echo .....R > %tmp/T2/3 -RUN: echo F..... > %tmp/T2/a -RUN: echo .U.... > %tmp/T2/b -RUN: echo ..Z... > %tmp/T2/c - -# T1 has 3 elements, T2 has 6 elements, only 3 are new. -RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK2 -CHECK2: Merge: running the initial corpus {{.*}} of 3 units -CHECK2: Merge: written 3 out of 6 units - -# Now, T1 has 6 units and T2 has no new interesting units. -RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK3 -CHECK3: Merge: running the initial corpus {{.*}} of 6 units -CHECK3: Merge: written 0 out of 6 units diff --git a/gnu/llvm/lib/Fuzzer/test/minimize_crash.test b/gnu/llvm/lib/Fuzzer/test/minimize_crash.test deleted file mode 100644 index 7e5406598e4..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/minimize_crash.test +++ /dev/null @@ -1,6 +0,0 @@ -RUN: echo 'Hi!rv349f34t3gg' > not_minimal_crash -RUN: LLVMFuzzer-NullDerefTest -minimize_crash=1 not_minimal_crash -max_total_time=2 2>&1 | FileCheck %s -CHECK: CRASH_MIN: failed to minimize beyond minimized-from-{{.*}} (3 bytes), exiting -RUN: LLVMFuzzer-NullDerefTest -minimize_crash=1 not_minimal_crash -max_total_time=2 -exact_artifact_path=exact_minimized_path 2>&1 | FileCheck %s --check-prefix=CHECK_EXACT -CHECK_EXACT: CRASH_MIN: failed to minimize beyond exact_minimized_path (3 bytes), exiting -RUN: rm not_minimal_crash minimized-from-* exact_minimized_path diff --git a/gnu/llvm/lib/Fuzzer/test/minimize_two_crashes.test b/gnu/llvm/lib/Fuzzer/test/minimize_two_crashes.test deleted file mode 100644 index 2358d8c2a92..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/minimize_two_crashes.test +++ /dev/null @@ -1,16 +0,0 @@ -# Test that the minimizer stops when it sees a differe bug. - -RUN: rm -rf %t && mkdir %t -RUN: echo H12345678901234667888090 > %t/long_crash -RUN: env ASAN_OPTIONS=dedup_token_length=3 LLVMFuzzer-TwoDifferentBugsTest -seed=1 -minimize_crash=1 %t/long_crash -exact_artifact_path=%t/result 2>&1 | FileCheck %s - -CHECK: DedupToken1: DEDUP_TOKEN: Bar -CHECK: DedupToken2: DEDUP_TOKEN: Bar -CHECK: DedupToken1: DEDUP_TOKEN: Bar -CHECK: DedupToken2: DEDUP_TOKEN: Foo -CHECK: CRASH_MIN: mismatch in dedup tokens - -RUN: not LLVMFuzzer-TwoDifferentBugsTest %t/result 2>&1 | FileCheck %s --check-prefix=VERIFY - -VERIFY: ERROR: AddressSanitizer: -VERIFY: in Bar diff --git a/gnu/llvm/lib/Fuzzer/test/no-coverage/CMakeLists.txt b/gnu/llvm/lib/Fuzzer/test/no-coverage/CMakeLists.txt deleted file mode 100644 index 1dc7d15926c..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/no-coverage/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# These tests are not instrumented with coverage, -# but have coverage rt in the binary. - -set(CMAKE_CXX_FLAGS - "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters") - -set(NoCoverageTests - UninstrumentedTest - ) - -foreach(Test ${NoCoverageTests}) - add_libfuzzer_test(${Test}-NoCoverage SOURCES ../${Test}.cpp) -endforeach() - -# Propagate value into parent directory -set(TestBinaries ${TestBinaries} PARENT_SCOPE) diff --git a/gnu/llvm/lib/Fuzzer/test/overwrite-input.test b/gnu/llvm/lib/Fuzzer/test/overwrite-input.test deleted file mode 100644 index 81c27909e8d..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/overwrite-input.test +++ /dev/null @@ -1,2 +0,0 @@ -RUN: not LLVMFuzzer-OverwriteInputTest 2>&1 | FileCheck %s -CHECK: ERROR: libFuzzer: fuzz target overwrites it's const input diff --git a/gnu/llvm/lib/Fuzzer/test/reduce_inputs.test b/gnu/llvm/lib/Fuzzer/test/reduce_inputs.test deleted file mode 100644 index 5ce4440788f..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/reduce_inputs.test +++ /dev/null @@ -1,14 +0,0 @@ -# Test -reduce_inputs=1 - -RUN: rm -rf %t/C -RUN: mkdir -p %t/C -RUN: LLVMFuzzer-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -reduce_inputs=1 -runs=1000000 %t/C 2>&1 | FileCheck %s -CHECK: INFO: found item with checksum '0eb8e4ed029b774d80f2b66408203801cb982a60' - -# Test that reduce_inputs deletes redundant files in the corpus. -RUN: LLVMFuzzer-ShrinkControlFlowSimpleTest -runs=0 %t/C 2>&1 | FileCheck %s --check-prefix=COUNT -COUNT: READ units: 3 - -# a bit longer test -RUN: LLVMFuzzer-ShrinkControlFlowTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -seed=1 -reduce_inputs=1 -runs=1000000 2>&1 | FileCheck %s - diff --git a/gnu/llvm/lib/Fuzzer/test/repeated-bytes.test b/gnu/llvm/lib/Fuzzer/test/repeated-bytes.test deleted file mode 100644 index 71394087939..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/repeated-bytes.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: LLVMFuzzer-RepeatedBytesTest -seed=1 -runs=1000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/shrink.test b/gnu/llvm/lib/Fuzzer/test/shrink.test deleted file mode 100644 index edb86cb1938..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/shrink.test +++ /dev/null @@ -1,7 +0,0 @@ -RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=1 2>&1 | FileCheck %s --check-prefix=SHRINK1 -RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=0 2>&1 | FileCheck %s --check-prefix=SHRINK0 -RUN: LLVMFuzzer-ShrinkValueProfileTest -seed=1 -exit_on_item=aea2e3923af219a8956f626558ef32f30a914ebc -runs=100000 -shrink=1 -use_value_profile=1 2>&1 | FileCheck %s --check-prefix=SHRINK1_VP - -SHRINK0: Done 1000000 runs in -SHRINK1: INFO: found item with checksum '0eb8e4ed029b774d80f2b66408203801cb982a60', exiting. -SHRINK1_VP: INFO: found item with checksum 'aea2e3923af219a8956f626558ef32f30a914ebc', exiting diff --git a/gnu/llvm/lib/Fuzzer/test/simple-cmp.test b/gnu/llvm/lib/Fuzzer/test/simple-cmp.test deleted file mode 100644 index 145a036652e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/simple-cmp.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SimpleCmpTest -seed=1 -runs=100000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/standalone.test b/gnu/llvm/lib/Fuzzer/test/standalone.test deleted file mode 100644 index 3097b3ff357..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/standalone.test +++ /dev/null @@ -1,4 +0,0 @@ -RUN: LLVMFuzzer-StandaloneInitializeTest %S/hi.txt %S/dict1.txt 2>&1 | FileCheck %s -CHECK: StandaloneFuzzTargetMain: running 2 inputs -CHECK: Done: {{.*}}hi.txt: (3 bytes) -CHECK: Done: {{.*}}dict1.txt: (61 bytes) diff --git a/gnu/llvm/lib/Fuzzer/test/swap-cmp.test b/gnu/llvm/lib/Fuzzer/test/swap-cmp.test deleted file mode 100644 index 908b798664b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/swap-cmp.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SwapCmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/trace-malloc-2.test b/gnu/llvm/lib/Fuzzer/test/trace-malloc-2.test deleted file mode 100644 index 7719b650c79..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/trace-malloc-2.test +++ /dev/null @@ -1,8 +0,0 @@ -// FIXME: This test infinite loops on darwin because it crashes -// printing a stack trace repeatedly -UNSUPPORTED: darwin - -RUN: LLVMFuzzer-TraceMallocTest -seed=1 -trace_malloc=2 -runs=1000 2>&1 | FileCheck %s --check-prefix=TRACE2 -TRACE2-DAG: FREE[0] -TRACE2-DAG: MALLOC[0] -TRACE2-DAG: in LLVMFuzzerTestOneInput diff --git a/gnu/llvm/lib/Fuzzer/test/trace-malloc.test b/gnu/llvm/lib/Fuzzer/test/trace-malloc.test deleted file mode 100644 index c95147904d4..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/trace-malloc.test +++ /dev/null @@ -1,10 +0,0 @@ -RUN: LLVMFuzzer-TraceMallocTest -seed=1 -trace_malloc=1 -runs=10000 2>&1 | FileCheck %s -CHECK-DAG: MallocFreeTracer: STOP 0 0 (same) -CHECK-DAG: MallocFreeTracer: STOP 0 1 (DIFFERENT) -CHECK-DAG: MallocFreeTracer: STOP 1 0 (DIFFERENT) -CHECK-DAG: MallocFreeTracer: STOP 1 1 (same) - -RUN: LLVMFuzzer-TraceMallocTest -seed=1 -trace_malloc=2 -runs=1000 2>&1 | FileCheck %s --check-prefix=TRACE2 -TRACE2-DAG: FREE[0] -TRACE2-DAG: MALLOC[0] -TRACE2-DAG: in LLVMFuzzerTestOneInput diff --git a/gnu/llvm/lib/Fuzzer/test/trace-pc.test b/gnu/llvm/lib/Fuzzer/test/trace-pc.test deleted file mode 100644 index 3709677b71b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/trace-pc.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: LLVMFuzzer-SimpleTest-TracePC -runs=100000 -seed=1 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/ubsan/CMakeLists.txt b/gnu/llvm/lib/Fuzzer/test/ubsan/CMakeLists.txt deleted file mode 100644 index 7a9eacdbe7d..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/ubsan/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# These tests are instrumented with ubsan in non-recovery mode. - -set(CMAKE_CXX_FLAGS - "${LIBFUZZER_FLAGS_BASE} -fsanitize=undefined -fno-sanitize-recover=all") - -set(UbsanTests - SignedIntOverflowTest - ) - -foreach(Test ${UbsanTests}) - add_libfuzzer_test(${Test}-Ubsan SOURCES ../${Test}.cpp) -endforeach() - -# Propagate value into parent directory -set(TestBinaries ${TestBinaries} PARENT_SCOPE) diff --git a/gnu/llvm/lib/Fuzzer/test/ulimit.test b/gnu/llvm/lib/Fuzzer/test/ulimit.test deleted file mode 100644 index a60636c351b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/ulimit.test +++ /dev/null @@ -1,2 +0,0 @@ -RUN: ulimit -s 1000 -RUN: LLVMFuzzer-SimpleTest diff --git a/gnu/llvm/lib/Fuzzer/test/uninstrumented/CMakeLists.txt b/gnu/llvm/lib/Fuzzer/test/uninstrumented/CMakeLists.txt deleted file mode 100644 index 443ba3716f6..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/uninstrumented/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# These tests are not instrumented with coverage. - -set(CMAKE_CXX_FLAGS_RELEASE - "${LIBFUZZER_FLAGS_BASE} -O0 -fno-sanitize=all") - -foreach(Test ${UninstrumentedTests}) - add_executable(LLVMFuzzer-${Test}-Uninstrumented - ../${Test}.cpp - ) - target_link_libraries(LLVMFuzzer-${Test}-Uninstrumented - LLVMFuzzer - ) -endforeach() - diff --git a/gnu/llvm/lib/Fuzzer/test/unit/lit.cfg b/gnu/llvm/lib/Fuzzer/test/unit/lit.cfg deleted file mode 100644 index 0cc31939c55..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/unit/lit.cfg +++ /dev/null @@ -1,7 +0,0 @@ -import lit.formats - -config.name = "LLVMFuzzer-Unittest" -print config.test_exec_root -config.test_format = lit.formats.GoogleTest(".", "Unittest") -config.suffixes = [] -config.test_source_root = config.test_exec_root diff --git a/gnu/llvm/lib/Fuzzer/test/unit/lit.site.cfg.in b/gnu/llvm/lib/Fuzzer/test/unit/lit.site.cfg.in deleted file mode 100644 index 114daf474b6..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/unit/lit.site.cfg.in +++ /dev/null @@ -1,2 +0,0 @@ -config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" -lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/unit/lit.cfg") diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp.test b/gnu/llvm/lib/Fuzzer/test/value-profile-cmp.test deleted file mode 100644 index 48edba4f5ce..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SimpleCmpTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp2.test b/gnu/llvm/lib/Fuzzer/test/value-profile-cmp2.test deleted file mode 100644 index 43d62400d97..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp2.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SimpleHashTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp3.test b/gnu/llvm/lib/Fuzzer/test/value-profile-cmp3.test deleted file mode 100644 index 8a962763f39..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp3.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-AbsNegAndConstantTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp4.test b/gnu/llvm/lib/Fuzzer/test/value-profile-cmp4.test deleted file mode 100644 index 1e7131e5b5b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-cmp4.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-AbsNegAndConstant64Test -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-div.test b/gnu/llvm/lib/Fuzzer/test/value-profile-div.test deleted file mode 100644 index ba45e4129d3..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-div.test +++ /dev/null @@ -1,3 +0,0 @@ -CHECK: AddressSanitizer: FPE -RUN: not LLVMFuzzer-DivTest -seed=1 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s - diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-load.test b/gnu/llvm/lib/Fuzzer/test/value-profile-load.test deleted file mode 100644 index 14d3109a24e..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-load.test +++ /dev/null @@ -1,3 +0,0 @@ -CHECK: AddressSanitizer: global-buffer-overflow -RUN: not LLVMFuzzer-LoadTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s - diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-mem.test b/gnu/llvm/lib/Fuzzer/test/value-profile-mem.test deleted file mode 100644 index 09d737dbe73..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-mem.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SingleMemcmpTest -seed=1 -use_cmp=0 -use_memcmp=0 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-set.test b/gnu/llvm/lib/Fuzzer/test/value-profile-set.test deleted file mode 100644 index 9d06c365633..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-set.test +++ /dev/null @@ -1,3 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-FourIndependentBranchesTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s - diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-strcmp.test b/gnu/llvm/lib/Fuzzer/test/value-profile-strcmp.test deleted file mode 100644 index 1e7ef9b45e9..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-strcmp.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SingleStrcmpTest -seed=1 -use_cmp=0 -use_memcmp=0 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-strncmp.test b/gnu/llvm/lib/Fuzzer/test/value-profile-strncmp.test deleted file mode 100644 index 650973180c0..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-strncmp.test +++ /dev/null @@ -1,2 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SingleStrncmpTest -seed=1 -use_cmp=0 -use_memcmp=0 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/Fuzzer/test/value-profile-switch.test b/gnu/llvm/lib/Fuzzer/test/value-profile-switch.test deleted file mode 100644 index 1947f56830b..00000000000 --- a/gnu/llvm/lib/Fuzzer/test/value-profile-switch.test +++ /dev/null @@ -1,3 +0,0 @@ -CHECK: BINGO -RUN: not LLVMFuzzer-SwitchTest -use_cmp=0 -use_value_profile=1 -runs=100000000 -seed=1 2>&1 | FileCheck %s -RUN: not LLVMFuzzer-Switch2Test -use_cmp=0 -use_value_profile=1 -runs=100000000 -seed=1 2>&1 | FileCheck %s diff --git a/gnu/llvm/lib/IR/GCOV.cpp b/gnu/llvm/lib/IR/GCOV.cpp deleted file mode 100644 index 35b8157751b..00000000000 --- a/gnu/llvm/lib/IR/GCOV.cpp +++ /dev/null @@ -1,796 +0,0 @@ -//===- GCOV.cpp - LLVM coverage tool --------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// GCOV implements the interface to read and write coverage files that use -// 'gcov' format. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/GCOV.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/Format.h" -#include "llvm/Support/MemoryObject.h" -#include "llvm/Support/Path.h" -#include "llvm/Support/raw_ostream.h" -#include <algorithm> -#include <system_error> -using namespace llvm; - -//===----------------------------------------------------------------------===// -// GCOVFile implementation. - -/// readGCNO - Read GCNO buffer. -bool GCOVFile::readGCNO(GCOVBuffer &Buffer) { - if (!Buffer.readGCNOFormat()) - return false; - if (!Buffer.readGCOVVersion(Version)) - return false; - - if (!Buffer.readInt(Checksum)) - return false; - while (true) { - if (!Buffer.readFunctionTag()) - break; - auto GFun = make_unique<GCOVFunction>(*this); - if (!GFun->readGCNO(Buffer, Version)) - return false; - Functions.push_back(std::move(GFun)); - } - - GCNOInitialized = true; - return true; -} - -/// readGCDA - Read GCDA buffer. It is required that readGCDA() can only be -/// called after readGCNO(). -bool GCOVFile::readGCDA(GCOVBuffer &Buffer) { - assert(GCNOInitialized && "readGCDA() can only be called after readGCNO()"); - if (!Buffer.readGCDAFormat()) - return false; - GCOV::GCOVVersion GCDAVersion; - if (!Buffer.readGCOVVersion(GCDAVersion)) - return false; - if (Version != GCDAVersion) { - errs() << "GCOV versions do not match.\n"; - return false; - } - - uint32_t GCDAChecksum; - if (!Buffer.readInt(GCDAChecksum)) - return false; - if (Checksum != GCDAChecksum) { - errs() << "File checksums do not match: " << Checksum - << " != " << GCDAChecksum << ".\n"; - return false; - } - for (size_t i = 0, e = Functions.size(); i < e; ++i) { - if (!Buffer.readFunctionTag()) { - errs() << "Unexpected number of functions.\n"; - return false; - } - if (!Functions[i]->readGCDA(Buffer, Version)) - return false; - } - if (Buffer.readObjectTag()) { - uint32_t Length; - uint32_t Dummy; - if (!Buffer.readInt(Length)) - return false; - if (!Buffer.readInt(Dummy)) - return false; // checksum - if (!Buffer.readInt(Dummy)) - return false; // num - if (!Buffer.readInt(RunCount)) - return false; - Buffer.advanceCursor(Length - 3); - } - while (Buffer.readProgramTag()) { - uint32_t Length; - if (!Buffer.readInt(Length)) - return false; - Buffer.advanceCursor(Length); - ++ProgramCount; - } - - return true; -} - -/// dump - Dump GCOVFile content to dbgs() for debugging purposes. -void GCOVFile::dump() const { - for (const auto &FPtr : Functions) - FPtr->dump(); -} - -/// collectLineCounts - Collect line counts. This must be used after -/// reading .gcno and .gcda files. -void GCOVFile::collectLineCounts(FileInfo &FI) { - for (const auto &FPtr : Functions) - FPtr->collectLineCounts(FI); - FI.setRunCount(RunCount); - FI.setProgramCount(ProgramCount); -} - -//===----------------------------------------------------------------------===// -// GCOVFunction implementation. - -/// readGCNO - Read a function from the GCNO buffer. Return false if an error -/// occurs. -bool GCOVFunction::readGCNO(GCOVBuffer &Buff, GCOV::GCOVVersion Version) { - uint32_t Dummy; - if (!Buff.readInt(Dummy)) - return false; // Function header length - if (!Buff.readInt(Ident)) - return false; - if (!Buff.readInt(Checksum)) - return false; - if (Version != GCOV::V402) { - uint32_t CfgChecksum; - if (!Buff.readInt(CfgChecksum)) - return false; - if (Parent.getChecksum() != CfgChecksum) { - errs() << "File checksums do not match: " << Parent.getChecksum() - << " != " << CfgChecksum << " in (" << Name << ").\n"; - return false; - } - } - if (!Buff.readString(Name)) - return false; - if (!Buff.readString(Filename)) - return false; - if (!Buff.readInt(LineNumber)) - return false; - - // read blocks. - if (!Buff.readBlockTag()) { - errs() << "Block tag not found.\n"; - return false; - } - uint32_t BlockCount; - if (!Buff.readInt(BlockCount)) - return false; - for (uint32_t i = 0, e = BlockCount; i != e; ++i) { - if (!Buff.readInt(Dummy)) - return false; // Block flags; - Blocks.push_back(make_unique<GCOVBlock>(*this, i)); - } - - // read edges. - while (Buff.readEdgeTag()) { - uint32_t EdgeCount; - if (!Buff.readInt(EdgeCount)) - return false; - EdgeCount = (EdgeCount - 1) / 2; - uint32_t BlockNo; - if (!Buff.readInt(BlockNo)) - return false; - if (BlockNo >= BlockCount) { - errs() << "Unexpected block number: " << BlockNo << " (in " << Name - << ").\n"; - return false; - } - for (uint32_t i = 0, e = EdgeCount; i != e; ++i) { - uint32_t Dst; - if (!Buff.readInt(Dst)) - return false; - Edges.push_back(make_unique<GCOVEdge>(*Blocks[BlockNo], *Blocks[Dst])); - GCOVEdge *Edge = Edges.back().get(); - Blocks[BlockNo]->addDstEdge(Edge); - Blocks[Dst]->addSrcEdge(Edge); - if (!Buff.readInt(Dummy)) - return false; // Edge flag - } - } - - // read line table. - while (Buff.readLineTag()) { - uint32_t LineTableLength; - // Read the length of this line table. - if (!Buff.readInt(LineTableLength)) - return false; - uint32_t EndPos = Buff.getCursor() + LineTableLength * 4; - uint32_t BlockNo; - // Read the block number this table is associated with. - if (!Buff.readInt(BlockNo)) - return false; - if (BlockNo >= BlockCount) { - errs() << "Unexpected block number: " << BlockNo << " (in " << Name - << ").\n"; - return false; - } - GCOVBlock &Block = *Blocks[BlockNo]; - // Read the word that pads the beginning of the line table. This may be a - // flag of some sort, but seems to always be zero. - if (!Buff.readInt(Dummy)) - return false; - - // Line information starts here and continues up until the last word. - if (Buff.getCursor() != (EndPos - sizeof(uint32_t))) { - StringRef F; - // Read the source file name. - if (!Buff.readString(F)) - return false; - if (Filename != F) { - errs() << "Multiple sources for a single basic block: " << Filename - << " != " << F << " (in " << Name << ").\n"; - return false; - } - // Read lines up to, but not including, the null terminator. - while (Buff.getCursor() < (EndPos - 2 * sizeof(uint32_t))) { - uint32_t Line; - if (!Buff.readInt(Line)) - return false; - // Line 0 means this instruction was injected by the compiler. Skip it. - if (!Line) - continue; - Block.addLine(Line); - } - // Read the null terminator. - if (!Buff.readInt(Dummy)) - return false; - } - // The last word is either a flag or padding, it isn't clear which. Skip - // over it. - if (!Buff.readInt(Dummy)) - return false; - } - return true; -} - -/// readGCDA - Read a function from the GCDA buffer. Return false if an error -/// occurs. -bool GCOVFunction::readGCDA(GCOVBuffer &Buff, GCOV::GCOVVersion Version) { - uint32_t Dummy; - if (!Buff.readInt(Dummy)) - return false; // Function header length - - uint32_t GCDAIdent; - if (!Buff.readInt(GCDAIdent)) - return false; - if (Ident != GCDAIdent) { - errs() << "Function identifiers do not match: " << Ident - << " != " << GCDAIdent << " (in " << Name << ").\n"; - return false; - } - - uint32_t GCDAChecksum; - if (!Buff.readInt(GCDAChecksum)) - return false; - if (Checksum != GCDAChecksum) { - errs() << "Function checksums do not match: " << Checksum - << " != " << GCDAChecksum << " (in " << Name << ").\n"; - return false; - } - - uint32_t CfgChecksum; - if (Version != GCOV::V402) { - if (!Buff.readInt(CfgChecksum)) - return false; - if (Parent.getChecksum() != CfgChecksum) { - errs() << "File checksums do not match: " << Parent.getChecksum() - << " != " << CfgChecksum << " (in " << Name << ").\n"; - return false; - } - } - - StringRef GCDAName; - if (!Buff.readString(GCDAName)) - return false; - if (Name != GCDAName) { - errs() << "Function names do not match: " << Name << " != " << GCDAName - << ".\n"; - return false; - } - - if (!Buff.readArcTag()) { - errs() << "Arc tag not found (in " << Name << ").\n"; - return false; - } - - uint32_t Count; - if (!Buff.readInt(Count)) - return false; - Count /= 2; - - // This for loop adds the counts for each block. A second nested loop is - // required to combine the edge counts that are contained in the GCDA file. - for (uint32_t BlockNo = 0; Count > 0; ++BlockNo) { - // The last block is always reserved for exit block - if (BlockNo >= Blocks.size()) { - errs() << "Unexpected number of edges (in " << Name << ").\n"; - return false; - } - if (BlockNo == Blocks.size() - 1) - errs() << "(" << Name << ") has arcs from exit block.\n"; - GCOVBlock &Block = *Blocks[BlockNo]; - for (size_t EdgeNo = 0, End = Block.getNumDstEdges(); EdgeNo < End; - ++EdgeNo) { - if (Count == 0) { - errs() << "Unexpected number of edges (in " << Name << ").\n"; - return false; - } - uint64_t ArcCount; - if (!Buff.readInt64(ArcCount)) - return false; - Block.addCount(EdgeNo, ArcCount); - --Count; - } - Block.sortDstEdges(); - } - return true; -} - -/// getEntryCount - Get the number of times the function was called by -/// retrieving the entry block's count. -uint64_t GCOVFunction::getEntryCount() const { - return Blocks.front()->getCount(); -} - -/// getExitCount - Get the number of times the function returned by retrieving -/// the exit block's count. -uint64_t GCOVFunction::getExitCount() const { - return Blocks.back()->getCount(); -} - -/// dump - Dump GCOVFunction content to dbgs() for debugging purposes. -void GCOVFunction::dump() const { - dbgs() << "===== " << Name << " (" << Ident << ") @ " << Filename << ":" - << LineNumber << "\n"; - for (const auto &Block : Blocks) - Block->dump(); -} - -/// collectLineCounts - Collect line counts. This must be used after -/// reading .gcno and .gcda files. -void GCOVFunction::collectLineCounts(FileInfo &FI) { - // If the line number is zero, this is a function that doesn't actually appear - // in the source file, so there isn't anything we can do with it. - if (LineNumber == 0) - return; - - for (const auto &Block : Blocks) - Block->collectLineCounts(FI); - FI.addFunctionLine(Filename, LineNumber, this); -} - -//===----------------------------------------------------------------------===// -// GCOVBlock implementation. - -/// ~GCOVBlock - Delete GCOVBlock and its content. -GCOVBlock::~GCOVBlock() { - SrcEdges.clear(); - DstEdges.clear(); - Lines.clear(); -} - -/// addCount - Add to block counter while storing the edge count. If the -/// destination has no outgoing edges, also update that block's count too. -void GCOVBlock::addCount(size_t DstEdgeNo, uint64_t N) { - assert(DstEdgeNo < DstEdges.size()); // up to caller to ensure EdgeNo is valid - DstEdges[DstEdgeNo]->Count = N; - Counter += N; - if (!DstEdges[DstEdgeNo]->Dst.getNumDstEdges()) - DstEdges[DstEdgeNo]->Dst.Counter += N; -} - -/// sortDstEdges - Sort destination edges by block number, nop if already -/// sorted. This is required for printing branch info in the correct order. -void GCOVBlock::sortDstEdges() { - if (!DstEdgesAreSorted) { - SortDstEdgesFunctor SortEdges; - std::stable_sort(DstEdges.begin(), DstEdges.end(), SortEdges); - } -} - -/// collectLineCounts - Collect line counts. This must be used after -/// reading .gcno and .gcda files. -void GCOVBlock::collectLineCounts(FileInfo &FI) { - for (uint32_t N : Lines) - FI.addBlockLine(Parent.getFilename(), N, this); -} - -/// dump - Dump GCOVBlock content to dbgs() for debugging purposes. -void GCOVBlock::dump() const { - dbgs() << "Block : " << Number << " Counter : " << Counter << "\n"; - if (!SrcEdges.empty()) { - dbgs() << "\tSource Edges : "; - for (const GCOVEdge *Edge : SrcEdges) - dbgs() << Edge->Src.Number << " (" << Edge->Count << "), "; - dbgs() << "\n"; - } - if (!DstEdges.empty()) { - dbgs() << "\tDestination Edges : "; - for (const GCOVEdge *Edge : DstEdges) - dbgs() << Edge->Dst.Number << " (" << Edge->Count << "), "; - dbgs() << "\n"; - } - if (!Lines.empty()) { - dbgs() << "\tLines : "; - for (uint32_t N : Lines) - dbgs() << (N) << ","; - dbgs() << "\n"; - } -} - -//===----------------------------------------------------------------------===// -// FileInfo implementation. - -// Safe integer division, returns 0 if numerator is 0. -static uint32_t safeDiv(uint64_t Numerator, uint64_t Divisor) { - if (!Numerator) - return 0; - return Numerator / Divisor; -} - -// This custom division function mimics gcov's branch ouputs: -// - Round to closest whole number -// - Only output 0% or 100% if it's exactly that value -static uint32_t branchDiv(uint64_t Numerator, uint64_t Divisor) { - if (!Numerator) - return 0; - if (Numerator == Divisor) - return 100; - - uint8_t Res = (Numerator * 100 + Divisor / 2) / Divisor; - if (Res == 0) - return 1; - if (Res == 100) - return 99; - return Res; -} - -namespace { -struct formatBranchInfo { - formatBranchInfo(const GCOV::Options &Options, uint64_t Count, uint64_t Total) - : Options(Options), Count(Count), Total(Total) {} - - void print(raw_ostream &OS) const { - if (!Total) - OS << "never executed"; - else if (Options.BranchCount) - OS << "taken " << Count; - else - OS << "taken " << branchDiv(Count, Total) << "%"; - } - - const GCOV::Options &Options; - uint64_t Count; - uint64_t Total; -}; - -static raw_ostream &operator<<(raw_ostream &OS, const formatBranchInfo &FBI) { - FBI.print(OS); - return OS; -} - -class LineConsumer { - std::unique_ptr<MemoryBuffer> Buffer; - StringRef Remaining; - -public: - LineConsumer(StringRef Filename) { - ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr = - MemoryBuffer::getFileOrSTDIN(Filename); - if (std::error_code EC = BufferOrErr.getError()) { - errs() << Filename << ": " << EC.message() << "\n"; - Remaining = ""; - } else { - Buffer = std::move(BufferOrErr.get()); - Remaining = Buffer->getBuffer(); - } - } - bool empty() { return Remaining.empty(); } - void printNext(raw_ostream &OS, uint32_t LineNum) { - StringRef Line; - if (empty()) - Line = "/*EOF*/"; - else - std::tie(Line, Remaining) = Remaining.split("\n"); - OS << format("%5u:", LineNum) << Line << "\n"; - } -}; -} - -/// Convert a path to a gcov filename. If PreservePaths is true, this -/// translates "/" to "#", ".." to "^", and drops ".", to match gcov. -static std::string mangleCoveragePath(StringRef Filename, bool PreservePaths) { - if (!PreservePaths) - return sys::path::filename(Filename).str(); - - // This behaviour is defined by gcov in terms of text replacements, so it's - // not likely to do anything useful on filesystems with different textual - // conventions. - llvm::SmallString<256> Result(""); - StringRef::iterator I, S, E; - for (I = S = Filename.begin(), E = Filename.end(); I != E; ++I) { - if (*I != '/') - continue; - - if (I - S == 1 && *S == '.') { - // ".", the current directory, is skipped. - } else if (I - S == 2 && *S == '.' && *(S + 1) == '.') { - // "..", the parent directory, is replaced with "^". - Result.append("^#"); - } else { - if (S < I) - // Leave other components intact, - Result.append(S, I); - // And separate with "#". - Result.push_back('#'); - } - S = I + 1; - } - - if (S < I) - Result.append(S, I); - return Result.str(); -} - -std::string FileInfo::getCoveragePath(StringRef Filename, - StringRef MainFilename) { - if (Options.NoOutput) - // This is probably a bug in gcov, but when -n is specified, paths aren't - // mangled at all, and the -l and -p options are ignored. Here, we do the - // same. - return Filename; - - std::string CoveragePath; - if (Options.LongFileNames && !Filename.equals(MainFilename)) - CoveragePath = - mangleCoveragePath(MainFilename, Options.PreservePaths) + "##"; - CoveragePath += mangleCoveragePath(Filename, Options.PreservePaths) + ".gcov"; - return CoveragePath; -} - -std::unique_ptr<raw_ostream> -FileInfo::openCoveragePath(StringRef CoveragePath) { - if (Options.NoOutput) - return llvm::make_unique<raw_null_ostream>(); - - std::error_code EC; - auto OS = llvm::make_unique<raw_fd_ostream>(CoveragePath, EC, - sys::fs::F_Text); - if (EC) { - errs() << EC.message() << "\n"; - return llvm::make_unique<raw_null_ostream>(); - } - return std::move(OS); -} - -/// print - Print source files with collected line count information. -void FileInfo::print(raw_ostream &InfoOS, StringRef MainFilename, - StringRef GCNOFile, StringRef GCDAFile) { - for (const auto &LI : LineInfo) { - StringRef Filename = LI.first(); - auto AllLines = LineConsumer(Filename); - - std::string CoveragePath = getCoveragePath(Filename, MainFilename); - std::unique_ptr<raw_ostream> CovStream = openCoveragePath(CoveragePath); - raw_ostream &CovOS = *CovStream; - - CovOS << " -: 0:Source:" << Filename << "\n"; - CovOS << " -: 0:Graph:" << GCNOFile << "\n"; - CovOS << " -: 0:Data:" << GCDAFile << "\n"; - CovOS << " -: 0:Runs:" << RunCount << "\n"; - CovOS << " -: 0:Programs:" << ProgramCount << "\n"; - - const LineData &Line = LI.second; - GCOVCoverage FileCoverage(Filename); - for (uint32_t LineIndex = 0; LineIndex < Line.LastLine || !AllLines.empty(); - ++LineIndex) { - if (Options.BranchInfo) { - FunctionLines::const_iterator FuncsIt = Line.Functions.find(LineIndex); - if (FuncsIt != Line.Functions.end()) - printFunctionSummary(CovOS, FuncsIt->second); - } - - BlockLines::const_iterator BlocksIt = Line.Blocks.find(LineIndex); - if (BlocksIt == Line.Blocks.end()) { - // No basic blocks are on this line. Not an executable line of code. - CovOS << " -:"; - AllLines.printNext(CovOS, LineIndex + 1); - } else { - const BlockVector &Blocks = BlocksIt->second; - - // Add up the block counts to form line counts. - DenseMap<const GCOVFunction *, bool> LineExecs; - uint64_t LineCount = 0; - for (const GCOVBlock *Block : Blocks) { - if (Options.AllBlocks) { - // Only take the highest block count for that line. - uint64_t BlockCount = Block->getCount(); - LineCount = LineCount > BlockCount ? LineCount : BlockCount; - } else { - // Sum up all of the block counts. - LineCount += Block->getCount(); - } - - if (Options.FuncCoverage) { - // This is a slightly convoluted way to most accurately gather line - // statistics for functions. Basically what is happening is that we - // don't want to count a single line with multiple blocks more than - // once. However, we also don't simply want to give the total line - // count to every function that starts on the line. Thus, what is - // happening here are two things: - // 1) Ensure that the number of logical lines is only incremented - // once per function. - // 2) If there are multiple blocks on the same line, ensure that the - // number of lines executed is incremented as long as at least - // one of the blocks are executed. - const GCOVFunction *Function = &Block->getParent(); - if (FuncCoverages.find(Function) == FuncCoverages.end()) { - std::pair<const GCOVFunction *, GCOVCoverage> KeyValue( - Function, GCOVCoverage(Function->getName())); - FuncCoverages.insert(KeyValue); - } - GCOVCoverage &FuncCoverage = FuncCoverages.find(Function)->second; - - if (LineExecs.find(Function) == LineExecs.end()) { - if (Block->getCount()) { - ++FuncCoverage.LinesExec; - LineExecs[Function] = true; - } else { - LineExecs[Function] = false; - } - ++FuncCoverage.LogicalLines; - } else if (!LineExecs[Function] && Block->getCount()) { - ++FuncCoverage.LinesExec; - LineExecs[Function] = true; - } - } - } - - if (LineCount == 0) - CovOS << " #####:"; - else { - CovOS << format("%9" PRIu64 ":", LineCount); - ++FileCoverage.LinesExec; - } - ++FileCoverage.LogicalLines; - - AllLines.printNext(CovOS, LineIndex + 1); - - uint32_t BlockNo = 0; - uint32_t EdgeNo = 0; - for (const GCOVBlock *Block : Blocks) { - // Only print block and branch information at the end of the block. - if (Block->getLastLine() != LineIndex + 1) - continue; - if (Options.AllBlocks) - printBlockInfo(CovOS, *Block, LineIndex, BlockNo); - if (Options.BranchInfo) { - size_t NumEdges = Block->getNumDstEdges(); - if (NumEdges > 1) - printBranchInfo(CovOS, *Block, FileCoverage, EdgeNo); - else if (Options.UncondBranch && NumEdges == 1) - printUncondBranchInfo(CovOS, EdgeNo, - (*Block->dst_begin())->Count); - } - } - } - } - FileCoverages.push_back(std::make_pair(CoveragePath, FileCoverage)); - } - - // FIXME: There is no way to detect calls given current instrumentation. - if (Options.FuncCoverage) - printFuncCoverage(InfoOS); - printFileCoverage(InfoOS); - return; -} - -/// printFunctionSummary - Print function and block summary. -void FileInfo::printFunctionSummary(raw_ostream &OS, - const FunctionVector &Funcs) const { - for (const GCOVFunction *Func : Funcs) { - uint64_t EntryCount = Func->getEntryCount(); - uint32_t BlocksExec = 0; - for (const GCOVBlock &Block : Func->blocks()) - if (Block.getNumDstEdges() && Block.getCount()) - ++BlocksExec; - - OS << "function " << Func->getName() << " called " << EntryCount - << " returned " << safeDiv(Func->getExitCount() * 100, EntryCount) - << "% blocks executed " - << safeDiv(BlocksExec * 100, Func->getNumBlocks() - 1) << "%\n"; - } -} - -/// printBlockInfo - Output counts for each block. -void FileInfo::printBlockInfo(raw_ostream &OS, const GCOVBlock &Block, - uint32_t LineIndex, uint32_t &BlockNo) const { - if (Block.getCount() == 0) - OS << " $$$$$:"; - else - OS << format("%9" PRIu64 ":", Block.getCount()); - OS << format("%5u-block %2u\n", LineIndex + 1, BlockNo++); -} - -/// printBranchInfo - Print conditional branch probabilities. -void FileInfo::printBranchInfo(raw_ostream &OS, const GCOVBlock &Block, - GCOVCoverage &Coverage, uint32_t &EdgeNo) { - SmallVector<uint64_t, 16> BranchCounts; - uint64_t TotalCounts = 0; - for (const GCOVEdge *Edge : Block.dsts()) { - BranchCounts.push_back(Edge->Count); - TotalCounts += Edge->Count; - if (Block.getCount()) - ++Coverage.BranchesExec; - if (Edge->Count) - ++Coverage.BranchesTaken; - ++Coverage.Branches; - - if (Options.FuncCoverage) { - const GCOVFunction *Function = &Block.getParent(); - GCOVCoverage &FuncCoverage = FuncCoverages.find(Function)->second; - if (Block.getCount()) - ++FuncCoverage.BranchesExec; - if (Edge->Count) - ++FuncCoverage.BranchesTaken; - ++FuncCoverage.Branches; - } - } - - for (uint64_t N : BranchCounts) - OS << format("branch %2u ", EdgeNo++) - << formatBranchInfo(Options, N, TotalCounts) << "\n"; -} - -/// printUncondBranchInfo - Print unconditional branch probabilities. -void FileInfo::printUncondBranchInfo(raw_ostream &OS, uint32_t &EdgeNo, - uint64_t Count) const { - OS << format("unconditional %2u ", EdgeNo++) - << formatBranchInfo(Options, Count, Count) << "\n"; -} - -// printCoverage - Print generic coverage info used by both printFuncCoverage -// and printFileCoverage. -void FileInfo::printCoverage(raw_ostream &OS, - const GCOVCoverage &Coverage) const { - OS << format("Lines executed:%.2f%% of %u\n", - double(Coverage.LinesExec) * 100 / Coverage.LogicalLines, - Coverage.LogicalLines); - if (Options.BranchInfo) { - if (Coverage.Branches) { - OS << format("Branches executed:%.2f%% of %u\n", - double(Coverage.BranchesExec) * 100 / Coverage.Branches, - Coverage.Branches); - OS << format("Taken at least once:%.2f%% of %u\n", - double(Coverage.BranchesTaken) * 100 / Coverage.Branches, - Coverage.Branches); - } else { - OS << "No branches\n"; - } - OS << "No calls\n"; // to be consistent with gcov - } -} - -// printFuncCoverage - Print per-function coverage info. -void FileInfo::printFuncCoverage(raw_ostream &OS) const { - for (const auto &FC : FuncCoverages) { - const GCOVCoverage &Coverage = FC.second; - OS << "Function '" << Coverage.Name << "'\n"; - printCoverage(OS, Coverage); - OS << "\n"; - } -} - -// printFileCoverage - Print per-file coverage info. -void FileInfo::printFileCoverage(raw_ostream &OS) const { - for (const auto &FC : FileCoverages) { - const std::string &Filename = FC.first; - const GCOVCoverage &Coverage = FC.second; - OS << "File '" << Coverage.Name << "'\n"; - printCoverage(OS, Coverage); - if (!Options.NoOutput) - OS << Coverage.Name << ":creating '" << Filename << "'\n"; - OS << "\n"; - } -} diff --git a/gnu/llvm/lib/Support/AMDGPUCodeObjectMetadata.cpp b/gnu/llvm/lib/Support/AMDGPUCodeObjectMetadata.cpp deleted file mode 100644 index 863093ab7de..00000000000 --- a/gnu/llvm/lib/Support/AMDGPUCodeObjectMetadata.cpp +++ /dev/null @@ -1,216 +0,0 @@ -//===--- AMDGPUCodeObjectMetadata.cpp ---------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -/// \file -/// \brief AMDGPU Code Object Metadata definitions and in-memory -/// representations. -/// -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/AMDGPUCodeObjectMetadata.h" -#include "llvm/Support/YAMLTraits.h" - -using namespace llvm::AMDGPU; -using namespace llvm::AMDGPU::CodeObject; - -LLVM_YAML_IS_SEQUENCE_VECTOR(Kernel::Arg::Metadata) -LLVM_YAML_IS_SEQUENCE_VECTOR(Kernel::Metadata) - -namespace llvm { -namespace yaml { - -template <> -struct ScalarEnumerationTraits<AccessQualifier> { - static void enumeration(IO &YIO, AccessQualifier &EN) { - YIO.enumCase(EN, "Default", AccessQualifier::Default); - YIO.enumCase(EN, "ReadOnly", AccessQualifier::ReadOnly); - YIO.enumCase(EN, "WriteOnly", AccessQualifier::WriteOnly); - YIO.enumCase(EN, "ReadWrite", AccessQualifier::ReadWrite); - } -}; - -template <> -struct ScalarEnumerationTraits<AddressSpaceQualifier> { - static void enumeration(IO &YIO, AddressSpaceQualifier &EN) { - YIO.enumCase(EN, "Private", AddressSpaceQualifier::Private); - YIO.enumCase(EN, "Global", AddressSpaceQualifier::Global); - YIO.enumCase(EN, "Constant", AddressSpaceQualifier::Constant); - YIO.enumCase(EN, "Local", AddressSpaceQualifier::Local); - YIO.enumCase(EN, "Generic", AddressSpaceQualifier::Generic); - YIO.enumCase(EN, "Region", AddressSpaceQualifier::Region); - } -}; - -template <> -struct ScalarEnumerationTraits<ValueKind> { - static void enumeration(IO &YIO, ValueKind &EN) { - YIO.enumCase(EN, "ByValue", ValueKind::ByValue); - YIO.enumCase(EN, "GlobalBuffer", ValueKind::GlobalBuffer); - YIO.enumCase(EN, "DynamicSharedPointer", ValueKind::DynamicSharedPointer); - YIO.enumCase(EN, "Sampler", ValueKind::Sampler); - YIO.enumCase(EN, "Image", ValueKind::Image); - YIO.enumCase(EN, "Pipe", ValueKind::Pipe); - YIO.enumCase(EN, "Queue", ValueKind::Queue); - YIO.enumCase(EN, "HiddenGlobalOffsetX", ValueKind::HiddenGlobalOffsetX); - YIO.enumCase(EN, "HiddenGlobalOffsetY", ValueKind::HiddenGlobalOffsetY); - YIO.enumCase(EN, "HiddenGlobalOffsetZ", ValueKind::HiddenGlobalOffsetZ); - YIO.enumCase(EN, "HiddenNone", ValueKind::HiddenNone); - YIO.enumCase(EN, "HiddenPrintfBuffer", ValueKind::HiddenPrintfBuffer); - YIO.enumCase(EN, "HiddenDefaultQueue", ValueKind::HiddenDefaultQueue); - YIO.enumCase(EN, "HiddenCompletionAction", - ValueKind::HiddenCompletionAction); - } -}; - -template <> -struct ScalarEnumerationTraits<ValueType> { - static void enumeration(IO &YIO, ValueType &EN) { - YIO.enumCase(EN, "Struct", ValueType::Struct); - YIO.enumCase(EN, "I8", ValueType::I8); - YIO.enumCase(EN, "U8", ValueType::U8); - YIO.enumCase(EN, "I16", ValueType::I16); - YIO.enumCase(EN, "U16", ValueType::U16); - YIO.enumCase(EN, "F16", ValueType::F16); - YIO.enumCase(EN, "I32", ValueType::I32); - YIO.enumCase(EN, "U32", ValueType::U32); - YIO.enumCase(EN, "F32", ValueType::F32); - YIO.enumCase(EN, "I64", ValueType::I64); - YIO.enumCase(EN, "U64", ValueType::U64); - YIO.enumCase(EN, "F64", ValueType::F64); - } -}; - -template <> -struct MappingTraits<Kernel::Attrs::Metadata> { - static void mapping(IO &YIO, Kernel::Attrs::Metadata &MD) { - YIO.mapOptional(Kernel::Attrs::Key::ReqdWorkGroupSize, - MD.mReqdWorkGroupSize, std::vector<uint32_t>()); - YIO.mapOptional(Kernel::Attrs::Key::WorkGroupSizeHint, - MD.mWorkGroupSizeHint, std::vector<uint32_t>()); - YIO.mapOptional(Kernel::Attrs::Key::VecTypeHint, - MD.mVecTypeHint, std::string()); - } -}; - -template <> -struct MappingTraits<Kernel::Arg::Metadata> { - static void mapping(IO &YIO, Kernel::Arg::Metadata &MD) { - YIO.mapRequired(Kernel::Arg::Key::Size, MD.mSize); - YIO.mapRequired(Kernel::Arg::Key::Align, MD.mAlign); - YIO.mapRequired(Kernel::Arg::Key::ValueKind, MD.mValueKind); - YIO.mapRequired(Kernel::Arg::Key::ValueType, MD.mValueType); - YIO.mapOptional(Kernel::Arg::Key::PointeeAlign, MD.mPointeeAlign, - uint32_t(0)); - YIO.mapOptional(Kernel::Arg::Key::AccQual, MD.mAccQual, - AccessQualifier::Unknown); - YIO.mapOptional(Kernel::Arg::Key::AddrSpaceQual, MD.mAddrSpaceQual, - AddressSpaceQualifier::Unknown); - YIO.mapOptional(Kernel::Arg::Key::IsConst, MD.mIsConst, false); - YIO.mapOptional(Kernel::Arg::Key::IsPipe, MD.mIsPipe, false); - YIO.mapOptional(Kernel::Arg::Key::IsRestrict, MD.mIsRestrict, false); - YIO.mapOptional(Kernel::Arg::Key::IsVolatile, MD.mIsVolatile, false); - YIO.mapOptional(Kernel::Arg::Key::Name, MD.mName, std::string()); - YIO.mapOptional(Kernel::Arg::Key::TypeName, MD.mTypeName, std::string()); - } -}; - -template <> -struct MappingTraits<Kernel::CodeProps::Metadata> { - static void mapping(IO &YIO, Kernel::CodeProps::Metadata &MD) { - YIO.mapOptional(Kernel::CodeProps::Key::KernargSegmentSize, - MD.mKernargSegmentSize, uint64_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::WorkgroupGroupSegmentSize, - MD.mWorkgroupGroupSegmentSize, uint32_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::WorkitemPrivateSegmentSize, - MD.mWorkitemPrivateSegmentSize, uint32_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::WavefrontNumSGPRs, - MD.mWavefrontNumSGPRs, uint16_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::WorkitemNumVGPRs, - MD.mWorkitemNumVGPRs, uint16_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::KernargSegmentAlign, - MD.mKernargSegmentAlign, uint8_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::GroupSegmentAlign, - MD.mGroupSegmentAlign, uint8_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::PrivateSegmentAlign, - MD.mPrivateSegmentAlign, uint8_t(0)); - YIO.mapOptional(Kernel::CodeProps::Key::WavefrontSize, - MD.mWavefrontSize, uint8_t(0)); - } -}; - -template <> -struct MappingTraits<Kernel::DebugProps::Metadata> { - static void mapping(IO &YIO, Kernel::DebugProps::Metadata &MD) { - YIO.mapOptional(Kernel::DebugProps::Key::DebuggerABIVersion, - MD.mDebuggerABIVersion, std::vector<uint32_t>()); - YIO.mapOptional(Kernel::DebugProps::Key::ReservedNumVGPRs, - MD.mReservedNumVGPRs, uint16_t(0)); - YIO.mapOptional(Kernel::DebugProps::Key::ReservedFirstVGPR, - MD.mReservedFirstVGPR, uint16_t(-1)); - YIO.mapOptional(Kernel::DebugProps::Key::PrivateSegmentBufferSGPR, - MD.mPrivateSegmentBufferSGPR, uint16_t(-1)); - YIO.mapOptional(Kernel::DebugProps::Key::WavefrontPrivateSegmentOffsetSGPR, - MD.mWavefrontPrivateSegmentOffsetSGPR, uint16_t(-1)); - } -}; - -template <> -struct MappingTraits<Kernel::Metadata> { - static void mapping(IO &YIO, Kernel::Metadata &MD) { - YIO.mapRequired(Kernel::Key::Name, MD.mName); - YIO.mapOptional(Kernel::Key::Language, MD.mLanguage, std::string()); - YIO.mapOptional(Kernel::Key::LanguageVersion, MD.mLanguageVersion, - std::vector<uint32_t>()); - if (!MD.mAttrs.empty() || !YIO.outputting()) - YIO.mapOptional(Kernel::Key::Attrs, MD.mAttrs); - if (!MD.mArgs.empty() || !YIO.outputting()) - YIO.mapOptional(Kernel::Key::Args, MD.mArgs); - if (!MD.mCodeProps.empty() || !YIO.outputting()) - YIO.mapOptional(Kernel::Key::CodeProps, MD.mCodeProps); - if (!MD.mDebugProps.empty() || !YIO.outputting()) - YIO.mapOptional(Kernel::Key::DebugProps, MD.mDebugProps); - } -}; - -template <> -struct MappingTraits<CodeObject::Metadata> { - static void mapping(IO &YIO, CodeObject::Metadata &MD) { - YIO.mapRequired(Key::Version, MD.mVersion); - YIO.mapOptional(Key::Printf, MD.mPrintf, std::vector<std::string>()); - if (!MD.mKernels.empty() || !YIO.outputting()) - YIO.mapOptional(Key::Kernels, MD.mKernels); - } -}; - -} // end namespace yaml - -namespace AMDGPU { -namespace CodeObject { - -/* static */ -std::error_code Metadata::fromYamlString( - std::string YamlString, Metadata &CodeObjectMetadata) { - yaml::Input YamlInput(YamlString); - YamlInput >> CodeObjectMetadata; - return YamlInput.error(); -} - -/* static */ -std::error_code Metadata::toYamlString( - Metadata CodeObjectMetadata, std::string &YamlString) { - raw_string_ostream YamlStream(YamlString); - yaml::Output YamlOutput(YamlStream, nullptr, std::numeric_limits<int>::max()); - YamlOutput << CodeObjectMetadata; - return std::error_code(); -} - -} // end namespace CodeObject -} // end namespace AMDGPU -} // end namespace llvm diff --git a/gnu/llvm/lib/Support/regcclass.h b/gnu/llvm/lib/Support/regcclass.h deleted file mode 100644 index 7fd66046cd8..00000000000 --- a/gnu/llvm/lib/Support/regcclass.h +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * This code is derived from OpenBSD's libc/regex, original license follows: - * - * This code is derived from OpenBSD's libc/regex, original license follows: - * - * Copyright (c) 1992, 1993, 1994 Henry Spencer. - * Copyright (c) 1992, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Henry Spencer. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)cclass.h 8.3 (Berkeley) 3/20/94 - */ - -#ifndef LLVM_SUPPORT_REGCCLASS_H -#define LLVM_SUPPORT_REGCCLASS_H - -/* character-class table */ -static struct cclass { - const char *name; - const char *chars; - const char *multis; -} cclasses[] = { - { "alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789", ""} , - { "alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - ""} , - { "blank", " \t", ""} , - { "cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", ""} , - { "digit", "0123456789", ""} , - { "graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""} , - { "lower", "abcdefghijklmnopqrstuvwxyz", - ""} , - { "print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - ""} , - { "punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""} , - { "space", "\t\n\v\f\r ", ""} , - { "upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - ""} , - { "xdigit", "0123456789ABCDEFabcdef", - ""} , - { NULL, 0, "" } -}; - -#endif diff --git a/gnu/llvm/lib/Support/regcname.h b/gnu/llvm/lib/Support/regcname.h deleted file mode 100644 index 891d25573e8..00000000000 --- a/gnu/llvm/lib/Support/regcname.h +++ /dev/null @@ -1,144 +0,0 @@ -/*- - * This code is derived from OpenBSD's libc/regex, original license follows: - * - * Copyright (c) 1992, 1993, 1994 Henry Spencer. - * Copyright (c) 1992, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Henry Spencer. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)cname.h 8.3 (Berkeley) 3/20/94 - */ - -#ifndef LLVM_SUPPORT_REGCNAME_H -#define LLVM_SUPPORT_REGCNAME_H - -/* character-name table */ -static struct cname { - const char *name; - char code; -} cnames[] = { - { "NUL", '\0' }, - { "SOH", '\001' }, - { "STX", '\002' }, - { "ETX", '\003' }, - { "EOT", '\004' }, - { "ENQ", '\005' }, - { "ACK", '\006' }, - { "BEL", '\007' }, - { "alert", '\007' }, - { "BS", '\010' }, - { "backspace", '\b' }, - { "HT", '\011' }, - { "tab", '\t' }, - { "LF", '\012' }, - { "newline", '\n' }, - { "VT", '\013' }, - { "vertical-tab", '\v' }, - { "FF", '\014' }, - { "form-feed", '\f' }, - { "CR", '\015' }, - { "carriage-return", '\r' }, - { "SO", '\016' }, - { "SI", '\017' }, - { "DLE", '\020' }, - { "DC1", '\021' }, - { "DC2", '\022' }, - { "DC3", '\023' }, - { "DC4", '\024' }, - { "NAK", '\025' }, - { "SYN", '\026' }, - { "ETB", '\027' }, - { "CAN", '\030' }, - { "EM", '\031' }, - { "SUB", '\032' }, - { "ESC", '\033' }, - { "IS4", '\034' }, - { "FS", '\034' }, - { "IS3", '\035' }, - { "GS", '\035' }, - { "IS2", '\036' }, - { "RS", '\036' }, - { "IS1", '\037' }, - { "US", '\037' }, - { "space", ' ' }, - { "exclamation-mark", '!' }, - { "quotation-mark", '"' }, - { "number-sign", '#' }, - { "dollar-sign", '$' }, - { "percent-sign", '%' }, - { "ampersand", '&' }, - { "apostrophe", '\'' }, - { "left-parenthesis", '(' }, - { "right-parenthesis", ')' }, - { "asterisk", '*' }, - { "plus-sign", '+' }, - { "comma", ',' }, - { "hyphen", '-' }, - { "hyphen-minus", '-' }, - { "period", '.' }, - { "full-stop", '.' }, - { "slash", '/' }, - { "solidus", '/' }, - { "zero", '0' }, - { "one", '1' }, - { "two", '2' }, - { "three", '3' }, - { "four", '4' }, - { "five", '5' }, - { "six", '6' }, - { "seven", '7' }, - { "eight", '8' }, - { "nine", '9' }, - { "colon", ':' }, - { "semicolon", ';' }, - { "less-than-sign", '<' }, - { "equals-sign", '=' }, - { "greater-than-sign", '>' }, - { "question-mark", '?' }, - { "commercial-at", '@' }, - { "left-square-bracket", '[' }, - { "backslash", '\\' }, - { "reverse-solidus", '\\' }, - { "right-square-bracket", ']' }, - { "circumflex", '^' }, - { "circumflex-accent", '^' }, - { "underscore", '_' }, - { "low-line", '_' }, - { "grave-accent", '`' }, - { "left-brace", '{' }, - { "left-curly-bracket", '{' }, - { "vertical-line", '|' }, - { "right-brace", '}' }, - { "right-curly-bracket", '}' }, - { "tilde", '~' }, - { "DEL", '\177' }, - { NULL, 0 } -}; - -#endif diff --git a/gnu/llvm/lib/Target/AArch64/AArch64VectorByElementOpt.cpp b/gnu/llvm/lib/Target/AArch64/AArch64VectorByElementOpt.cpp deleted file mode 100644 index e3b1d7cea48..00000000000 --- a/gnu/llvm/lib/Target/AArch64/AArch64VectorByElementOpt.cpp +++ /dev/null @@ -1,371 +0,0 @@ -//=- AArch64VectorByElementOpt.cpp - AArch64 vector by element inst opt pass =// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains a pass that performs optimization for vector by element -// SIMD instructions. -// -// Certain SIMD instructions with vector element operand are not efficient. -// Rewrite them into SIMD instructions with vector operands. This rewrite -// is driven by the latency of the instructions. -// -// Example: -// fmla v0.4s, v1.4s, v2.s[1] -// is rewritten into -// dup v3.4s, v2.s[1] -// fmla v0.4s, v1.4s, v3.4s -//===----------------------------------------------------------------------===// - -#include "AArch64InstrInfo.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/TargetSchedule.h" - -using namespace llvm; - -#define DEBUG_TYPE "aarch64-vectorbyelement-opt" - -STATISTIC(NumModifiedInstr, - "Number of vector by element instructions modified"); - -#define AARCH64_VECTOR_BY_ELEMENT_OPT_NAME \ - "AArch64 vector by element instruction optimization pass" - -namespace { - -struct AArch64VectorByElementOpt : public MachineFunctionPass { - static char ID; - AArch64VectorByElementOpt() : MachineFunctionPass(ID) { - initializeAArch64VectorByElementOptPass(*PassRegistry::getPassRegistry()); - } - - const TargetInstrInfo *TII; - MachineRegisterInfo *MRI; - TargetSchedModel SchedModel; - - /// Based only on latency of instructions, determine if it is cost efficient - /// to replace the instruction InstDesc by the two instructions InstDescRep1 - /// and InstDescRep2. - /// Return true if replacement is recommended. - bool - shouldReplaceInstruction(MachineFunction *MF, const MCInstrDesc *InstDesc, - const MCInstrDesc *InstDescRep1, - const MCInstrDesc *InstDescRep2, - std::map<unsigned, bool> &VecInstElemTable) const; - - /// Determine if we need to exit the vector by element instruction - /// optimization pass early. This makes sure that Targets with no need - /// for this optimization do not spent any compile time on this pass. - /// This check is done by comparing the latency of an indexed FMLA - /// instruction to the latency of the DUP + the latency of a vector - /// FMLA instruction. We do not check on other related instructions such - /// as FMLS as we assume that if the situation shows up for one - /// instruction, then it is likely to show up for the related ones. - /// Return true if early exit of the pass is recommended. - bool earlyExitVectElement(MachineFunction *MF); - - /// Check whether an equivalent DUP instruction has already been - /// created or not. - /// Return true when the dup instruction already exists. In this case, - /// DestReg will point to the destination of the already created DUP. - bool reuseDUP(MachineInstr &MI, unsigned DupOpcode, unsigned SrcReg, - unsigned LaneNumber, unsigned *DestReg) const; - - /// Certain SIMD instructions with vector element operand are not efficient. - /// Rewrite them into SIMD instructions with vector operands. This rewrite - /// is driven by the latency of the instructions. - /// Return true if the SIMD instruction is modified. - bool optimizeVectElement(MachineInstr &MI, - std::map<unsigned, bool> *VecInstElemTable) const; - - bool runOnMachineFunction(MachineFunction &Fn) override; - - StringRef getPassName() const override { - return AARCH64_VECTOR_BY_ELEMENT_OPT_NAME; - } -}; -char AArch64VectorByElementOpt::ID = 0; -} // namespace - -INITIALIZE_PASS(AArch64VectorByElementOpt, "aarch64-vectorbyelement-opt", - AARCH64_VECTOR_BY_ELEMENT_OPT_NAME, false, false) - -/// Based only on latency of instructions, determine if it is cost efficient -/// to replace the instruction InstDesc by the two instructions InstDescRep1 -/// and InstDescRep2. Note that it is assumed in this fuction that an -/// instruction of type InstDesc is always replaced by the same two -/// instructions as results are cached here. -/// Return true if replacement is recommended. -bool AArch64VectorByElementOpt::shouldReplaceInstruction( - MachineFunction *MF, const MCInstrDesc *InstDesc, - const MCInstrDesc *InstDescRep1, const MCInstrDesc *InstDescRep2, - std::map<unsigned, bool> &VecInstElemTable) const { - // Check if replacment decision is alredy available in the cached table. - // if so, return it. - if (!VecInstElemTable.empty() && - VecInstElemTable.find(InstDesc->getOpcode()) != VecInstElemTable.end()) - return VecInstElemTable[InstDesc->getOpcode()]; - - unsigned SCIdx = InstDesc->getSchedClass(); - unsigned SCIdxRep1 = InstDescRep1->getSchedClass(); - unsigned SCIdxRep2 = InstDescRep2->getSchedClass(); - const MCSchedClassDesc *SCDesc = - SchedModel.getMCSchedModel()->getSchedClassDesc(SCIdx); - const MCSchedClassDesc *SCDescRep1 = - SchedModel.getMCSchedModel()->getSchedClassDesc(SCIdxRep1); - const MCSchedClassDesc *SCDescRep2 = - SchedModel.getMCSchedModel()->getSchedClassDesc(SCIdxRep2); - - // If a subtarget does not define resources for any of the instructions - // of interest, then return false for no replacement. - if (!SCDesc->isValid() || SCDesc->isVariant() || !SCDescRep1->isValid() || - SCDescRep1->isVariant() || !SCDescRep2->isValid() || - SCDescRep2->isVariant()) { - VecInstElemTable[InstDesc->getOpcode()] = false; - return false; - } - - if (SchedModel.computeInstrLatency(InstDesc->getOpcode()) > - SchedModel.computeInstrLatency(InstDescRep1->getOpcode()) + - SchedModel.computeInstrLatency(InstDescRep2->getOpcode())) { - VecInstElemTable[InstDesc->getOpcode()] = true; - return true; - } - VecInstElemTable[InstDesc->getOpcode()] = false; - return false; -} - -/// Determine if we need to exit the vector by element instruction -/// optimization pass early. This makes sure that Targets with no need -/// for this optimization do not spent any compile time on this pass. -/// This check is done by comparing the latency of an indexed FMLA -/// instruction to the latency of the DUP + the latency of a vector -/// FMLA instruction. We do not check on other related instructions such -/// as FMLS as we assume that if the situation shows up for one -/// instruction, then it is likely to show up for the related ones. -/// Return true if early exit of the pass is recommended. -bool AArch64VectorByElementOpt::earlyExitVectElement(MachineFunction *MF) { - std::map<unsigned, bool> VecInstElemTable; - const MCInstrDesc *IndexMulMCID = &TII->get(AArch64::FMLAv4i32_indexed); - const MCInstrDesc *DupMCID = &TII->get(AArch64::DUPv4i32lane); - const MCInstrDesc *MulMCID = &TII->get(AArch64::FMULv4f32); - - if (!shouldReplaceInstruction(MF, IndexMulMCID, DupMCID, MulMCID, - VecInstElemTable)) - return true; - return false; -} - -/// Check whether an equivalent DUP instruction has already been -/// created or not. -/// Return true when the dup instruction already exists. In this case, -/// DestReg will point to the destination of the already created DUP. -bool AArch64VectorByElementOpt::reuseDUP(MachineInstr &MI, unsigned DupOpcode, - unsigned SrcReg, unsigned LaneNumber, - unsigned *DestReg) const { - for (MachineBasicBlock::iterator MII = MI, MIE = MI.getParent()->begin(); - MII != MIE;) { - MII--; - MachineInstr *CurrentMI = &*MII; - - if (CurrentMI->getOpcode() == DupOpcode && - CurrentMI->getNumOperands() == 3 && - CurrentMI->getOperand(1).getReg() == SrcReg && - CurrentMI->getOperand(2).getImm() == LaneNumber) { - *DestReg = CurrentMI->getOperand(0).getReg(); - return true; - } - } - - return false; -} - -/// Certain SIMD instructions with vector element operand are not efficient. -/// Rewrite them into SIMD instructions with vector operands. This rewrite -/// is driven by the latency of the instructions. -/// The instruction of concerns are for the time being fmla, fmls, fmul, -/// and fmulx and hence they are hardcoded. -/// -/// Example: -/// fmla v0.4s, v1.4s, v2.s[1] -/// is rewritten into -/// dup v3.4s, v2.s[1] // dup not necessary if redundant -/// fmla v0.4s, v1.4s, v3.4s -/// Return true if the SIMD instruction is modified. -bool AArch64VectorByElementOpt::optimizeVectElement( - MachineInstr &MI, std::map<unsigned, bool> *VecInstElemTable) const { - const MCInstrDesc *MulMCID, *DupMCID; - const TargetRegisterClass *RC = &AArch64::FPR128RegClass; - - switch (MI.getOpcode()) { - default: - return false; - - // 4X32 instructions - case AArch64::FMLAv4i32_indexed: - DupMCID = &TII->get(AArch64::DUPv4i32lane); - MulMCID = &TII->get(AArch64::FMLAv4f32); - break; - case AArch64::FMLSv4i32_indexed: - DupMCID = &TII->get(AArch64::DUPv4i32lane); - MulMCID = &TII->get(AArch64::FMLSv4f32); - break; - case AArch64::FMULXv4i32_indexed: - DupMCID = &TII->get(AArch64::DUPv4i32lane); - MulMCID = &TII->get(AArch64::FMULXv4f32); - break; - case AArch64::FMULv4i32_indexed: - DupMCID = &TII->get(AArch64::DUPv4i32lane); - MulMCID = &TII->get(AArch64::FMULv4f32); - break; - - // 2X64 instructions - case AArch64::FMLAv2i64_indexed: - DupMCID = &TII->get(AArch64::DUPv2i64lane); - MulMCID = &TII->get(AArch64::FMLAv2f64); - break; - case AArch64::FMLSv2i64_indexed: - DupMCID = &TII->get(AArch64::DUPv2i64lane); - MulMCID = &TII->get(AArch64::FMLSv2f64); - break; - case AArch64::FMULXv2i64_indexed: - DupMCID = &TII->get(AArch64::DUPv2i64lane); - MulMCID = &TII->get(AArch64::FMULXv2f64); - break; - case AArch64::FMULv2i64_indexed: - DupMCID = &TII->get(AArch64::DUPv2i64lane); - MulMCID = &TII->get(AArch64::FMULv2f64); - break; - - // 2X32 instructions - case AArch64::FMLAv2i32_indexed: - RC = &AArch64::FPR64RegClass; - DupMCID = &TII->get(AArch64::DUPv2i32lane); - MulMCID = &TII->get(AArch64::FMLAv2f32); - break; - case AArch64::FMLSv2i32_indexed: - RC = &AArch64::FPR64RegClass; - DupMCID = &TII->get(AArch64::DUPv2i32lane); - MulMCID = &TII->get(AArch64::FMLSv2f32); - break; - case AArch64::FMULXv2i32_indexed: - RC = &AArch64::FPR64RegClass; - DupMCID = &TII->get(AArch64::DUPv2i32lane); - MulMCID = &TII->get(AArch64::FMULXv2f32); - break; - case AArch64::FMULv2i32_indexed: - RC = &AArch64::FPR64RegClass; - DupMCID = &TII->get(AArch64::DUPv2i32lane); - MulMCID = &TII->get(AArch64::FMULv2f32); - break; - } - - if (!shouldReplaceInstruction(MI.getParent()->getParent(), - &TII->get(MI.getOpcode()), DupMCID, MulMCID, - *VecInstElemTable)) - return false; - - const DebugLoc &DL = MI.getDebugLoc(); - MachineBasicBlock &MBB = *MI.getParent(); - MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo(); - - // get the operands of the current SIMD arithmetic instruction. - unsigned MulDest = MI.getOperand(0).getReg(); - unsigned SrcReg0 = MI.getOperand(1).getReg(); - unsigned Src0IsKill = getKillRegState(MI.getOperand(1).isKill()); - unsigned SrcReg1 = MI.getOperand(2).getReg(); - unsigned Src1IsKill = getKillRegState(MI.getOperand(2).isKill()); - unsigned DupDest; - - // Instructions of interest have either 4 or 5 operands. - if (MI.getNumOperands() == 5) { - unsigned SrcReg2 = MI.getOperand(3).getReg(); - unsigned Src2IsKill = getKillRegState(MI.getOperand(3).isKill()); - unsigned LaneNumber = MI.getOperand(4).getImm(); - - // Create a new DUP instruction. Note that if an equivalent DUP instruction - // has already been created before, then use that one instread of creating - // a new one. - if (!reuseDUP(MI, DupMCID->getOpcode(), SrcReg2, LaneNumber, &DupDest)) { - DupDest = MRI.createVirtualRegister(RC); - BuildMI(MBB, MI, DL, *DupMCID, DupDest) - .addReg(SrcReg2, Src2IsKill) - .addImm(LaneNumber); - } - BuildMI(MBB, MI, DL, *MulMCID, MulDest) - .addReg(SrcReg0, Src0IsKill) - .addReg(SrcReg1, Src1IsKill) - .addReg(DupDest, Src2IsKill); - } else if (MI.getNumOperands() == 4) { - unsigned LaneNumber = MI.getOperand(3).getImm(); - if (!reuseDUP(MI, DupMCID->getOpcode(), SrcReg1, LaneNumber, &DupDest)) { - DupDest = MRI.createVirtualRegister(RC); - BuildMI(MBB, MI, DL, *DupMCID, DupDest) - .addReg(SrcReg1, Src1IsKill) - .addImm(LaneNumber); - } - BuildMI(MBB, MI, DL, *MulMCID, MulDest) - .addReg(SrcReg0, Src0IsKill) - .addReg(DupDest, Src1IsKill); - } else { - return false; - } - - ++NumModifiedInstr; - return true; -} - -bool AArch64VectorByElementOpt::runOnMachineFunction(MachineFunction &MF) { - if (skipFunction(*MF.getFunction())) - return false; - - TII = MF.getSubtarget().getInstrInfo(); - MRI = &MF.getRegInfo(); - const TargetSubtargetInfo &ST = MF.getSubtarget(); - const AArch64InstrInfo *AAII = - static_cast<const AArch64InstrInfo *>(ST.getInstrInfo()); - if (!AAII) - return false; - SchedModel.init(ST.getSchedModel(), &ST, AAII); - if (!SchedModel.hasInstrSchedModel()) - return false; - - // A simple check to exit this pass early for targets that do not need it. - if (earlyExitVectElement(&MF)) - return false; - - bool Changed = false; - std::map<unsigned, bool> VecInstElemTable; - SmallVector<MachineInstr *, 8> RemoveMIs; - - for (MachineBasicBlock &MBB : MF) { - for (MachineBasicBlock::iterator MII = MBB.begin(), MIE = MBB.end(); - MII != MIE;) { - MachineInstr &MI = *MII; - if (optimizeVectElement(MI, &VecInstElemTable)) { - // Add MI to the list of instructions to be removed given that it has - // been replaced. - RemoveMIs.push_back(&MI); - Changed = true; - } - ++MII; - } - } - - for (MachineInstr *MI : RemoveMIs) - MI->eraseFromParent(); - - return Changed; -} - -/// createAArch64VectorByElementOptPass - returns an instance of the -/// vector by element optimization pass. -FunctionPass *llvm::createAArch64VectorByElementOptPass() { - return new AArch64VectorByElementOpt(); -} diff --git a/gnu/llvm/lib/Target/AMDGPU/CIInstructions.td b/gnu/llvm/lib/Target/AMDGPU/CIInstructions.td deleted file mode 100644 index c543814cae0..00000000000 --- a/gnu/llvm/lib/Target/AMDGPU/CIInstructions.td +++ /dev/null @@ -1,333 +0,0 @@ -//===-- CIInstructions.td - CI Instruction Defintions ---------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Instruction definitions for CI and newer. -//===----------------------------------------------------------------------===// -// Remaining instructions: -// S_CBRANCH_CDBGUSER -// S_CBRANCH_CDBGSYS -// S_CBRANCH_CDBGSYS_OR_USER -// S_CBRANCH_CDBGSYS_AND_USER -// DS_NOP -// DS_GWS_SEMA_RELEASE_ALL -// DS_WRAP_RTN_B32 -// DS_CNDXCHG32_RTN_B64 -// DS_WRITE_B96 -// DS_WRITE_B128 -// DS_CONDXCHG32_RTN_B128 -// DS_READ_B96 -// DS_READ_B128 -// BUFFER_LOAD_DWORDX3 -// BUFFER_STORE_DWORDX3 - - -def isCIVI : Predicate < - "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS || " - "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS" ->, AssemblerPredicate<"FeatureCIInsts">; - -def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">; - -//===----------------------------------------------------------------------===// -// VOP1 Instructions -//===----------------------------------------------------------------------===// - -let SubtargetPredicate = isCIVI in { - -let SchedRW = [WriteDoubleAdd] in { -defm V_TRUNC_F64 : VOP1Inst <vop1<0x17>, "v_trunc_f64", - VOP_F64_F64, ftrunc ->; -defm V_CEIL_F64 : VOP1Inst <vop1<0x18>, "v_ceil_f64", - VOP_F64_F64, fceil ->; -defm V_FLOOR_F64 : VOP1Inst <vop1<0x1A>, "v_floor_f64", - VOP_F64_F64, ffloor ->; -defm V_RNDNE_F64 : VOP1Inst <vop1<0x19>, "v_rndne_f64", - VOP_F64_F64, frint ->; -} // End SchedRW = [WriteDoubleAdd] - -let SchedRW = [WriteQuarterRate32] in { -defm V_LOG_LEGACY_F32 : VOP1Inst <vop1<0x45, 0x4c>, "v_log_legacy_f32", - VOP_F32_F32 ->; -defm V_EXP_LEGACY_F32 : VOP1Inst <vop1<0x46, 0x4b>, "v_exp_legacy_f32", - VOP_F32_F32 ->; -} // End SchedRW = [WriteQuarterRate32] - -//===----------------------------------------------------------------------===// -// VOP3 Instructions -//===----------------------------------------------------------------------===// - -defm V_QSAD_PK_U16_U8 : VOP3Inst <vop3<0x173>, "v_qsad_pk_u16_u8", - VOP_I32_I32_I32 ->; -defm V_MQSAD_U16_U8 : VOP3Inst <vop3<0x172>, "v_mqsad_u16_u8", - VOP_I32_I32_I32 ->; -defm V_MQSAD_U32_U8 : VOP3Inst <vop3<0x175>, "v_mqsad_u32_u8", - VOP_I32_I32_I32 ->; - -let isCommutable = 1 in { -defm V_MAD_U64_U32 : VOP3Inst <vop3<0x176>, "v_mad_u64_u32", - VOP_I64_I32_I32_I64 ->; - -// XXX - Does this set VCC? -defm V_MAD_I64_I32 : VOP3Inst <vop3<0x177>, "v_mad_i64_i32", - VOP_I64_I32_I32_I64 ->; -} // End isCommutable = 1 - - -//===----------------------------------------------------------------------===// -// DS Instructions -//===----------------------------------------------------------------------===// -defm DS_WRAP_RTN_F32 : DS_1A1D_RET <0x34, "ds_wrap_rtn_f32", VGPR_32, "ds_wrap_f32">; - -// DS_CONDXCHG32_RTN_B64 -// DS_CONDXCHG32_RTN_B128 - -//===----------------------------------------------------------------------===// -// SMRD Instructions -//===----------------------------------------------------------------------===// - -defm S_DCACHE_INV_VOL : SMRD_Inval <smrd<0x1d, 0x22>, - "s_dcache_inv_vol", int_amdgcn_s_dcache_inv_vol>; - -//===----------------------------------------------------------------------===// -// MUBUF Instructions -//===----------------------------------------------------------------------===// - -defm BUFFER_WBINVL1_VOL : MUBUF_Invalidate <mubuf<0x70, 0x3f>, - "buffer_wbinvl1_vol", int_amdgcn_buffer_wbinvl1_vol ->; - -//===----------------------------------------------------------------------===// -// Flat Instructions -//===----------------------------------------------------------------------===// - -defm FLAT_LOAD_UBYTE : FLAT_Load_Helper < - flat<0x8, 0x10>, "flat_load_ubyte", VGPR_32 ->; -defm FLAT_LOAD_SBYTE : FLAT_Load_Helper < - flat<0x9, 0x11>, "flat_load_sbyte", VGPR_32 ->; -defm FLAT_LOAD_USHORT : FLAT_Load_Helper < - flat<0xa, 0x12>, "flat_load_ushort", VGPR_32 ->; -defm FLAT_LOAD_SSHORT : FLAT_Load_Helper < - flat<0xb, 0x13>, "flat_load_sshort", VGPR_32> -; -defm FLAT_LOAD_DWORD : FLAT_Load_Helper < - flat<0xc, 0x14>, "flat_load_dword", VGPR_32 ->; -defm FLAT_LOAD_DWORDX2 : FLAT_Load_Helper < - flat<0xd, 0x15>, "flat_load_dwordx2", VReg_64 ->; -defm FLAT_LOAD_DWORDX4 : FLAT_Load_Helper < - flat<0xe, 0x17>, "flat_load_dwordx4", VReg_128 ->; -defm FLAT_LOAD_DWORDX3 : FLAT_Load_Helper < - flat<0xf, 0x16>, "flat_load_dwordx3", VReg_96 ->; -defm FLAT_STORE_BYTE : FLAT_Store_Helper < - flat<0x18>, "flat_store_byte", VGPR_32 ->; -defm FLAT_STORE_SHORT : FLAT_Store_Helper < - flat <0x1a>, "flat_store_short", VGPR_32 ->; -defm FLAT_STORE_DWORD : FLAT_Store_Helper < - flat<0x1c>, "flat_store_dword", VGPR_32 ->; -defm FLAT_STORE_DWORDX2 : FLAT_Store_Helper < - flat<0x1d>, "flat_store_dwordx2", VReg_64 ->; -defm FLAT_STORE_DWORDX4 : FLAT_Store_Helper < - flat<0x1e, 0x1f>, "flat_store_dwordx4", VReg_128 ->; -defm FLAT_STORE_DWORDX3 : FLAT_Store_Helper < - flat<0x1f, 0x1e>, "flat_store_dwordx3", VReg_96 ->; -defm FLAT_ATOMIC_SWAP : FLAT_ATOMIC < - flat<0x30, 0x40>, "flat_atomic_swap", VGPR_32 ->; -defm FLAT_ATOMIC_CMPSWAP : FLAT_ATOMIC < - flat<0x31, 0x41>, "flat_atomic_cmpswap", VGPR_32, VReg_64 ->; -defm FLAT_ATOMIC_ADD : FLAT_ATOMIC < - flat<0x32, 0x42>, "flat_atomic_add", VGPR_32 ->; -defm FLAT_ATOMIC_SUB : FLAT_ATOMIC < - flat<0x33, 0x43>, "flat_atomic_sub", VGPR_32 ->; -defm FLAT_ATOMIC_SMIN : FLAT_ATOMIC < - flat<0x35, 0x44>, "flat_atomic_smin", VGPR_32 ->; -defm FLAT_ATOMIC_UMIN : FLAT_ATOMIC < - flat<0x36, 0x45>, "flat_atomic_umin", VGPR_32 ->; -defm FLAT_ATOMIC_SMAX : FLAT_ATOMIC < - flat<0x37, 0x46>, "flat_atomic_smax", VGPR_32 ->; -defm FLAT_ATOMIC_UMAX : FLAT_ATOMIC < - flat<0x38, 0x47>, "flat_atomic_umax", VGPR_32 ->; -defm FLAT_ATOMIC_AND : FLAT_ATOMIC < - flat<0x39, 0x48>, "flat_atomic_and", VGPR_32 ->; -defm FLAT_ATOMIC_OR : FLAT_ATOMIC < - flat<0x3a, 0x49>, "flat_atomic_or", VGPR_32 ->; -defm FLAT_ATOMIC_XOR : FLAT_ATOMIC < - flat<0x3b, 0x4a>, "flat_atomic_xor", VGPR_32 ->; -defm FLAT_ATOMIC_INC : FLAT_ATOMIC < - flat<0x3c, 0x4b>, "flat_atomic_inc", VGPR_32 ->; -defm FLAT_ATOMIC_DEC : FLAT_ATOMIC < - flat<0x3d, 0x4c>, "flat_atomic_dec", VGPR_32 ->; -defm FLAT_ATOMIC_SWAP_X2 : FLAT_ATOMIC < - flat<0x50, 0x60>, "flat_atomic_swap_x2", VReg_64 ->; -defm FLAT_ATOMIC_CMPSWAP_X2 : FLAT_ATOMIC < - flat<0x51, 0x61>, "flat_atomic_cmpswap_x2", VReg_64, VReg_128 ->; -defm FLAT_ATOMIC_ADD_X2 : FLAT_ATOMIC < - flat<0x52, 0x62>, "flat_atomic_add_x2", VReg_64 ->; -defm FLAT_ATOMIC_SUB_X2 : FLAT_ATOMIC < - flat<0x53, 0x63>, "flat_atomic_sub_x2", VReg_64 ->; -defm FLAT_ATOMIC_SMIN_X2 : FLAT_ATOMIC < - flat<0x55, 0x64>, "flat_atomic_smin_x2", VReg_64 ->; -defm FLAT_ATOMIC_UMIN_X2 : FLAT_ATOMIC < - flat<0x56, 0x65>, "flat_atomic_umin_x2", VReg_64 ->; -defm FLAT_ATOMIC_SMAX_X2 : FLAT_ATOMIC < - flat<0x57, 0x66>, "flat_atomic_smax_x2", VReg_64 ->; -defm FLAT_ATOMIC_UMAX_X2 : FLAT_ATOMIC < - flat<0x58, 0x67>, "flat_atomic_umax_x2", VReg_64 ->; -defm FLAT_ATOMIC_AND_X2 : FLAT_ATOMIC < - flat<0x59, 0x68>, "flat_atomic_and_x2", VReg_64 ->; -defm FLAT_ATOMIC_OR_X2 : FLAT_ATOMIC < - flat<0x5a, 0x69>, "flat_atomic_or_x2", VReg_64 ->; -defm FLAT_ATOMIC_XOR_X2 : FLAT_ATOMIC < - flat<0x5b, 0x6a>, "flat_atomic_xor_x2", VReg_64 ->; -defm FLAT_ATOMIC_INC_X2 : FLAT_ATOMIC < - flat<0x5c, 0x6b>, "flat_atomic_inc_x2", VReg_64 ->; -defm FLAT_ATOMIC_DEC_X2 : FLAT_ATOMIC < - flat<0x5d, 0x6c>, "flat_atomic_dec_x2", VReg_64 ->; - -} // End SubtargetPredicate = isCIVI - -// CI Only flat instructions - -let SubtargetPredicate = isCI, VIAssemblerPredicate = DisableInst in { - -defm FLAT_ATOMIC_FCMPSWAP : FLAT_ATOMIC < - flat<0x3e>, "flat_atomic_fcmpswap", VGPR_32, VReg_64 ->; -defm FLAT_ATOMIC_FMIN : FLAT_ATOMIC < - flat<0x3f>, "flat_atomic_fmin", VGPR_32 ->; -defm FLAT_ATOMIC_FMAX : FLAT_ATOMIC < - flat<0x40>, "flat_atomic_fmax", VGPR_32 ->; -defm FLAT_ATOMIC_FCMPSWAP_X2 : FLAT_ATOMIC < - flat<0x5e>, "flat_atomic_fcmpswap_x2", VReg_64, VReg_128 ->; -defm FLAT_ATOMIC_FMIN_X2 : FLAT_ATOMIC < - flat<0x5f>, "flat_atomic_fmin_x2", VReg_64 ->; -defm FLAT_ATOMIC_FMAX_X2 : FLAT_ATOMIC < - flat<0x60>, "flat_atomic_fmax_x2", VReg_64 ->; - -} // End let SubtargetPredicate = isCI, VIAssemblerPredicate = DisableInst - -let Predicates = [isCI] in { - -// Convert (x - floor(x)) to fract(x) -def : Pat < - (f32 (fsub (f32 (VOP3Mods f32:$x, i32:$mods)), - (f32 (ffloor (f32 (VOP3Mods f32:$x, i32:$mods)))))), - (V_FRACT_F32_e64 $mods, $x, DSTCLAMP.NONE, DSTOMOD.NONE) ->; - -// Convert (x + (-floor(x))) to fract(x) -def : Pat < - (f64 (fadd (f64 (VOP3Mods f64:$x, i32:$mods)), - (f64 (fneg (f64 (ffloor (f64 (VOP3Mods f64:$x, i32:$mods)))))))), - (V_FRACT_F64_e64 $mods, $x, DSTCLAMP.NONE, DSTOMOD.NONE) ->; - -} // End Predicates = [isCI] - - -//===----------------------------------------------------------------------===// -// Flat Patterns -//===----------------------------------------------------------------------===// - -let Predicates = [isCIVI] in { - -// Patterns for global loads with no offset -class FlatLoadPat <FLAT inst, SDPatternOperator node, ValueType vt> : Pat < - (vt (node i64:$addr)), - (inst $addr, 0, 0, 0) ->; - -def : FlatLoadPat <FLAT_LOAD_UBYTE, flat_az_extloadi8, i32>; -def : FlatLoadPat <FLAT_LOAD_SBYTE, flat_sextloadi8, i32>; -def : FlatLoadPat <FLAT_LOAD_USHORT, flat_az_extloadi16, i32>; -def : FlatLoadPat <FLAT_LOAD_SSHORT, flat_sextloadi16, i32>; -def : FlatLoadPat <FLAT_LOAD_DWORD, flat_load, i32>; -def : FlatLoadPat <FLAT_LOAD_DWORDX2, flat_load, v2i32>; -def : FlatLoadPat <FLAT_LOAD_DWORDX4, flat_load, v4i32>; - -class FlatStorePat <FLAT inst, SDPatternOperator node, ValueType vt> : Pat < - (node vt:$data, i64:$addr), - (inst $data, $addr, 0, 0, 0) ->; - -def : FlatStorePat <FLAT_STORE_BYTE, flat_truncstorei8, i32>; -def : FlatStorePat <FLAT_STORE_SHORT, flat_truncstorei16, i32>; -def : FlatStorePat <FLAT_STORE_DWORD, flat_store, i32>; -def : FlatStorePat <FLAT_STORE_DWORDX2, flat_store, v2i32>; -def : FlatStorePat <FLAT_STORE_DWORDX4, flat_store, v4i32>; - -class FlatAtomicPat <FLAT inst, SDPatternOperator node, ValueType vt> : Pat < - (vt (node i64:$addr, vt:$data)), - (inst $addr, $data, 0, 0) ->; - -def : FlatAtomicPat <FLAT_ATOMIC_ADD_RTN, atomic_add_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_AND_RTN, atomic_and_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_SUB_RTN, atomic_sub_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_SMAX_RTN, atomic_max_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_UMAX_RTN, atomic_umax_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_SMIN_RTN, atomic_min_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_UMIN_RTN, atomic_umin_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_OR_RTN, atomic_or_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_SWAP_RTN, atomic_swap_global, i32>; -def : FlatAtomicPat <FLAT_ATOMIC_XOR_RTN, atomic_xor_global, i32>; - -} // End Predicates = [isCIVI] diff --git a/gnu/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.cpp b/gnu/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.cpp deleted file mode 100644 index 4e828a791e0..00000000000 --- a/gnu/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.cpp +++ /dev/null @@ -1,432 +0,0 @@ -//===--- AMDGPUCodeObjectMetadataStreamer.cpp -------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -/// \file -/// \brief AMDGPU Code Object Metadata Streamer. -/// -// -//===----------------------------------------------------------------------===// - -#include "AMDGPUCodeObjectMetadataStreamer.h" -#include "AMDGPU.h" -#include "llvm/ADT/StringSwitch.h" -#include "llvm/IR/Constants.h" -#include "llvm/IR/Module.h" -#include "llvm/Support/raw_ostream.h" - -namespace llvm { - -static cl::opt<bool> DumpCodeObjectMetadata( - "amdgpu-dump-comd", - cl::desc("Dump AMDGPU Code Object Metadata")); -static cl::opt<bool> VerifyCodeObjectMetadata( - "amdgpu-verify-comd", - cl::desc("Verify AMDGPU Code Object Metadata")); - -namespace AMDGPU { -namespace CodeObject { - -void MetadataStreamer::dump(StringRef YamlString) const { - errs() << "AMDGPU Code Object Metadata:\n" << YamlString << '\n'; -} - -void MetadataStreamer::verify(StringRef YamlString) const { - errs() << "AMDGPU Code Object Metadata Parser Test: "; - - CodeObject::Metadata FromYamlString; - if (Metadata::fromYamlString(YamlString, FromYamlString)) { - errs() << "FAIL\n"; - return; - } - - std::string ToYamlString; - if (Metadata::toYamlString(FromYamlString, ToYamlString)) { - errs() << "FAIL\n"; - return; - } - - errs() << (YamlString == ToYamlString ? "PASS" : "FAIL") << '\n'; - if (YamlString != ToYamlString) { - errs() << "Original input: " << YamlString << '\n' - << "Produced output: " << ToYamlString << '\n'; - } -} - -AccessQualifier MetadataStreamer::getAccessQualifier(StringRef AccQual) const { - if (AccQual.empty()) - return AccessQualifier::Unknown; - - return StringSwitch<AccessQualifier>(AccQual) - .Case("read_only", AccessQualifier::ReadOnly) - .Case("write_only", AccessQualifier::WriteOnly) - .Case("read_write", AccessQualifier::ReadWrite) - .Default(AccessQualifier::Default); -} - -AddressSpaceQualifier MetadataStreamer::getAddressSpaceQualifer( - unsigned AddressSpace) const { - if (AddressSpace == AMDGPUASI.PRIVATE_ADDRESS) - return AddressSpaceQualifier::Private; - if (AddressSpace == AMDGPUASI.GLOBAL_ADDRESS) - return AddressSpaceQualifier::Global; - if (AddressSpace == AMDGPUASI.CONSTANT_ADDRESS) - return AddressSpaceQualifier::Constant; - if (AddressSpace == AMDGPUASI.LOCAL_ADDRESS) - return AddressSpaceQualifier::Local; - if (AddressSpace == AMDGPUASI.FLAT_ADDRESS) - return AddressSpaceQualifier::Generic; - if (AddressSpace == AMDGPUASI.REGION_ADDRESS) - return AddressSpaceQualifier::Region; - - llvm_unreachable("Unknown address space qualifier"); -} - -ValueKind MetadataStreamer::getValueKind(Type *Ty, StringRef TypeQual, - StringRef BaseTypeName) const { - if (TypeQual.find("pipe") != StringRef::npos) - return ValueKind::Pipe; - - return StringSwitch<ValueKind>(BaseTypeName) - .Case("image1d_t", ValueKind::Image) - .Case("image1d_array_t", ValueKind::Image) - .Case("image1d_buffer_t", ValueKind::Image) - .Case("image2d_t", ValueKind::Image) - .Case("image2d_array_t", ValueKind::Image) - .Case("image2d_array_depth_t", ValueKind::Image) - .Case("image2d_array_msaa_t", ValueKind::Image) - .Case("image2d_array_msaa_depth_t", ValueKind::Image) - .Case("image2d_depth_t", ValueKind::Image) - .Case("image2d_msaa_t", ValueKind::Image) - .Case("image2d_msaa_depth_t", ValueKind::Image) - .Case("image3d_t", ValueKind::Image) - .Case("sampler_t", ValueKind::Sampler) - .Case("queue_t", ValueKind::Queue) - .Default(isa<PointerType>(Ty) ? - (Ty->getPointerAddressSpace() == - AMDGPUASI.LOCAL_ADDRESS ? - ValueKind::DynamicSharedPointer : - ValueKind::GlobalBuffer) : - ValueKind::ByValue); -} - -ValueType MetadataStreamer::getValueType(Type *Ty, StringRef TypeName) const { - switch (Ty->getTypeID()) { - case Type::IntegerTyID: { - auto Signed = !TypeName.startswith("u"); - switch (Ty->getIntegerBitWidth()) { - case 8: - return Signed ? ValueType::I8 : ValueType::U8; - case 16: - return Signed ? ValueType::I16 : ValueType::U16; - case 32: - return Signed ? ValueType::I32 : ValueType::U32; - case 64: - return Signed ? ValueType::I64 : ValueType::U64; - default: - return ValueType::Struct; - } - } - case Type::HalfTyID: - return ValueType::F16; - case Type::FloatTyID: - return ValueType::F32; - case Type::DoubleTyID: - return ValueType::F64; - case Type::PointerTyID: - return getValueType(Ty->getPointerElementType(), TypeName); - case Type::VectorTyID: - return getValueType(Ty->getVectorElementType(), TypeName); - default: - return ValueType::Struct; - } -} - -std::string MetadataStreamer::getTypeName(Type *Ty, bool Signed) const { - switch (Ty->getTypeID()) { - case Type::IntegerTyID: { - if (!Signed) - return (Twine('u') + getTypeName(Ty, true)).str(); - - auto BitWidth = Ty->getIntegerBitWidth(); - switch (BitWidth) { - case 8: - return "char"; - case 16: - return "short"; - case 32: - return "int"; - case 64: - return "long"; - default: - return (Twine('i') + Twine(BitWidth)).str(); - } - } - case Type::HalfTyID: - return "half"; - case Type::FloatTyID: - return "float"; - case Type::DoubleTyID: - return "double"; - case Type::VectorTyID: { - auto VecTy = cast<VectorType>(Ty); - auto ElTy = VecTy->getElementType(); - auto NumElements = VecTy->getVectorNumElements(); - return (Twine(getTypeName(ElTy, Signed)) + Twine(NumElements)).str(); - } - default: - return "unknown"; - } -} - -std::vector<uint32_t> MetadataStreamer::getWorkGroupDimensions( - MDNode *Node) const { - std::vector<uint32_t> Dims; - if (Node->getNumOperands() != 3) - return Dims; - - for (auto &Op : Node->operands()) - Dims.push_back(mdconst::extract<ConstantInt>(Op)->getZExtValue()); - return Dims; -} - -void MetadataStreamer::emitVersion() { - auto &Version = CodeObjectMetadata.mVersion; - - Version.push_back(MetadataVersionMajor); - Version.push_back(MetadataVersionMinor); -} - -void MetadataStreamer::emitPrintf(const Module &Mod) { - auto &Printf = CodeObjectMetadata.mPrintf; - - auto Node = Mod.getNamedMetadata("llvm.printf.fmts"); - if (!Node) - return; - - for (auto Op : Node->operands()) - if (Op->getNumOperands()) - Printf.push_back(cast<MDString>(Op->getOperand(0))->getString()); -} - -void MetadataStreamer::emitKernelLanguage(const Function &Func) { - auto &Kernel = CodeObjectMetadata.mKernels.back(); - - // TODO: What about other languages? - auto Node = Func.getParent()->getNamedMetadata("opencl.ocl.version"); - if (!Node || !Node->getNumOperands()) - return; - auto Op0 = Node->getOperand(0); - if (Op0->getNumOperands() <= 1) - return; - - Kernel.mLanguage = "OpenCL C"; - Kernel.mLanguageVersion.push_back( - mdconst::extract<ConstantInt>(Op0->getOperand(0))->getZExtValue()); - Kernel.mLanguageVersion.push_back( - mdconst::extract<ConstantInt>(Op0->getOperand(1))->getZExtValue()); -} - -void MetadataStreamer::emitKernelAttrs(const Function &Func) { - auto &Attrs = CodeObjectMetadata.mKernels.back().mAttrs; - - if (auto Node = Func.getMetadata("reqd_work_group_size")) - Attrs.mReqdWorkGroupSize = getWorkGroupDimensions(Node); - if (auto Node = Func.getMetadata("work_group_size_hint")) - Attrs.mWorkGroupSizeHint = getWorkGroupDimensions(Node); - if (auto Node = Func.getMetadata("vec_type_hint")) { - Attrs.mVecTypeHint = getTypeName( - cast<ValueAsMetadata>(Node->getOperand(0))->getType(), - mdconst::extract<ConstantInt>(Node->getOperand(1))->getZExtValue()); - } -} - -void MetadataStreamer::emitKernelArgs(const Function &Func) { - for (auto &Arg : Func.args()) - emitKernelArg(Arg); - - // TODO: What about other languages? - if (!Func.getParent()->getNamedMetadata("opencl.ocl.version")) - return; - - auto &DL = Func.getParent()->getDataLayout(); - auto Int64Ty = Type::getInt64Ty(Func.getContext()); - - emitKernelArg(DL, Int64Ty, ValueKind::HiddenGlobalOffsetX); - emitKernelArg(DL, Int64Ty, ValueKind::HiddenGlobalOffsetY); - emitKernelArg(DL, Int64Ty, ValueKind::HiddenGlobalOffsetZ); - - if (!Func.getParent()->getNamedMetadata("llvm.printf.fmts")) - return; - - auto Int8PtrTy = Type::getInt8PtrTy(Func.getContext(), - AMDGPUASI.GLOBAL_ADDRESS); - emitKernelArg(DL, Int8PtrTy, ValueKind::HiddenPrintfBuffer); -} - -void MetadataStreamer::emitKernelArg(const Argument &Arg) { - auto Func = Arg.getParent(); - auto ArgNo = Arg.getArgNo(); - const MDNode *Node; - - StringRef TypeQual; - Node = Func->getMetadata("kernel_arg_type_qual"); - if (Node && ArgNo < Node->getNumOperands()) - TypeQual = cast<MDString>(Node->getOperand(ArgNo))->getString(); - - StringRef BaseTypeName; - Node = Func->getMetadata("kernel_arg_base_type"); - if (Node && ArgNo < Node->getNumOperands()) - BaseTypeName = cast<MDString>(Node->getOperand(ArgNo))->getString(); - - StringRef AccQual; - if (Arg.getType()->isPointerTy() && Arg.onlyReadsMemory() && - Arg.hasNoAliasAttr()) { - AccQual = "read_only"; - } else { - Node = Func->getMetadata("kernel_arg_access_qual"); - if (Node && ArgNo < Node->getNumOperands()) - AccQual = cast<MDString>(Node->getOperand(ArgNo))->getString(); - } - - StringRef Name; - Node = Func->getMetadata("kernel_arg_name"); - if (Node && ArgNo < Node->getNumOperands()) - Name = cast<MDString>(Node->getOperand(ArgNo))->getString(); - - StringRef TypeName; - Node = Func->getMetadata("kernel_arg_type"); - if (Node && ArgNo < Node->getNumOperands()) - TypeName = cast<MDString>(Node->getOperand(ArgNo))->getString(); - - emitKernelArg(Func->getParent()->getDataLayout(), Arg.getType(), - getValueKind(Arg.getType(), TypeQual, BaseTypeName), TypeQual, - BaseTypeName, AccQual, Name, TypeName); -} - -void MetadataStreamer::emitKernelArg(const DataLayout &DL, Type *Ty, - ValueKind ValueKind, StringRef TypeQual, - StringRef BaseTypeName, StringRef AccQual, - StringRef Name, StringRef TypeName) { - CodeObjectMetadata.mKernels.back().mArgs.push_back(Kernel::Arg::Metadata()); - auto &Arg = CodeObjectMetadata.mKernels.back().mArgs.back(); - - Arg.mSize = DL.getTypeAllocSize(Ty); - Arg.mAlign = DL.getABITypeAlignment(Ty); - Arg.mValueKind = ValueKind; - Arg.mValueType = getValueType(Ty, BaseTypeName); - - if (auto PtrTy = dyn_cast<PointerType>(Ty)) { - auto ElTy = PtrTy->getElementType(); - if (PtrTy->getAddressSpace() == AMDGPUASI.LOCAL_ADDRESS && ElTy->isSized()) - Arg.mPointeeAlign = DL.getABITypeAlignment(ElTy); - } - - Arg.mAccQual = getAccessQualifier(AccQual); - - if (auto PtrTy = dyn_cast<PointerType>(Ty)) - Arg.mAddrSpaceQual = getAddressSpaceQualifer(PtrTy->getAddressSpace()); - - SmallVector<StringRef, 1> SplitTypeQuals; - TypeQual.split(SplitTypeQuals, " ", -1, false); - for (StringRef Key : SplitTypeQuals) { - auto P = StringSwitch<bool*>(Key) - .Case("const", &Arg.mIsConst) - .Case("pipe", &Arg.mIsPipe) - .Case("restrict", &Arg.mIsRestrict) - .Case("volatile", &Arg.mIsVolatile) - .Default(nullptr); - if (P) - *P = true; - } - - Arg.mName = Name; - Arg.mTypeName = TypeName; -} - -void MetadataStreamer::emitKernelCodeProps( - const amd_kernel_code_t &KernelCode) { - auto &CodeProps = CodeObjectMetadata.mKernels.back().mCodeProps; - - CodeProps.mKernargSegmentSize = KernelCode.kernarg_segment_byte_size; - CodeProps.mWorkgroupGroupSegmentSize = - KernelCode.workgroup_group_segment_byte_size; - CodeProps.mWorkitemPrivateSegmentSize = - KernelCode.workitem_private_segment_byte_size; - CodeProps.mWavefrontNumSGPRs = KernelCode.wavefront_sgpr_count; - CodeProps.mWorkitemNumVGPRs = KernelCode.workitem_vgpr_count; - CodeProps.mKernargSegmentAlign = KernelCode.kernarg_segment_alignment; - CodeProps.mGroupSegmentAlign = KernelCode.group_segment_alignment; - CodeProps.mPrivateSegmentAlign = KernelCode.private_segment_alignment; - CodeProps.mWavefrontSize = KernelCode.wavefront_size; -} - -void MetadataStreamer::emitKernelDebugProps( - const amd_kernel_code_t &KernelCode) { - if (!(KernelCode.code_properties & AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED)) - return; - - auto &DebugProps = CodeObjectMetadata.mKernels.back().mDebugProps; - - // FIXME: Need to pass down debugger ABI version through features. This is ok - // for now because we only have one version. - DebugProps.mDebuggerABIVersion.push_back(1); - DebugProps.mDebuggerABIVersion.push_back(0); - DebugProps.mReservedNumVGPRs = KernelCode.reserved_vgpr_count; - DebugProps.mReservedFirstVGPR = KernelCode.reserved_vgpr_first; - DebugProps.mPrivateSegmentBufferSGPR = - KernelCode.debug_private_segment_buffer_sgpr; - DebugProps.mWavefrontPrivateSegmentOffsetSGPR = - KernelCode.debug_wavefront_private_segment_offset_sgpr; -} - -void MetadataStreamer::begin(const Module &Mod) { - AMDGPUASI = getAMDGPUAS(Mod); - emitVersion(); - emitPrintf(Mod); -} - -void MetadataStreamer::emitKernel(const Function &Func, - const amd_kernel_code_t &KernelCode) { - if (Func.getCallingConv() != CallingConv::AMDGPU_KERNEL) - return; - - CodeObjectMetadata.mKernels.push_back(Kernel::Metadata()); - auto &Kernel = CodeObjectMetadata.mKernels.back(); - - Kernel.mName = Func.getName(); - emitKernelLanguage(Func); - emitKernelAttrs(Func); - emitKernelArgs(Func); - emitKernelCodeProps(KernelCode); - emitKernelDebugProps(KernelCode); -} - -ErrorOr<std::string> MetadataStreamer::toYamlString() { - std::string YamlString; - if (auto Error = Metadata::toYamlString(CodeObjectMetadata, YamlString)) - return Error; - - if (DumpCodeObjectMetadata) - dump(YamlString); - if (VerifyCodeObjectMetadata) - verify(YamlString); - - return YamlString; -} - -ErrorOr<std::string> MetadataStreamer::toYamlString(StringRef YamlString) { - if (auto Error = Metadata::fromYamlString(YamlString, CodeObjectMetadata)) - return Error; - - return toYamlString(); -} - -} // end namespace CodeObject -} // end namespace AMDGPU -} // end namespace llvm diff --git a/gnu/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.h b/gnu/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.h deleted file mode 100644 index c6681431d74..00000000000 --- a/gnu/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.h +++ /dev/null @@ -1,99 +0,0 @@ -//===--- AMDGPUCodeObjectMetadataStreamer.h ---------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -/// \file -/// \brief AMDGPU Code Object Metadata Streamer. -/// -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUCODEOBJECTMETADATASTREAMER_H -#define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUCODEOBJECTMETADATASTREAMER_H - -#include "AMDGPU.h" -#include "AMDKernelCodeT.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/AMDGPUCodeObjectMetadata.h" -#include "llvm/Support/ErrorOr.h" - -namespace llvm { - -class Argument; -class DataLayout; -class Function; -class MDNode; -class Module; -class Type; - -namespace AMDGPU { -namespace CodeObject { - -class MetadataStreamer final { -private: - Metadata CodeObjectMetadata; - AMDGPUAS AMDGPUASI; - - void dump(StringRef YamlString) const; - - void verify(StringRef YamlString) const; - - AccessQualifier getAccessQualifier(StringRef AccQual) const; - - AddressSpaceQualifier getAddressSpaceQualifer(unsigned AddressSpace) const; - - ValueKind getValueKind(Type *Ty, StringRef TypeQual, - StringRef BaseTypeName) const; - - ValueType getValueType(Type *Ty, StringRef TypeName) const; - - std::string getTypeName(Type *Ty, bool Signed) const; - - std::vector<uint32_t> getWorkGroupDimensions(MDNode *Node) const; - - void emitVersion(); - - void emitPrintf(const Module &Mod); - - void emitKernelLanguage(const Function &Func); - - void emitKernelAttrs(const Function &Func); - - void emitKernelArgs(const Function &Func); - - void emitKernelArg(const Argument &Arg); - - void emitKernelArg(const DataLayout &DL, Type *Ty, ValueKind ValueKind, - StringRef TypeQual = "", StringRef BaseTypeName = "", - StringRef AccQual = "", StringRef Name = "", - StringRef TypeName = ""); - - void emitKernelCodeProps(const amd_kernel_code_t &KernelCode); - - void emitKernelDebugProps(const amd_kernel_code_t &KernelCode); - -public: - MetadataStreamer() = default; - ~MetadataStreamer() = default; - - void begin(const Module &Mod); - - void end() {} - - void emitKernel(const Function &Func, const amd_kernel_code_t &KernelCode); - - ErrorOr<std::string> toYamlString(); - - ErrorOr<std::string> toYamlString(StringRef YamlString); -}; - -} // end namespace CodeObject -} // end namespace AMDGPU -} // end namespace llvm - -#endif // LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUCODEOBJECTMETADATASTREAMER_H diff --git a/gnu/llvm/lib/Target/AMDGPU/SIFixControlFlowLiveIntervals.cpp b/gnu/llvm/lib/Target/AMDGPU/SIFixControlFlowLiveIntervals.cpp deleted file mode 100644 index 636750dcfba..00000000000 --- a/gnu/llvm/lib/Target/AMDGPU/SIFixControlFlowLiveIntervals.cpp +++ /dev/null @@ -1,90 +0,0 @@ -//===-- SIFixControlFlowLiveIntervals.cpp - Fix CF live intervals ---------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -/// \file -/// \brief Spilling of EXEC masks used for control flow messes up control flow -/// lowering, so mark all live intervals associated with CF instructions as -/// non-spillable. -/// -//===----------------------------------------------------------------------===// - -#include "AMDGPU.h" -#include "SIInstrInfo.h" -#include "llvm/CodeGen/LiveIntervalAnalysis.h" -#include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" - -using namespace llvm; - -#define DEBUG_TYPE "si-fix-cf-live-intervals" - -namespace { - -class SIFixControlFlowLiveIntervals : public MachineFunctionPass { -public: - static char ID; - -public: - SIFixControlFlowLiveIntervals() : MachineFunctionPass(ID) { - initializeSIFixControlFlowLiveIntervalsPass(*PassRegistry::getPassRegistry()); - } - - bool runOnMachineFunction(MachineFunction &MF) override; - - const char *getPassName() const override { - return "SI Fix CF Live Intervals"; - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.addRequired<LiveIntervals>(); - AU.setPreservesAll(); - MachineFunctionPass::getAnalysisUsage(AU); - } -}; - -} // End anonymous namespace. - -INITIALIZE_PASS_BEGIN(SIFixControlFlowLiveIntervals, DEBUG_TYPE, - "SI Fix CF Live Intervals", false, false) -INITIALIZE_PASS_DEPENDENCY(LiveIntervals) -INITIALIZE_PASS_END(SIFixControlFlowLiveIntervals, DEBUG_TYPE, - "SI Fix CF Live Intervals", false, false) - -char SIFixControlFlowLiveIntervals::ID = 0; - -char &llvm::SIFixControlFlowLiveIntervalsID = SIFixControlFlowLiveIntervals::ID; - -FunctionPass *llvm::createSIFixControlFlowLiveIntervalsPass() { - return new SIFixControlFlowLiveIntervals(); -} - -bool SIFixControlFlowLiveIntervals::runOnMachineFunction(MachineFunction &MF) { - LiveIntervals *LIS = &getAnalysis<LiveIntervals>(); - - for (const MachineBasicBlock &MBB : MF) { - for (const MachineInstr &MI : MBB) { - switch (MI.getOpcode()) { - case AMDGPU::SI_IF: - case AMDGPU::SI_ELSE: - case AMDGPU::SI_BREAK: - case AMDGPU::SI_IF_BREAK: - case AMDGPU::SI_ELSE_BREAK: - case AMDGPU::SI_END_CF: { - unsigned Reg = MI.getOperand(0).getReg(); - LIS->getInterval(Reg).markNotSpillable(); - break; - } - default: - break; - } - } - } - - return false; -} diff --git a/gnu/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp b/gnu/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp deleted file mode 100644 index 5553dc2da31..00000000000 --- a/gnu/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp +++ /dev/null @@ -1,222 +0,0 @@ -//===-- AVRInstrumentFunctions.cpp - Insert instrumentation for testing ---===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This pass takes a function and inserts calls to hook functions which are -// told the name, arguments, and results of function calls. -// -// The hooks can do anything with the information given. It is possible to -// send the data through a serial connection in order to runs tests on -// bare metal. -// -//===----------------------------------------------------------------------===// - -#include "AVR.h" - -#include <llvm/IR/Function.h> -#include <llvm/IR/Module.h> - -using namespace llvm; - -#define AVR_INSTRUMENT_FUNCTIONS_NAME "AVR function instrumentation pass" - -namespace { - -// External symbols that we emit calls to. -namespace symbols { - -#define SYMBOL_PREFIX "avr_instrumentation" - - const StringRef PREFIX = SYMBOL_PREFIX; - - // void (i16 argCount); - const StringRef BEGIN_FUNCTION_SIGNATURE = SYMBOL_PREFIX "_begin_signature"; - // void(i16 argCount); - const StringRef END_FUNCTION_SIGNATURE = SYMBOL_PREFIX "_end_signature"; - -#undef SYMBOL_PREFIX -} - -class AVRInstrumentFunctions : public FunctionPass { -public: - static char ID; - - AVRInstrumentFunctions() : FunctionPass(ID) { - initializeAVRInstrumentFunctionsPass(*PassRegistry::getPassRegistry()); - } - - bool runOnFunction(Function &F) override; - - StringRef getPassName() const override { return AVR_INSTRUMENT_FUNCTIONS_NAME; } -}; - -char AVRInstrumentFunctions::ID = 0; - -/// Creates a pointer to a string. -static Value *CreateStringPtr(BasicBlock &BB, StringRef Str) { - LLVMContext &Ctx = BB.getContext(); - IntegerType *I8 = Type::getInt8Ty(Ctx); - - Constant *ConstantStr = ConstantDataArray::getString(Ctx, Str); - GlobalVariable *GlobalStr = new GlobalVariable(*BB.getParent()->getParent(), - ConstantStr->getType(), - true, /* is a constant */ - GlobalValue::PrivateLinkage, - ConstantStr); - return GetElementPtrInst::CreateInBounds(GlobalStr, - {ConstantInt::get(I8, 0), ConstantInt::get(I8, 0)}, "", &BB); -} - -static std::string GetTypeName(Type &Ty) { - if (auto *IntTy = dyn_cast<IntegerType>(&Ty)) { - return std::string("i") + std::to_string(IntTy->getBitWidth()); - } - - if (Ty.isFloatingPointTy()) { - return std::string("f") + std::to_string(Ty.getPrimitiveSizeInBits()); - } - - llvm_unreachable("unknown return type"); -} - -/// Builds a call to one of the signature begin/end hooks. -static void BuildSignatureCall(StringRef SymName, BasicBlock &BB, Function &F) { - LLVMContext &Ctx = F.getContext(); - IntegerType *I16 = Type::getInt16Ty(Ctx); - - FunctionType *FnType = FunctionType::get(Type::getVoidTy(Ctx), - {Type::getInt8PtrTy(Ctx), I16}, false); - - Constant *Fn = F.getParent()->getOrInsertFunction(SymName, FnType); - Value *FunctionName = CreateStringPtr(BB, F.getName()); - - Value *Args[] = {FunctionName, - ConstantInt::get(I16, F.getArgumentList().size())}; - CallInst::Create(Fn, Args, "", &BB); -} - -/// Builds instructions to call into an external function to -/// notify about a function signature beginning. -static void BuildBeginSignature(BasicBlock &BB, Function &F) { - return BuildSignatureCall(symbols::BEGIN_FUNCTION_SIGNATURE, BB, F); -} - -/// Builds instructions to call into an external function to -/// notify about a function signature ending. -static void BuildEndSignature(BasicBlock &BB, Function &F) { - return BuildSignatureCall(symbols::END_FUNCTION_SIGNATURE, BB, F); -} - -/// Get the name of the external symbol that we need to call -/// to notify about this argument. -static std::string GetArgumentSymbolName(Argument &Arg) { - return (symbols::PREFIX + "_argument_" + GetTypeName(*Arg.getType())).str(); -} - -/// Builds a call to one of the argument hooks. -static void BuildArgument(BasicBlock &BB, Argument &Arg) { - Function &F = *Arg.getParent(); - LLVMContext &Ctx = F.getContext(); - - Type *I8 = Type::getInt8Ty(Ctx); - - FunctionType *FnType = FunctionType::get(Type::getVoidTy(Ctx), - {Type::getInt8PtrTy(Ctx), I8, Arg.getType()}, false); - - Constant *Fn = F.getParent()->getOrInsertFunction( - GetArgumentSymbolName(Arg), FnType); - Value *ArgName = CreateStringPtr(BB, Arg.getName()); - - Value *Args[] = {ArgName, ConstantInt::get(I8, Arg.getArgNo()), &Arg}; - CallInst::Create(Fn, Args, "", &BB); -} - -/// Builds a call to all of the function signature hooks. -static void BuildSignature(BasicBlock &BB, Function &F) { - BuildBeginSignature(BB, F); - for (Argument &Arg : F.args()) { BuildArgument(BB, Arg); } - BuildEndSignature(BB, F); -} - -/// Builds the instrumentation entry block. -static void BuildEntryBlock(Function &F) { - BasicBlock &EntryBlock = F.getEntryBlock(); - - // Create a new basic block at the start of the existing entry block. - BasicBlock *BB = BasicBlock::Create(F.getContext(), - "instrumentation_entry", - &F, &EntryBlock); - - BuildSignature(*BB, F); - - // Jump to the actual entry block. - BranchInst::Create(&EntryBlock, BB); -} - -static std::string GetReturnSymbolName(Value &Val) { - return (symbols::PREFIX + "_result_" + GetTypeName(*Val.getType())).str(); -} - -static void BuildExitHook(Instruction &I) { - Function &F = *I.getParent()->getParent(); - LLVMContext &Ctx = F.getContext(); - - if (auto *Ret = dyn_cast<ReturnInst>(&I)) { - Value *RetVal = Ret->getReturnValue(); - assert(RetVal && "should only be instrumenting functions with return values"); - - FunctionType *FnType = FunctionType::get(Type::getVoidTy(Ctx), - {RetVal->getType()}, false); - - Constant *Fn = F.getParent()->getOrInsertFunction( - GetReturnSymbolName(*RetVal), FnType); - - // Call the result hook just before the return. - CallInst::Create(Fn, {RetVal}, "", &I); - } -} - -/// Runs return hooks before all returns in a function. -static void BuildExitHooks(Function &F) { - for (BasicBlock &BB : F) { - auto BBI = BB.begin(), E = BB.end(); - while (BBI != E) { - auto NBBI = std::next(BBI); - - BuildExitHook(*BBI); - - // Modified |= expandMI(BB, MBBI); - BBI = NBBI; - } - } -} - -static bool ShouldInstrument(Function &F) { - // No point reporting results if there are none. - return !F.getReturnType()->isVoidTy(); -} - -bool AVRInstrumentFunctions::runOnFunction(Function &F) { - if (ShouldInstrument(F)) { - BuildEntryBlock(F); - BuildExitHooks(F); - } - - return true; -} - -} // end of anonymous namespace - -INITIALIZE_PASS(AVRInstrumentFunctions, "avr-instrument-functions", - AVR_INSTRUMENT_FUNCTIONS_NAME, false, false) - -namespace llvm { - -FunctionPass *createAVRInstrumentFunctionsPass() { return new AVRInstrumentFunctions(); } - -} // end of namespace llvm diff --git a/gnu/llvm/lib/Target/Hexagon/HexagonIntrinsicsDerived.td b/gnu/llvm/lib/Target/Hexagon/HexagonIntrinsicsDerived.td deleted file mode 100644 index 4c28b28337f..00000000000 --- a/gnu/llvm/lib/Target/Hexagon/HexagonIntrinsicsDerived.td +++ /dev/null @@ -1,40 +0,0 @@ -//===-- HexagonIntrinsicsDerived.td - Derived intrinsics ---*- tablegen -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Multiply 64-bit and use lower result -// -// Optimized with intrinisics accumulates -// -def : Pat <(mul DoubleRegs:$src1, DoubleRegs:$src2), - (i64 - (A2_combinew - (M2_maci - (M2_maci - (i32 - (EXTRACT_SUBREG - (i64 - (M2_dpmpyuu_s0 (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src1), - subreg_loreg)), - (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src2), - subreg_loreg)))), - subreg_hireg)), - (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src1), subreg_loreg)), - (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src2), subreg_hireg))), - (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src2), subreg_loreg)), - (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src1), subreg_hireg))), - (i32 - (EXTRACT_SUBREG - (i64 - (M2_dpmpyuu_s0 - (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src1), subreg_loreg)), - (i32 (EXTRACT_SUBREG (i64 DoubleRegs:$src2), - subreg_loreg)))), subreg_loreg))))>; - - - diff --git a/gnu/llvm/lib/Target/Mips/MicroMips64r6InstrFormats.td b/gnu/llvm/lib/Target/Mips/MicroMips64r6InstrFormats.td deleted file mode 100644 index da305a2d508..00000000000 --- a/gnu/llvm/lib/Target/Mips/MicroMips64r6InstrFormats.td +++ /dev/null @@ -1,86 +0,0 @@ -//=- MicroMips64r6InstrFormats.td - Instruction Formats -*- tablegen -* -=// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file describes microMIPS64r6 instruction formats. -// -//===----------------------------------------------------------------------===// - -class DAUI_FM_MMR6 { - bits<5> rt; - bits<5> rs; - bits<16> imm; - - bits<32> Inst; - - let Inst{31-26} = 0b111100; - let Inst{25-21} = rt; - let Inst{20-16} = rs; - let Inst{15-0} = imm; -} - -class POOL32I_ADD_IMM_FM_MMR6<bits<5> funct> { - bits<5> rs; - bits<16> imm; - - bits<32> Inst; - - let Inst{31-26} = 0b010000; - let Inst{25-21} = funct; - let Inst{20-16} = rs; - let Inst{15-0} = imm; -} - -class POOL32S_EXTBITS_FM_MMR6<bits<6> funct> { - bits<5> rt; - bits<5> rs; - bits<5> size; - bits<5> pos; - - bits<32> Inst; - - let Inst{31-26} = 0b010110; - let Inst{25-21} = rt; - let Inst{20-16} = rs; - let Inst{15-11} = size; - let Inst{10-6} = pos; - let Inst{5-0} = funct; -} - -class POOL32S_DALIGN_FM_MMR6 { - bits<5> rs; - bits<5> rt; - bits<5> rd; - bits<3> bp; - - bits<32> Inst; - - let Inst{31-26} = 0b010110; - let Inst{25-21} = rs; - let Inst{20-16} = rt; - let Inst{15-11} = rd; - let Inst{10-8} = bp; - let Inst{7-6} = 0b00; - let Inst{5-0} = 0b011100; -} - -class POOL32A_DIVMOD_FM_MMR6<string instr_asm, bits<9> funct> - : MMR6Arch<instr_asm> { - bits<5> rd; - bits<5> rs; - bits<5> rt; - - bits<32> Inst; - - let Inst{31-26} = 0b010110; - let Inst{25-21} = rd; - let Inst{20-16} = rs; - let Inst{15-11} = rt; - let Inst{10-9} = 0b00; - let Inst{8-0} = funct; -} diff --git a/gnu/llvm/lib/Target/Mips/MicroMips64r6InstrInfo.td b/gnu/llvm/lib/Target/Mips/MicroMips64r6InstrInfo.td deleted file mode 100644 index ec1aef86a94..00000000000 --- a/gnu/llvm/lib/Target/Mips/MicroMips64r6InstrInfo.td +++ /dev/null @@ -1,119 +0,0 @@ -//=- MicroMips64r6InstrInfo.td - Instruction Information -*- tablegen -*- -=// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file describes MicroMips64r6 instructions. -// -//===----------------------------------------------------------------------===// - -//===----------------------------------------------------------------------===// -// -// Instruction Encodings -// -//===----------------------------------------------------------------------===// - -class DAUI_MMR6_ENC : DAUI_FM_MMR6; -class DAHI_MMR6_ENC : POOL32I_ADD_IMM_FM_MMR6<0b10001>; -class DATI_MMR6_ENC : POOL32I_ADD_IMM_FM_MMR6<0b10000>; -class DEXT_MMR6_ENC : POOL32S_EXTBITS_FM_MMR6<0b101100>; -class DEXTM_MMR6_ENC : POOL32S_EXTBITS_FM_MMR6<0b100100>; -class DEXTU_MMR6_ENC : POOL32S_EXTBITS_FM_MMR6<0b010100>; -class DALIGN_MMR6_ENC : POOL32S_DALIGN_FM_MMR6; -class DDIV_MM64R6_ENC : POOL32A_DIVMOD_FM_MMR6<"ddiv", 0b100011000>; -class DMOD_MM64R6_ENC : POOL32A_DIVMOD_FM_MMR6<"dmod", 0b101011000>; -class DDIVU_MM64R6_ENC : POOL32A_DIVMOD_FM_MMR6<"ddivu", 0b110011000>; -class DMODU_MM64R6_ENC : POOL32A_DIVMOD_FM_MMR6<"dmodu", 0b111011000>; - -//===----------------------------------------------------------------------===// -// -// Instruction Descriptions -// -//===----------------------------------------------------------------------===// - -class DAUI_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> - : MMR6Arch<instr_asm>, MipsR6Inst { - dag OutOperandList = (outs GPROpnd:$rt); - dag InOperandList = (ins GPROpnd:$rs, simm16:$imm); - string AsmString = !strconcat(instr_asm, "\t$rt, $rs, $imm"); - list<dag> Pattern = []; -} -class DAUI_MMR6_DESC : DAUI_MMR6_DESC_BASE<"daui", GPR64Opnd>; - -class DAHI_DATI_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> - : MMR6Arch<instr_asm>, MipsR6Inst { - dag OutOperandList = (outs GPROpnd:$rs); - dag InOperandList = (ins GPROpnd:$rt, simm16:$imm); - string AsmString = !strconcat(instr_asm, "\t$rt, $imm"); - string Constraints = "$rs = $rt"; -} -class DAHI_MMR6_DESC : DAHI_DATI_DESC_BASE<"dahi", GPR64Opnd>; -class DATI_MMR6_DESC : DAHI_DATI_DESC_BASE<"dati", GPR64Opnd>; - -class EXTBITS_DESC_BASE<string instr_asm, RegisterOperand RO, Operand PosOpnd, - Operand SizeOpnd, SDPatternOperator Op = null_frag> - : MMR6Arch<instr_asm>, MipsR6Inst { - dag OutOperandList = (outs RO:$rt); - dag InOperandList = (ins RO:$rs, PosOpnd:$pos, SizeOpnd:$size); - string AsmString = !strconcat(instr_asm, "\t$rt, $rs, $pos, $size"); - list<dag> Pattern = [(set RO:$rt, (Op RO:$rs, imm:$pos, imm:$size))]; - InstrItinClass Itinerary = II_EXT; - Format Form = FrmR; - string BaseOpcode = instr_asm; -} -// TODO: Add 'pos + size' constraint check to dext* instructions -// DEXT: 0 < pos + size <= 63 -// DEXTM, DEXTU: 32 < pos + size <= 64 -class DEXT_MMR6_DESC : EXTBITS_DESC_BASE<"dext", GPR64Opnd, uimm5, - uimm5_plus1, MipsExt>; -class DEXTM_MMR6_DESC : EXTBITS_DESC_BASE<"dextm", GPR64Opnd, uimm5, - uimm5_plus33, MipsExt>; -class DEXTU_MMR6_DESC : EXTBITS_DESC_BASE<"dextu", GPR64Opnd, uimm5_plus32, - uimm5_plus1, MipsExt>; - -class DALIGN_DESC_BASE<string instr_asm, RegisterOperand GPROpnd, - Operand ImmOpnd> : MMR6Arch<instr_asm>, MipsR6Inst { - dag OutOperandList = (outs GPROpnd:$rd); - dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, ImmOpnd:$bp); - string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt, $bp"); - list<dag> Pattern = []; -} - -class DALIGN_MMR6_DESC : DALIGN_DESC_BASE<"dalign", GPR64Opnd, uimm3>; - -class DDIV_MM64R6_DESC : ArithLogicR<"ddiv", GPR32Opnd>; -class DMOD_MM64R6_DESC : ArithLogicR<"dmod", GPR32Opnd>; -class DDIVU_MM64R6_DESC : ArithLogicR<"ddivu", GPR32Opnd>; -class DMODU_MM64R6_DESC : ArithLogicR<"dmodu", GPR32Opnd>; - -//===----------------------------------------------------------------------===// -// -// Instruction Definitions -// -//===----------------------------------------------------------------------===// - -let DecoderNamespace = "MicroMipsR6" in { - def DAUI_MM64R6 : StdMMR6Rel, DAUI_MMR6_DESC, DAUI_MMR6_ENC, ISA_MICROMIPS64R6; - def DAHI_MM64R6 : StdMMR6Rel, DAHI_MMR6_DESC, DAHI_MMR6_ENC, ISA_MICROMIPS64R6; - def DATI_MM64R6 : StdMMR6Rel, DATI_MMR6_DESC, DATI_MMR6_ENC, ISA_MICROMIPS64R6; - def DEXT_MM64R6 : StdMMR6Rel, DEXT_MMR6_DESC, DEXT_MMR6_ENC, - ISA_MICROMIPS64R6; - def DEXTM_MM64R6 : StdMMR6Rel, DEXTM_MMR6_DESC, DEXTM_MMR6_ENC, - ISA_MICROMIPS64R6; - def DEXTU_MM64R6 : StdMMR6Rel, DEXTU_MMR6_DESC, DEXTU_MMR6_ENC, - ISA_MICROMIPS64R6; - def DALIGN_MM64R6 : StdMMR6Rel, DALIGN_MMR6_DESC, DALIGN_MMR6_ENC, - ISA_MICROMIPS64R6; - def DDIV_MM64R6 : R6MMR6Rel, DDIV_MM64R6_DESC, DDIV_MM64R6_ENC, - ISA_MICROMIPS64R6; - def DMOD_MM64R6 : R6MMR6Rel, DMOD_MM64R6_DESC, DMOD_MM64R6_ENC, - ISA_MICROMIPS64R6; - def DDIVU_MM64R6 : R6MMR6Rel, DDIVU_MM64R6_DESC, DDIVU_MM64R6_ENC, - ISA_MICROMIPS64R6; - def DMODU_MM64R6 : R6MMR6Rel, DMODU_MM64R6_DESC, DMODU_MM64R6_ENC, - ISA_MICROMIPS64R6; -} diff --git a/gnu/llvm/lib/Target/NVPTX/NVPTXVector.td b/gnu/llvm/lib/Target/NVPTX/NVPTXVector.td deleted file mode 100644 index e69bbba9f19..00000000000 --- a/gnu/llvm/lib/Target/NVPTX/NVPTXVector.td +++ /dev/null @@ -1,1479 +0,0 @@ -//===- NVPTXVector.td - NVPTX Vector Specific Instruction defs -*- tblgen-*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -//----------------------------------- -// Vector Specific -//----------------------------------- - -// -// All vector instructions derive from NVPTXVecInst -// - -class NVPTXVecInst<dag outs, dag ins, string asmstr, list<dag> pattern, - NVPTXInst sInst=NOP> - : NVPTXInst<outs, ins, asmstr, pattern> { - NVPTXInst scalarInst=sInst; -} - -let isAsCheapAsAMove=1, VecInstType=isVecExtract.Value in { -// Extract v2i16 -def V2i16Extract : NVPTXVecInst<(outs Int16Regs:$dst), - (ins V2I16Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int16Regs:$dst, (extractelt - (v2i16 V2I16Regs:$src), imm:$c))], - IMOV16rr>; - -// Extract v4i16 -def V4i16Extract : NVPTXVecInst<(outs Int16Regs:$dst), - (ins V4I16Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int16Regs:$dst, (extractelt - (v4i16 V4I16Regs:$src), imm:$c))], - IMOV16rr>; - -// Extract v2i8 -def V2i8Extract : NVPTXVecInst<(outs Int8Regs:$dst), - (ins V2I8Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int8Regs:$dst, (extractelt - (v2i8 V2I8Regs:$src), imm:$c))], - IMOV8rr>; - -// Extract v4i8 -def V4i8Extract : NVPTXVecInst<(outs Int8Regs:$dst), - (ins V4I8Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int8Regs:$dst, (extractelt - (v4i8 V4I8Regs:$src), imm:$c))], - IMOV8rr>; - -// Extract v2i32 -def V2i32Extract : NVPTXVecInst<(outs Int32Regs:$dst), - (ins V2I32Regs:$src, i8imm:$c), - "mov.u32 \t$dst, $src${c:vecelem};", - [(set Int32Regs:$dst, (extractelt - (v2i32 V2I32Regs:$src), imm:$c))], - IMOV32rr>; - -// Extract v2f32 -def V2f32Extract : NVPTXVecInst<(outs Float32Regs:$dst), - (ins V2F32Regs:$src, i8imm:$c), - "mov.f32 \t$dst, $src${c:vecelem};", - [(set Float32Regs:$dst, (extractelt - (v2f32 V2F32Regs:$src), imm:$c))], - FMOV32rr>; - -// Extract v2i64 -def V2i64Extract : NVPTXVecInst<(outs Int64Regs:$dst), - (ins V2I64Regs:$src, i8imm:$c), - "mov.u64 \t$dst, $src${c:vecelem};", - [(set Int64Regs:$dst, (extractelt - (v2i64 V2I64Regs:$src), imm:$c))], - IMOV64rr>; - -// Extract v2f64 -def V2f64Extract : NVPTXVecInst<(outs Float64Regs:$dst), - (ins V2F64Regs:$src, i8imm:$c), - "mov.f64 \t$dst, $src${c:vecelem};", - [(set Float64Regs:$dst, (extractelt - (v2f64 V2F64Regs:$src), imm:$c))], - FMOV64rr>; - -// Extract v4i32 -def V4i32Extract : NVPTXVecInst<(outs Int32Regs:$dst), - (ins V4I32Regs:$src, i8imm:$c), - "mov.u32 \t$dst, $src${c:vecelem};", - [(set Int32Regs:$dst, (extractelt - (v4i32 V4I32Regs:$src), imm:$c))], - IMOV32rr>; - -// Extract v4f32 -def V4f32Extract : NVPTXVecInst<(outs Float32Regs:$dst), - (ins V4F32Regs:$src, i8imm:$c), - "mov.f32 \t$dst, $src${c:vecelem};", - [(set Float32Regs:$dst, (extractelt - (v4f32 V4F32Regs:$src), imm:$c))], - FMOV32rr>; -} - -let isAsCheapAsAMove=1, VecInstType=isVecInsert.Value in { -// Insert v2i8 -def V2i8Insert : NVPTXVecInst<(outs V2I8Regs:$dst), - (ins V2I8Regs:$src, Int8Regs:$val, i8imm:$c), - "mov.v2.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V2I8Regs:$dst, - (insertelt V2I8Regs:$src, Int8Regs:$val, imm:$c))], IMOV8rr>; - -// Insert v4i8 -def V4i8Insert : NVPTXVecInst<(outs V4I8Regs:$dst), - (ins V4I8Regs:$src, Int8Regs:$val, i8imm:$c), - "mov.v4.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V4I8Regs:$dst, - (insertelt V4I8Regs:$src, Int8Regs:$val, imm:$c))], IMOV8rr>; - -// Insert v2i16 -def V2i16Insert : NVPTXVecInst<(outs V2I16Regs:$dst), - (ins V2I16Regs:$src, Int16Regs:$val, i8imm:$c), - "mov.v2.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V2I16Regs:$dst, - (insertelt V2I16Regs:$src, Int16Regs:$val, imm:$c))], - IMOV16rr>; - -// Insert v4i16 -def V4i16Insert : NVPTXVecInst<(outs V4I16Regs:$dst), - (ins V4I16Regs:$src, Int16Regs:$val, i8imm:$c), - "mov.v4.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V4I16Regs:$dst, - (insertelt V4I16Regs:$src, Int16Regs:$val, imm:$c))], - IMOV16rr>; - -// Insert v2i32 -def V2i32Insert : NVPTXVecInst<(outs V2I32Regs:$dst), - (ins V2I32Regs:$src, Int32Regs:$val, i8imm:$c), - "mov.v2.u32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u32 \t$dst${c:vecelem}, $val;", - [(set V2I32Regs:$dst, - (insertelt V2I32Regs:$src, Int32Regs:$val, imm:$c))], - IMOV32rr>; - -// Insert v2f32 -def V2f32Insert : NVPTXVecInst<(outs V2F32Regs:$dst), - (ins V2F32Regs:$src, Float32Regs:$val, i8imm:$c), - "mov.v2.f32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.f32 \t$dst${c:vecelem}, $val;", - [(set V2F32Regs:$dst, - (insertelt V2F32Regs:$src, Float32Regs:$val, imm:$c))], - FMOV32rr>; - -// Insert v2i64 -def V2i64Insert : NVPTXVecInst<(outs V2I64Regs:$dst), - (ins V2I64Regs:$src, Int64Regs:$val, i8imm:$c), - "mov.v2.u64 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u64 \t$dst${c:vecelem}, $val;", - [(set V2I64Regs:$dst, - (insertelt V2I64Regs:$src, Int64Regs:$val, imm:$c))], - IMOV64rr>; - -// Insert v2f64 -def V2f64Insert : NVPTXVecInst<(outs V2F64Regs:$dst), - (ins V2F64Regs:$src, Float64Regs:$val, i8imm:$c), - "mov.v2.f64 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.f64 \t$dst${c:vecelem}, $val;", - [(set V2F64Regs:$dst, - (insertelt V2F64Regs:$src, Float64Regs:$val, imm:$c))], - FMOV64rr>; - -// Insert v4i32 -def V4i32Insert : NVPTXVecInst<(outs V4I32Regs:$dst), - (ins V4I32Regs:$src, Int32Regs:$val, i8imm:$c), - "mov.v4.u32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u32 \t$dst${c:vecelem}, $val;", - [(set V4I32Regs:$dst, - (insertelt V4I32Regs:$src, Int32Regs:$val, imm:$c))], - IMOV32rr>; - -// Insert v4f32 -def V4f32Insert : NVPTXVecInst<(outs V4F32Regs:$dst), - (ins V4F32Regs:$src, Float32Regs:$val, i8imm:$c), - "mov.v4.f32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.f32 \t$dst${c:vecelem}, $val;", - [(set V4F32Regs:$dst, - (insertelt V4F32Regs:$src, Float32Regs:$val, imm:$c))], - FMOV32rr>; -} - -class BinOpAsmString<string c> { - string s = c; -} - -class V4AsmStr<string opcode> : BinOpAsmString< - !strconcat(!strconcat(!strconcat(!strconcat( - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1;\n\t"), - opcode), " \t${dst}_2, ${a}_2, ${b}_2;\n\t"), - opcode), " \t${dst}_3, ${a}_3, ${b}_3;")>; - -class V2AsmStr<string opcode> : BinOpAsmString< - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1;")>; - -class V4MADStr<string opcode> : BinOpAsmString< - !strconcat(!strconcat(!strconcat(!strconcat( - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0, ${c}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1, ${c}_1;\n\t"), - opcode), " \t${dst}_2, ${a}_2, ${b}_2, ${c}_2;\n\t"), - opcode), " \t${dst}_3, ${a}_3, ${b}_3, ${c}_3;")>; - -class V2MADStr<string opcode> : BinOpAsmString< - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0, ${c}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1, ${c}_1;")>; - -class V4UnaryStr<string opcode> : BinOpAsmString< - !strconcat(!strconcat(!strconcat(!strconcat( - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1;\n\t"), - opcode), " \t${dst}_2, ${a}_2;\n\t"), - opcode), " \t${dst}_3, ${a}_3;")>; - -class V2UnaryStr<string opcode> : BinOpAsmString< - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1;")>; - -class VecBinaryOp<BinOpAsmString asmstr, SDNode OpNode, NVPTXRegClass regclass, - NVPTXInst sInst=NOP> : - NVPTXVecInst<(outs regclass:$dst), (ins regclass:$a, regclass:$b), - asmstr.s, - [(set regclass:$dst, (OpNode regclass:$a, regclass:$b))], - sInst>; - -class VecShiftOp<BinOpAsmString asmstr, SDNode OpNode, NVPTXRegClass regclass1, - NVPTXRegClass regclass2, NVPTXInst sInst=NOP> : - NVPTXVecInst<(outs regclass1:$dst), (ins regclass1:$a, regclass2:$b), - asmstr.s, - [(set regclass1:$dst, (OpNode regclass1:$a, regclass2:$b))], - sInst>; - -class VecUnaryOp<BinOpAsmString asmstr, PatFrag OpNode, NVPTXRegClass regclass, - NVPTXInst sInst=NOP> : - NVPTXVecInst<(outs regclass:$dst), (ins regclass:$a), - asmstr.s, - [(set regclass:$dst, (OpNode regclass:$a))], sInst>; - -multiclass IntBinVOp<string asmstr, SDNode OpNode, - NVPTXInst i64op=NOP, NVPTXInst i32op=NOP, NVPTXInst - i16op=NOP, NVPTXInst i8op=NOP> { - def V2I64 : VecBinaryOp<V2AsmStr<!strconcat(asmstr, "64")>, OpNode, V2I64Regs, - i64op>; - def V4I32 : VecBinaryOp<V4AsmStr<!strconcat(asmstr, "32")>, OpNode, V4I32Regs, - i32op>; - def V2I32 : VecBinaryOp<V2AsmStr<!strconcat(asmstr, "32")>, OpNode, V2I32Regs, - i32op>; - def V4I16 : VecBinaryOp<V4AsmStr<!strconcat(asmstr, "16")>, OpNode, V4I16Regs, - i16op>; - def V2I16 : VecBinaryOp<V2AsmStr<!strconcat(asmstr, "16")>, OpNode, V2I16Regs, - i16op>; - def V4I8 : VecBinaryOp<V4AsmStr<!strconcat(asmstr, "16")>, OpNode, V4I8Regs, - i8op>; - def V2I8 : VecBinaryOp<V2AsmStr<!strconcat(asmstr, "16")>, OpNode, V2I8Regs, - i8op>; -} - -multiclass FloatBinVOp<string asmstr, SDNode OpNode, - NVPTXInst f64=NOP, NVPTXInst f32=NOP, - NVPTXInst f32_ftz=NOP> { - def V2F64 : VecBinaryOp<V2AsmStr<!strconcat(asmstr, "f64")>, OpNode, - V2F64Regs, f64>; - def V4F32_ftz : VecBinaryOp<V4AsmStr<!strconcat(asmstr, "ftz.f32")>, OpNode, - V4F32Regs, f32_ftz>, Requires<[doF32FTZ]>; - def V2F32_ftz : VecBinaryOp<V2AsmStr<!strconcat(asmstr, "ftz.f32")>, OpNode, - V2F32Regs, f32_ftz>, Requires<[doF32FTZ]>; - def V4F32 : VecBinaryOp<V4AsmStr<!strconcat(asmstr, "f32")>, OpNode, - V4F32Regs, f32>; - def V2F32 : VecBinaryOp<V2AsmStr<!strconcat(asmstr, "f32")>, OpNode, - V2F32Regs, f32>; -} - -multiclass IntUnaryVOp<string asmstr, PatFrag OpNode, - NVPTXInst i64op=NOP, NVPTXInst i32op=NOP, - NVPTXInst i16op=NOP, NVPTXInst i8op=NOP> { - def V2I64 : VecUnaryOp<V2UnaryStr<!strconcat(asmstr, "64")>, OpNode, - V2I64Regs, i64op>; - def V4I32 : VecUnaryOp<V4UnaryStr<!strconcat(asmstr, "32")>, OpNode, - V4I32Regs, i32op>; - def V2I32 : VecUnaryOp<V2UnaryStr<!strconcat(asmstr, "32")>, OpNode, - V2I32Regs, i32op>; - def V4I16 : VecUnaryOp<V4UnaryStr<!strconcat(asmstr, "16")>, OpNode, - V4I16Regs, i16op>; - def V2I16 : VecUnaryOp<V2UnaryStr<!strconcat(asmstr, "16")>, OpNode, - V2I16Regs, i16op>; - def V4I8 : VecUnaryOp<V4UnaryStr<!strconcat(asmstr, "16")>, OpNode, - V4I8Regs, i8op>; - def V2I8 : VecUnaryOp<V2UnaryStr<!strconcat(asmstr, "16")>, OpNode, - V2I8Regs, i8op>; -} - - -// Integer Arithmetic -let VecInstType=isVecOther.Value in { -defm VAdd : IntBinVOp<"add.s", add, ADDi64rr, ADDi32rr, ADDi16rr, ADDi8rr>; -defm VSub : IntBinVOp<"sub.s", sub, SUBi64rr, SUBi32rr, SUBi16rr, SUBi8rr>; - -def AddCCV4I32 : VecBinaryOp<V4AsmStr<"add.cc.s32">, addc, V4I32Regs, - ADDCCi32rr>; -def AddCCV2I32 : VecBinaryOp<V2AsmStr<"add.cc.s32">, addc, V2I32Regs, - ADDCCi32rr>; -def SubCCV4I32 : VecBinaryOp<V4AsmStr<"sub.cc.s32">, subc, V4I32Regs, - SUBCCi32rr>; -def SubCCV2I32 : VecBinaryOp<V2AsmStr<"sub.cc.s32">, subc, V2I32Regs, - SUBCCi32rr>; -def AddCCCV4I32 : VecBinaryOp<V4AsmStr<"addc.cc.s32">, adde, V4I32Regs, - ADDCCCi32rr>; -def AddCCCV2I32 : VecBinaryOp<V2AsmStr<"addc.cc.s32">, adde, V2I32Regs, - ADDCCCi32rr>; -def SubCCCV4I32 : VecBinaryOp<V4AsmStr<"subc.cc.s32">, sube, V4I32Regs, - SUBCCCi32rr>; -def SubCCCV2I32 : VecBinaryOp<V2AsmStr<"subc.cc.s32">, sube, V2I32Regs, - SUBCCCi32rr>; - -def ShiftLV2I64 : VecShiftOp<V2AsmStr<"shl.b64">, shl, V2I64Regs, V2I32Regs, - SHLi64rr>; -def ShiftLV2I32 : VecShiftOp<V2AsmStr<"shl.b32">, shl, V2I32Regs, V2I32Regs, - SHLi32rr>; -def ShiftLV4I32 : VecShiftOp<V4AsmStr<"shl.b32">, shl, V4I32Regs, V4I32Regs, - SHLi32rr>; -def ShiftLV2I16 : VecShiftOp<V2AsmStr<"shl.b16">, shl, V2I16Regs, V2I32Regs, - SHLi16rr>; -def ShiftLV4I16 : VecShiftOp<V4AsmStr<"shl.b16">, shl, V4I16Regs, V4I32Regs, - SHLi16rr>; -def ShiftLV2I8 : VecShiftOp<V2AsmStr<"shl.b16">, shl, V2I8Regs, V2I32Regs, - SHLi8rr>; -def ShiftLV4I8 : VecShiftOp<V4AsmStr<"shl.b16">, shl, V4I8Regs, V4I32Regs, - SHLi8rr>; -} - -// cvt to v*i32, helpers for shift -class CVTtoVeci32<NVPTXRegClass inclass, NVPTXRegClass outclass, string asmstr, - NVPTXInst sInst=NOP> : - NVPTXVecInst<(outs outclass:$d), (ins inclass:$s), asmstr, [], sInst>; - -class VecCVTStrHelper<string op, string dest, string src> { - string s=!strconcat(op, !strconcat("\t", - !strconcat(dest, !strconcat(", ", !strconcat(src, ";"))))); -} - -class Vec2CVTStr<string op> { - string s=!strconcat(VecCVTStrHelper<op, "${d}_0", "${s}_0">.s, - !strconcat("\n\t", VecCVTStrHelper<op, "${d}_1", "${s}_1">.s)); -} - -class Vec4CVTStr<string op> { - string s=!strconcat(VecCVTStrHelper<op, "${d}_0", "${s}_0">.s, - !strconcat("\n\t", - !strconcat(VecCVTStrHelper<op, "${d}_1", "${s}_1">.s, - !strconcat("\n\t", - !strconcat(VecCVTStrHelper<op, "${d}_2", "${s}_2">.s, - !strconcat("\n\t", VecCVTStrHelper<op, "${d}_3", "${s}_3">.s)))))); -} - -let VecInstType=isVecOther.Value in { -def CVTv2i8tov2i32 : CVTtoVeci32<V2I8Regs, V2I32Regs, - Vec2CVTStr<"cvt.u32.u16">.s, Zint_extendext8to32>; -def CVTv2i16tov2i32 : CVTtoVeci32<V2I16Regs, V2I32Regs, - Vec2CVTStr<"cvt.u32.u16">.s, Zint_extendext16to32>; -def CVTv4i8tov4i32 : CVTtoVeci32<V4I8Regs, V4I32Regs, - Vec4CVTStr<"cvt.u32.u16">.s, Zint_extendext8to32>; -def CVTv4i16tov4i32 : CVTtoVeci32<V4I16Regs, V4I32Regs, - Vec4CVTStr<"cvt.u32.u16">.s, Zint_extendext16to32>; -def CVTv2i64tov2i32 : CVTtoVeci32<V2I64Regs, V2I32Regs, - Vec2CVTStr<"cvt.u32.u64">.s, TRUNC_64to32>; -} - -def : Pat<(shl V2I16Regs:$src1, V2I16Regs:$src2), - (ShiftLV2I16 V2I16Regs:$src1, (CVTv2i16tov2i32 V2I16Regs:$src2))>; -def : Pat<(shl V2I8Regs:$src1, V2I8Regs:$src2), - (ShiftLV2I8 V2I8Regs:$src1, (CVTv2i8tov2i32 V2I8Regs:$src2))>; -def : Pat<(shl V2I64Regs:$src1, V2I64Regs:$src2), - (ShiftLV2I64 V2I64Regs:$src1, (CVTv2i64tov2i32 V2I64Regs:$src2))>; - -def : Pat<(shl V4I16Regs:$src1, V4I16Regs:$src2), - (ShiftLV4I16 V4I16Regs:$src1, (CVTv4i16tov4i32 V4I16Regs:$src2))>; -def : Pat<(shl V4I8Regs:$src1, V4I8Regs:$src2), - (ShiftLV4I8 V4I8Regs:$src1, (CVTv4i8tov4i32 V4I8Regs:$src2))>; - -let VecInstType=isVecOther.Value in { -def ShiftRAV2I64 : VecShiftOp<V2AsmStr<"shr.s64">, sra, V2I64Regs, V2I32Regs, - SRAi64rr>; -def ShiftRAV2I32 : VecShiftOp<V2AsmStr<"shr.s32">, sra, V2I32Regs, V2I32Regs, - SRAi32rr>; -def ShiftRAV4I32 : VecShiftOp<V4AsmStr<"shr.s32">, sra, V4I32Regs, V4I32Regs, - SRAi32rr>; -def ShiftRAV2I16 : VecShiftOp<V2AsmStr<"shr.s16">, sra, V2I16Regs, V2I32Regs, - SRAi16rr>; -def ShiftRAV4I16 : VecShiftOp<V4AsmStr<"shr.s16">, sra, V4I16Regs, V4I32Regs, - SRAi16rr>; -def ShiftRAV2I8 : VecShiftOp<V2AsmStr<"shr.s16">, sra, V2I8Regs, V2I32Regs, - SRAi8rr>; -def ShiftRAV4I8 : VecShiftOp<V4AsmStr<"shr.s16">, sra, V4I8Regs, V4I32Regs, - SRAi8rr>; - -def ShiftRLV2I64 : VecShiftOp<V2AsmStr<"shr.u64">, srl, V2I64Regs, V2I32Regs, - SRLi64rr>; -def ShiftRLV2I32 : VecShiftOp<V2AsmStr<"shr.u32">, srl, V2I32Regs, V2I32Regs, - SRLi32rr>; -def ShiftRLV4I32 : VecShiftOp<V4AsmStr<"shr.u32">, srl, V4I32Regs, V4I32Regs, - SRLi32rr>; -def ShiftRLV2I16 : VecShiftOp<V2AsmStr<"shr.u16">, srl, V2I16Regs, V2I32Regs, - SRLi16rr>; -def ShiftRLV4I16 : VecShiftOp<V4AsmStr<"shr.u16">, srl, V4I16Regs, V4I32Regs, - SRLi16rr>; -def ShiftRLV2I8 : VecShiftOp<V2AsmStr<"shr.u16">, srl, V2I8Regs, V2I32Regs, - SRLi8rr>; -def ShiftRLV4I8 : VecShiftOp<V4AsmStr<"shr.u16">, srl, V4I8Regs, V4I32Regs, - SRLi8rr>; - -defm VMult : IntBinVOp<"mul.lo.s", mul, MULTi64rr, MULTi32rr, MULTi16rr, - MULTi8rr>; -defm VMultHS : IntBinVOp<"mul.hi.s", mulhs, MULTHSi64rr, MULTHSi32rr, - MULTHSi16rr, - MULTHSi8rr>; -defm VMultHU : IntBinVOp<"mul.hi.u", mulhu, MULTHUi64rr, MULTHUi32rr, - MULTHUi16rr, - MULTHUi8rr>; -defm VSDiv : IntBinVOp<"div.s", sdiv, SDIVi64rr, SDIVi32rr, SDIVi16rr, - SDIVi8rr>; -defm VUDiv : IntBinVOp<"div.u", udiv, UDIVi64rr, UDIVi32rr, UDIVi16rr, - UDIVi8rr>; -defm VSRem : IntBinVOp<"rem.s", srem, SREMi64rr, SREMi32rr, SREMi16rr, - SREMi8rr>; -defm VURem : IntBinVOp<"rem.u", urem, UREMi64rr, UREMi32rr, UREMi16rr, - UREMi8rr>; -} - -def : Pat<(sra V2I16Regs:$src1, V2I16Regs:$src2), - (ShiftRAV2I16 V2I16Regs:$src1, (CVTv2i16tov2i32 V2I16Regs:$src2))>; -def : Pat<(sra V2I8Regs:$src1, V2I8Regs:$src2), - (ShiftRAV2I8 V2I8Regs:$src1, (CVTv2i8tov2i32 V2I8Regs:$src2))>; -def : Pat<(sra V2I64Regs:$src1, V2I64Regs:$src2), - (ShiftRAV2I64 V2I64Regs:$src1, (CVTv2i64tov2i32 V2I64Regs:$src2))>; - -def : Pat<(sra V4I16Regs:$src1, V4I16Regs:$src2), - (ShiftRAV4I16 V4I16Regs:$src1, (CVTv4i16tov4i32 V4I16Regs:$src2))>; -def : Pat<(sra V4I8Regs:$src1, V4I8Regs:$src2), - (ShiftRAV4I8 V4I8Regs:$src1, (CVTv4i8tov4i32 V4I8Regs:$src2))>; - -def : Pat<(srl V2I16Regs:$src1, V2I16Regs:$src2), - (ShiftRLV2I16 V2I16Regs:$src1, (CVTv2i16tov2i32 V2I16Regs:$src2))>; -def : Pat<(srl V2I8Regs:$src1, V2I8Regs:$src2), - (ShiftRLV2I8 V2I8Regs:$src1, (CVTv2i8tov2i32 V2I8Regs:$src2))>; -def : Pat<(srl V2I64Regs:$src1, V2I64Regs:$src2), - (ShiftRLV2I64 V2I64Regs:$src1, (CVTv2i64tov2i32 V2I64Regs:$src2))>; - -def : Pat<(srl V4I16Regs:$src1, V4I16Regs:$src2), - (ShiftRLV4I16 V4I16Regs:$src1, (CVTv4i16tov4i32 V4I16Regs:$src2))>; -def : Pat<(srl V4I8Regs:$src1, V4I8Regs:$src2), - (ShiftRLV4I8 V4I8Regs:$src1, (CVTv4i8tov4i32 V4I8Regs:$src2))>; - -multiclass VMAD<string asmstr, NVPTXRegClass regclassv4, - NVPTXRegClass regclassv2, - SDNode an=add, SDNode mn=mul, NVPTXInst sop=NOP, - Predicate Pred> { - def V4 : NVPTXVecInst<(outs regclassv4:$dst), - (ins regclassv4:$a, regclassv4:$b, regclassv4:$c), - V4MADStr<asmstr>.s, - [(set regclassv4:$dst, - (an (mn regclassv4:$a, regclassv4:$b), regclassv4:$c))], - sop>, - Requires<[Pred]>; - def V2 : NVPTXVecInst<(outs regclassv2:$dst), - (ins regclassv2:$a, regclassv2:$b, regclassv2:$c), - V2MADStr<asmstr>.s, - [(set regclassv2:$dst, - (an (mn regclassv2:$a, regclassv2:$b), regclassv2:$c))], - sop>, - Requires<[Pred]>; -} - -multiclass VMADV2Only<string asmstr, NVPTXRegClass regclass, NVPTXInst sop=NOP, - Predicate Pred> { - def V2 : NVPTXVecInst<(outs regclass:$dst), - (ins regclass:$a, regclass:$b, regclass:$c), - V2MADStr<asmstr>.s, - [(set regclass:$dst, (add - (mul regclass:$a, regclass:$b), regclass:$c))], sop>, - Requires<[Pred]>; -} -multiclass VFMADV2Only<string asmstr, NVPTXRegClass regclass, NVPTXInst sop=NOP, - Predicate Pred> { - def V2 : NVPTXVecInst<(outs regclass:$dst), - (ins regclass:$a, regclass:$b, regclass:$c), - V2MADStr<asmstr>.s, - [(set regclass:$dst, (fadd - (fmul regclass:$a, regclass:$b), regclass:$c))], sop>, - Requires<[Pred]>; -} - -let VecInstType=isVecOther.Value in { -defm I8MAD : VMAD<"mad.lo.s16", V4I8Regs, V2I8Regs, add, mul, MAD8rrr, true>; -defm I16MAD : VMAD<"mad.lo.s16", V4I16Regs, V2I16Regs, add, mul, MAD16rrr, - true>; -defm I32MAD : VMAD<"mad.lo.s32", V4I32Regs, V2I32Regs, add, mul, MAD32rrr, - true>; -defm I64MAD : VMADV2Only<"mad.lo.s64", V2I64Regs, MAD64rrr, true>; - -defm VNeg : IntUnaryVOp<"neg.s", ineg, INEG64, INEG32, INEG16, INEG8>; - -defm VAddf : FloatBinVOp<"add.", fadd, FADDf64rr, FADDf32rr, FADDf32rr_ftz>; -defm VSubf : FloatBinVOp<"sub.", fsub, FSUBf64rr, FSUBf32rr, FSUBf32rr_ftz>; -defm VMulf : FloatBinVOp<"mul.", fmul, FMULf64rr, FMULf32rr, FMULf32rr_ftz>; - -defm F32MAD_ftz : VMAD<"mad.ftz.f32", V4F32Regs, V2F32Regs, fadd, fmul, - FMAD32_ftzrrr, doFMADF32_ftz>; -defm F32FMA_ftz : VMAD<"fma.rn.ftz.f32", V4F32Regs, V2F32Regs, fadd, fmul, - FMA32_ftzrrr, doFMAF32_ftz>; -defm F32MAD : VMAD<"mad.f32", V4F32Regs, V2F32Regs, fadd, fmul, FMAD32rrr, - doFMADF32>; -defm F32FMA : VMAD<"fma.rn.f32", V4F32Regs, V2F32Regs, fadd, fmul, FMA32rrr, - doFMAF32>; -defm F64FMA : VFMADV2Only<"fma.rn.f64", V2F64Regs, FMA64rrr, doFMAF64>; -} - -let VecInstType=isVecOther.Value in { -def V4F32Div_prec_ftz : VecBinaryOp<V4AsmStr<"div.rn.ftz.f32">, fdiv, V4F32Regs, - FDIV32rr_prec_ftz>, Requires<[doF32FTZ, reqPTX20]>; -def V2F32Div_prec_ftz : VecBinaryOp<V2AsmStr<"div.rn.ftz.f32">, fdiv, V2F32Regs, - FDIV32rr_prec_ftz>, Requires<[doF32FTZ, reqPTX20]>; -def V4F32Div_prec : VecBinaryOp<V4AsmStr<"div.rn.f32">, fdiv, V4F32Regs, - FDIV32rr_prec>, Requires<[reqPTX20]>; -def V2F32Div_prec : VecBinaryOp<V2AsmStr<"div.rn.f32">, fdiv, V2F32Regs, - FDIV32rr_prec>, Requires<[reqPTX20]>; -def V2F32Div_ftz : VecBinaryOp<V2AsmStr<"div.full.ftz.f32">, fdiv, V2F32Regs, - FDIV32rr_ftz>, Requires<[doF32FTZ]>; -def V4F32Div_ftz : VecBinaryOp<V4AsmStr<"div.full.ftz.f32">, fdiv, V4F32Regs, - FDIV32rr_ftz>, Requires<[doF32FTZ]>; -def V2F32Div : VecBinaryOp<V2AsmStr<"div.full.f32">, fdiv, V2F32Regs, FDIV32rr>; -def V4F32Div : VecBinaryOp<V4AsmStr<"div.full.f32">, fdiv, V4F32Regs, FDIV32rr>; -def V2F64Div : VecBinaryOp<V2AsmStr<"div.rn.f64">, fdiv, V2F64Regs, FDIV64rr>; -} - -def fnegpat : PatFrag<(ops node:$in), (fneg node:$in)>; - -let VecInstType=isVecOther.Value in { -def VNegv2f32_ftz : VecUnaryOp<V2UnaryStr<"neg.ftz.f32">, fnegpat, V2F32Regs, - FNEGf32_ftz>, Requires<[doF32FTZ]>; -def VNegv4f32_ftz : VecUnaryOp<V4UnaryStr<"neg.ftz.f32">, fnegpat, V4F32Regs, - FNEGf32_ftz>, Requires<[doF32FTZ]>; -def VNegv2f32 : VecUnaryOp<V2UnaryStr<"neg.f32">, fnegpat, V2F32Regs, FNEGf32>; -def VNegv4f32 : VecUnaryOp<V4UnaryStr<"neg.f32">, fnegpat, V4F32Regs, FNEGf32>; -def VNegv2f64 : VecUnaryOp<V2UnaryStr<"neg.f64">, fnegpat, V2F64Regs, FNEGf64>; - -// Logical Arithmetic -defm VAnd : IntBinVOp<"and.b", and, ANDb64rr, ANDb32rr, ANDb16rr, ANDb8rr>; -defm VOr : IntBinVOp<"or.b", or, ORb64rr, ORb32rr, ORb16rr, ORb8rr>; -defm VXor : IntBinVOp<"xor.b", xor, XORb64rr, XORb32rr, XORb16rr, XORb8rr>; - -defm VNot : IntUnaryVOp<"not.b", not, NOT64, NOT32, NOT16, NOT8>; -} - - -multiclass V2FPCONTRACT32_SUB_PAT<NVPTXInst Inst, Predicate Pred> { - def : Pat<(fsub V2F32Regs:$a, (fmul V2F32Regs:$b, V2F32Regs:$c)), - (Inst (VNegv2f32 V2F32Regs:$b), V2F32Regs:$c, V2F32Regs:$a)>, - Requires<[Pred]>; - - def : Pat<(fsub (fmul V2F32Regs:$a, V2F32Regs:$b), V2F32Regs:$c), - (Inst V2F32Regs:$a, V2F32Regs:$b, (VNegv2f32 V2F32Regs:$c))>, - Requires<[Pred]>; -} - -defm V2FMAF32ext_ftz : V2FPCONTRACT32_SUB_PAT<F32FMA_ftzV2, doFMAF32AGG_ftz>; -defm V2FMADF32ext_ftz : V2FPCONTRACT32_SUB_PAT<F32MAD_ftzV2, doFMADF32_ftz>; -defm V2FMAF32ext : V2FPCONTRACT32_SUB_PAT<F32FMAV2, doFMAF32AGG>; -defm V2FMADF32ext : V2FPCONTRACT32_SUB_PAT<F32MADV2, doFMADF32>; - -multiclass V4FPCONTRACT32_SUB_PAT<NVPTXInst Inst, Predicate Pred> { - def : Pat<(fsub V4F32Regs:$a, (fmul V4F32Regs:$b, V4F32Regs:$c)), - (Inst (VNegv4f32 V4F32Regs:$b), V4F32Regs:$c, V4F32Regs:$a)>, - Requires<[Pred]>; - - def : Pat<(fsub (fmul V4F32Regs:$a, V4F32Regs:$b), V4F32Regs:$c), - (Inst V4F32Regs:$a, V4F32Regs:$b, (VNegv4f32 V4F32Regs:$c))>, - Requires<[Pred]>; -} - -defm V4FMAF32ext_ftz : V4FPCONTRACT32_SUB_PAT<F32FMA_ftzV4, doFMAF32AGG_ftz>; -defm V4FMADF32ext_ftz : V4FPCONTRACT32_SUB_PAT<F32MAD_ftzV4, doFMADF32_ftz>; -defm V4FMAF32ext : V4FPCONTRACT32_SUB_PAT<F32FMAV4, doFMAF32AGG>; -defm V4FMADF32ext : V4FPCONTRACT32_SUB_PAT<F32MADV4, doFMADF32>; - -multiclass V2FPCONTRACT64_SUB_PAT<NVPTXInst Inst, Predicate Pred> { - def : Pat<(fsub V2F64Regs:$a, (fmul V2F64Regs:$b, V2F64Regs:$c)), - (Inst (VNegv2f64 V2F64Regs:$b), V2F64Regs:$c, V2F64Regs:$a)>, - Requires<[Pred]>; - - def : Pat<(fsub (fmul V2F64Regs:$a, V2F64Regs:$b), V2F64Regs:$c), - (Inst V2F64Regs:$a, V2F64Regs:$b, (VNegv2f64 V2F64Regs:$c))>, - Requires<[Pred]>; -} - -defm V2FMAF64ext : V2FPCONTRACT64_SUB_PAT<F64FMAV2, doFMAF64AGG>; - -class VecModStr<string vecsize, string elem, string extra, string l=""> -{ - string t1 = !strconcat("${c", elem); - string t2 = !strconcat(t1, ":vecv"); - string t3 = !strconcat(t2, vecsize); - string t4 = !strconcat(t3, extra); - string t5 = !strconcat(t4, l); - string s = !strconcat(t5, "}"); -} -class ShuffleOneLine<string vecsize, string elem, string type> -{ - string t1 = VecModStr<vecsize, elem, "comm", "1">.s; - string t2 = !strconcat(t1, "mov."); - string t3 = !strconcat(t2, type); - string t4 = !strconcat(t3, " \t${dst}_"); - string t5 = !strconcat(t4, elem); - string t6 = !strconcat(t5, ", $src1"); - string t7 = !strconcat(t6, VecModStr<vecsize, elem, "pos">.s); - string t8 = !strconcat(t7, ";\n\t"); - string t9 = !strconcat(t8, VecModStr<vecsize, elem, "comm", "2">.s); - string t10 = !strconcat(t9, "mov."); - string t11 = !strconcat(t10, type); - string t12 = !strconcat(t11, " \t${dst}_"); - string t13 = !strconcat(t12, elem); - string t14 = !strconcat(t13, ", $src2"); - string t15 = !strconcat(t14, VecModStr<vecsize, elem, "pos">.s); - string s = !strconcat(t15, ";"); -} -class ShuffleAsmStr2<string type> -{ - string t1 = ShuffleOneLine<"2", "0", type>.s; - string t2 = !strconcat(t1, "\n\t"); - string s = !strconcat(t2, ShuffleOneLine<"2", "1", type>.s); -} -class ShuffleAsmStr4<string type> -{ - string t1 = ShuffleOneLine<"4", "0", type>.s; - string t2 = !strconcat(t1, "\n\t"); - string t3 = !strconcat(t2, ShuffleOneLine<"4", "1", type>.s); - string t4 = !strconcat(t3, "\n\t"); - string t5 = !strconcat(t4, ShuffleOneLine<"4", "2", type>.s); - string t6 = !strconcat(t5, "\n\t"); - string s = !strconcat(t6, ShuffleOneLine<"4", "3", type>.s); -} - -let hasSideEffects=0, VecInstType=isVecShuffle.Value in { -def VecShuffle_v4f32 : NVPTXVecInst<(outs V4F32Regs:$dst), - (ins V4F32Regs:$src1, V4F32Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"f32">.s), - [], FMOV32rr>; - -def VecShuffle_v4i32 : NVPTXVecInst<(outs V4I32Regs:$dst), - (ins V4I32Regs:$src1, V4I32Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"u32">.s), - [], IMOV32rr>; - -def VecShuffle_v4i16 : NVPTXVecInst<(outs V4I16Regs:$dst), - (ins V4I16Regs:$src1, V4I16Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"u16">.s), - [], IMOV16rr>; - -def VecShuffle_v4i8 : NVPTXVecInst<(outs V4I8Regs:$dst), - (ins V4I8Regs:$src1, V4I8Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"u16">.s), - [], IMOV8rr>; - -def VecShuffle_v2f32 : NVPTXVecInst<(outs V2F32Regs:$dst), - (ins V2F32Regs:$src1, V2F32Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"f32">.s), - [], FMOV32rr>; - -def VecShuffle_v2i32 : NVPTXVecInst<(outs V2I32Regs:$dst), - (ins V2I32Regs:$src1, V2I32Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u32">.s), - [], IMOV32rr>; - -def VecShuffle_v2i8 : NVPTXVecInst<(outs V2I8Regs:$dst), - (ins V2I8Regs:$src1, V2I8Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u16">.s), - [], IMOV8rr>; - -def VecShuffle_v2i16 : NVPTXVecInst<(outs V2I16Regs:$dst), - (ins V2I16Regs:$src1, V2I16Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u16">.s), - [], IMOV16rr>; - -def VecShuffle_v2f64 : NVPTXVecInst<(outs V2F64Regs:$dst), - (ins V2F64Regs:$src1, V2F64Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"f64">.s), - [], FMOV64rr>; - -def VecShuffle_v2i64 : NVPTXVecInst<(outs V2I64Regs:$dst), - (ins V2I64Regs:$src1, V2I64Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u64">.s), - [], IMOV64rr>; -} - -def ShuffleMask0 : SDNodeXForm<vector_shuffle, [{ - ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(0), SDLoc(N), MVT::i32); -}]>; -def ShuffleMask1 : SDNodeXForm<vector_shuffle, [{ - ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(1), SDLoc(N), MVT::i32); -}]>; -def ShuffleMask2 : SDNodeXForm<vector_shuffle, [{ - ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(2), SDLoc(N), MVT::i32); -}]>; -def ShuffleMask3 : SDNodeXForm<vector_shuffle, [{ - ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(3), SDLoc(N), MVT::i32); -}]>; - -// The spurious call is here to silence a compiler warning about N being -// unused. -def vec_shuf : PatFrag<(ops node:$lhs, node:$rhs), - (vector_shuffle node:$lhs, node:$rhs), - [{ N->getGluedNode(); return true; }]>; - -def : Pat<(v2f64 (vec_shuf:$op V2F64Regs:$src1, V2F64Regs:$src2)), - (VecShuffle_v2f64 V2F64Regs:$src1, V2F64Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4f32 (vec_shuf:$op V4F32Regs:$src1, V4F32Regs:$src2)), - (VecShuffle_v4f32 V4F32Regs:$src1, V4F32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2f32 (vec_shuf:$op V2F32Regs:$src1, V2F32Regs:$src2)), - (VecShuffle_v2f32 V2F32Regs:$src1, V2F32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v2i64 (vec_shuf:$op V2I64Regs:$src1, V2I64Regs:$src2)), - (VecShuffle_v2i64 V2I64Regs:$src1, V2I64Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4i32 (vec_shuf:$op V4I32Regs:$src1, V4I32Regs:$src2)), - (VecShuffle_v4i32 V4I32Regs:$src1, V4I32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2i32 (vec_shuf:$op V2I32Regs:$src1, V2I32Regs:$src2)), - (VecShuffle_v2i32 V2I32Regs:$src1, V2I32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4i16 (vec_shuf:$op V4I16Regs:$src1, V4I16Regs:$src2)), - (VecShuffle_v4i16 V4I16Regs:$src1, V4I16Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2i16 (vec_shuf:$op V2I16Regs:$src1, V2I16Regs:$src2)), - (VecShuffle_v2i16 V2I16Regs:$src1, V2I16Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4i8 (vec_shuf:$op V4I8Regs:$src1, V4I8Regs:$src2)), - (VecShuffle_v4i8 V4I8Regs:$src1, V4I8Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2i8 (vec_shuf:$op V2I8Regs:$src1, V2I8Regs:$src2)), - (VecShuffle_v2i8 V2I8Regs:$src1, V2I8Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -class Build_Vector2<string asmstr, NVPTXRegClass vclass, NVPTXRegClass sclass, - NVPTXInst si> - : NVPTXVecInst<(outs vclass:$dst), - (ins sclass:$a1, sclass:$a2), - !strconcat(asmstr, "\t${dst:vecfull}, {{$a1, $a2}};"), - [(set vclass:$dst, (build_vector sclass:$a1, sclass:$a2))], - si>; -class Build_Vector4<string asmstr, NVPTXRegClass vclass, NVPTXRegClass sclass, - NVPTXInst si> - : NVPTXVecInst<(outs vclass:$dst), - (ins sclass:$a1, sclass:$a2, sclass:$a3, sclass:$a4), - !strconcat(asmstr, "\t${dst:vecfull}, {{$a1, $a2, $a3, $a4}};"), - [(set vclass:$dst, - (build_vector sclass:$a1, sclass:$a2, - sclass:$a3, sclass:$a4))], si>; - -let isAsCheapAsAMove=1, VecInstType=isVecBuild.Value in { -def Build_Vector2_f32 : Build_Vector2<"mov.v2.f32", V2F32Regs, Float32Regs, - FMOV32rr>; -def Build_Vector2_f64 : Build_Vector2<"mov.v2.f64", V2F64Regs, Float64Regs, - FMOV64rr>; - -def Build_Vector2_i32 : Build_Vector2<"mov.v2.u32", V2I32Regs, Int32Regs, - IMOV32rr>; -def Build_Vector2_i64 : Build_Vector2<"mov.v2.u64", V2I64Regs, Int64Regs, - IMOV64rr>; -def Build_Vector2_i16 : Build_Vector2<"mov.v2.u16", V2I16Regs, Int16Regs, - IMOV16rr>; -def Build_Vector2_i8 : Build_Vector2<"mov.v2.u16", V2I8Regs, Int8Regs, - IMOV8rr>; - -def Build_Vector4_f32 : Build_Vector4<"mov.v4.f32", V4F32Regs, Float32Regs, - FMOV32rr>; - -def Build_Vector4_i32 : Build_Vector4<"mov.v4.u32", V4I32Regs, Int32Regs, - IMOV32rr>; -def Build_Vector4_i16 : Build_Vector4<"mov.v4.u16", V4I16Regs, Int16Regs, - IMOV16rr>; -def Build_Vector4_i8 : Build_Vector4<"mov.v4.u16", V4I8Regs, Int8Regs, - IMOV8rr>; -} - -class Vec_Move<string asmstr, NVPTXRegClass vclass, NVPTXInst sop=NOP> - : NVPTXVecInst<(outs vclass:$dst), (ins vclass:$src), - !strconcat(asmstr, "\t${dst:vecfull}, ${src:vecfull};"), - [], sop>; - -let isAsCheapAsAMove=1, hasSideEffects=0, IsSimpleMove=1, - VecInstType=isVecOther.Value in { -def V4f32Mov : Vec_Move<"mov.v4.f32", V4F32Regs, FMOV32rr>; -def V2f32Mov : Vec_Move<"mov.v2.f32", V2F32Regs, FMOV32rr>; - -def V4i32Mov : Vec_Move<"mov.v4.u32", V4I32Regs, IMOV32rr>; -def V2i32Mov : Vec_Move<"mov.v2.u32", V2I32Regs, IMOV32rr>; - -def V4i16Mov : Vec_Move<"mov.v4.u16", V4I16Regs, IMOV16rr>; -def V2i16Mov : Vec_Move<"mov.v2.u16", V2I16Regs, IMOV16rr>; - -def V4i8Mov : Vec_Move<"mov.v4.u16", V4I8Regs, IMOV8rr>; -def V2i8Mov : Vec_Move<"mov.v2.u16", V2I8Regs, IMOV8rr>; - -def V2f64Mov : Vec_Move<"mov.v2.f64", V2F64Regs, FMOV64rr>; -def V2i64Mov : Vec_Move<"mov.v2.u64", V2I64Regs, IMOV64rr>; -} - -// extract subvector patterns -def extract_subvec : SDNode<"ISD::EXTRACT_SUBVECTOR", - SDTypeProfile<1, 2, [SDTCisPtrTy<2>]>>; - -def : Pat<(v2f32 (extract_subvec V4F32Regs:$src, 0)), - (Build_Vector2_f32 (V4f32Extract V4F32Regs:$src, 0), - (V4f32Extract V4F32Regs:$src, 1))>; -def : Pat<(v2f32 (extract_subvec V4F32Regs:$src, 2)), - (Build_Vector2_f32 (V4f32Extract V4F32Regs:$src, 2), - (V4f32Extract V4F32Regs:$src, 3))>; -def : Pat<(v2i32 (extract_subvec V4I32Regs:$src, 0)), - (Build_Vector2_i32 (V4i32Extract V4I32Regs:$src, 0), - (V4i32Extract V4I32Regs:$src, 1))>; -def : Pat<(v2i32 (extract_subvec V4I32Regs:$src, 2)), - (Build_Vector2_i32 (V4i32Extract V4I32Regs:$src, 2), - (V4i32Extract V4I32Regs:$src, 3))>; -def : Pat<(v2i16 (extract_subvec V4I16Regs:$src, 0)), - (Build_Vector2_i16 (V4i16Extract V4I16Regs:$src, 0), - (V4i16Extract V4I16Regs:$src, 1))>; -def : Pat<(v2i16 (extract_subvec V4I16Regs:$src, 2)), - (Build_Vector2_i16 (V4i16Extract V4I16Regs:$src, 2), - (V4i16Extract V4I16Regs:$src, 3))>; -def : Pat<(v2i8 (extract_subvec V4I8Regs:$src, 0)), - (Build_Vector2_i8 (V4i8Extract V4I8Regs:$src, 0), - (V4i8Extract V4I8Regs:$src, 1))>; -def : Pat<(v2i8 (extract_subvec V4I8Regs:$src, 2)), - (Build_Vector2_i8 (V4i8Extract V4I8Regs:$src, 2), - (V4i8Extract V4I8Regs:$src, 3))>; - -// Select instructions -class Select_OneLine<string type, string pos> { - string t1 = !strconcat("selp.", type); - string t2 = !strconcat(t1, " \t${dst}_"); - string t3 = !strconcat(t2, pos); - string t4 = !strconcat(t3, ", ${src1}_"); - string t5 = !strconcat(t4, pos); - string t6 = !strconcat(t5, ", ${src2}_"); - string t7 = !strconcat(t6, pos); - string s = !strconcat(t7, ", $p;"); -} - -class Select_Str2<string type> { - string t1 = Select_OneLine<type, "0">.s; - string t2 = !strconcat(t1, "\n\t"); - string s = !strconcat(t2, Select_OneLine<type, "1">.s); -} - -class Select_Str4<string type> { - string t1 = Select_OneLine<type, "0">.s; - string t2 = !strconcat(t1, "\n\t"); - string t3 = !strconcat(t2, Select_OneLine<type, "1">.s); - string t4 = !strconcat(t3, "\n\t"); - string t5 = !strconcat(t4, Select_OneLine<type, "2">.s); - string t6 = !strconcat(t5, "\n\t"); - string s = !strconcat(t6, Select_OneLine<type, "3">.s); - -} - -class Vec_Select<NVPTXRegClass vclass, string asmstr, NVPTXInst sop> - : NVPTXVecInst<(outs vclass:$dst), - (ins vclass:$src1, vclass:$src2, Int1Regs:$p), - asmstr, - [(set vclass:$dst, (select Int1Regs:$p, vclass:$src1, - vclass:$src2))], - sop>; - -let VecInstType=isVecOther.Value in { -def V2I64_Select : Vec_Select<V2I64Regs, Select_Str2<"b64">.s, SELECTi64rr>; -def V4I32_Select : Vec_Select<V4I32Regs, Select_Str4<"b32">.s, SELECTi32rr>; -def V2I32_Select : Vec_Select<V2I32Regs, Select_Str2<"b32">.s, SELECTi32rr>; -def V4I16_Select : Vec_Select<V4I16Regs, Select_Str4<"b16">.s, SELECTi16rr>; -def V2I16_Select : Vec_Select<V2I16Regs, Select_Str2<"b16">.s, SELECTi16rr>; -def V4I8_Select : Vec_Select<V4I8Regs, Select_Str4<"b16">.s, SELECTi8rr>; -def V2I8_Select : Vec_Select<V2I8Regs, Select_Str2<"b16">.s, SELECTi8rr>; - -def V2F64_Select : Vec_Select<V2F64Regs, Select_Str2<"f64">.s, SELECTf64rr>; -def V4F32_Select : Vec_Select<V4F32Regs, Select_Str4<"f32">.s, SELECTf32rr>; -def V2F32_Select : Vec_Select<V2F32Regs, Select_Str2<"f32">.s, SELECTf32rr>; -} - -// Comparison instructions - -// setcc convenience fragments. -def vsetoeq : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOEQ)>; -def vsetogt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOGT)>; -def vsetoge : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOGE)>; -def vsetolt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOLT)>; -def vsetole : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOLE)>; -def vsetone : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETONE)>; -def vseto : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETO)>; -def vsetuo : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUO)>; -def vsetueq : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUEQ)>; -def vsetugt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUGT)>; -def vsetuge : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUGE)>; -def vsetult : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETULT)>; -def vsetule : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETULE)>; -def vsetune : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUNE)>; -def vseteq : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETEQ)>; -def vsetgt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETGT)>; -def vsetge : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETGE)>; -def vsetlt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETLT)>; -def vsetle : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETLE)>; -def vsetne : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETNE)>; - -class Vec_Compare<PatFrag op, NVPTXRegClass outrclass, NVPTXRegClass inrclass, - NVPTXInst sop> - : NVPTXVecInst<(outs outrclass:$dst), - (ins inrclass:$a, inrclass:$b), - "Unsupported", - [(set outrclass:$dst, (op inrclass:$a, inrclass:$b))], - sop>; - -multiclass Vec_Compare_All<PatFrag op, - NVPTXInst inst8, - NVPTXInst inst16, - NVPTXInst inst32, - NVPTXInst inst64> -{ - def V2I8 : Vec_Compare<op, V2I8Regs, V2I8Regs, inst8>; - def V4I8 : Vec_Compare<op, V4I8Regs, V4I8Regs, inst8>; - def V2I16 : Vec_Compare<op, V2I16Regs, V2I16Regs, inst16>; - def V4I16 : Vec_Compare<op, V4I16Regs, V4I16Regs, inst16>; - def V2I32 : Vec_Compare<op, V2I32Regs, V2I32Regs, inst32>; - def V4I32 : Vec_Compare<op, V4I32Regs, V4I32Regs, inst32>; - def V2I64 : Vec_Compare<op, V2I64Regs, V2I64Regs, inst64>; -} - -let VecInstType=isVecOther.Value in { - defm VecSGT : Vec_Compare_All<vsetgt, ISetSGTi8rr_toi8, ISetSGTi16rr_toi16, - ISetSGTi32rr_toi32, ISetSGTi64rr_toi64>; - defm VecUGT : Vec_Compare_All<vsetugt, ISetUGTi8rr_toi8, ISetUGTi16rr_toi16, - ISetUGTi32rr_toi32, ISetUGTi64rr_toi64>; - defm VecSLT : Vec_Compare_All<vsetlt, ISetSLTi8rr_toi8, ISetSLTi16rr_toi16, - ISetSLTi32rr_toi32, ISetSLTi64rr_toi64>; - defm VecULT : Vec_Compare_All<vsetult, ISetULTi8rr_toi8, ISetULTi16rr_toi16, - ISetULTi32rr_toi32, ISetULTi64rr_toi64>; - defm VecSGE : Vec_Compare_All<vsetge, ISetSGEi8rr_toi8, ISetSGEi16rr_toi16, - ISetSGEi32rr_toi32, ISetSGEi64rr_toi64>; - defm VecUGE : Vec_Compare_All<vsetuge, ISetUGEi8rr_toi8, ISetUGEi16rr_toi16, - ISetUGEi32rr_toi32, ISetUGEi64rr_toi64>; - defm VecSLE : Vec_Compare_All<vsetle, ISetSLEi8rr_toi8, ISetSLEi16rr_toi16, - ISetSLEi32rr_toi32, ISetSLEi64rr_toi64>; - defm VecULE : Vec_Compare_All<vsetule, ISetULEi8rr_toi8, ISetULEi16rr_toi16, - ISetULEi32rr_toi32, ISetULEi64rr_toi64>; - defm VecSEQ : Vec_Compare_All<vseteq, ISetSEQi8rr_toi8, ISetSEQi16rr_toi16, - ISetSEQi32rr_toi32, ISetSEQi64rr_toi64>; - defm VecUEQ : Vec_Compare_All<vsetueq, ISetUEQi8rr_toi8, ISetUEQi16rr_toi16, - ISetUEQi32rr_toi32, ISetUEQi64rr_toi64>; - defm VecSNE : Vec_Compare_All<vsetne, ISetSNEi8rr_toi8, ISetSNEi16rr_toi16, - ISetSNEi32rr_toi32, ISetSNEi64rr_toi64>; - defm VecUNE : Vec_Compare_All<vsetune, ISetUNEi8rr_toi8, ISetUNEi16rr_toi16, - ISetUNEi32rr_toi32, ISetUNEi64rr_toi64>; -} - -multiclass FVec_Compare_All<PatFrag op, - NVPTXInst instf32, - NVPTXInst instf64> -{ - def V2F32 : Vec_Compare<op, V2I32Regs, V2F32Regs, instf32>; - def V4F32 : Vec_Compare<op, V4I32Regs, V4F32Regs, instf32>; - def V2F64 : Vec_Compare<op, V2I64Regs, V2F64Regs, instf64>; -} - -let VecInstType=isVecOther.Value in { - defm FVecGT : FVec_Compare_All<vsetogt, FSetGTf32rr_toi32, - FSetGTf64rr_toi64>; - defm FVecLT : FVec_Compare_All<vsetolt, FSetLTf32rr_toi32, - FSetLTf64rr_toi64>; - defm FVecGE : FVec_Compare_All<vsetoge, FSetGEf32rr_toi32, - FSetGEf64rr_toi64>; - defm FVecLE : FVec_Compare_All<vsetole, FSetLEf32rr_toi32, - FSetLEf64rr_toi64>; - defm FVecEQ : FVec_Compare_All<vsetoeq, FSetEQf32rr_toi32, - FSetEQf64rr_toi64>; - defm FVecNE : FVec_Compare_All<vsetone, FSetNEf32rr_toi32, - FSetNEf64rr_toi64>; - - defm FVecUGT : FVec_Compare_All<vsetugt, FSetUGTf32rr_toi32, - FSetUGTf64rr_toi64>; - defm FVecULT : FVec_Compare_All<vsetult, FSetULTf32rr_toi32, - FSetULTf64rr_toi64>; - defm FVecUGE : FVec_Compare_All<vsetuge, FSetUGEf32rr_toi32, - FSetUGEf64rr_toi64>; - defm FVecULE : FVec_Compare_All<vsetule, FSetULEf32rr_toi32, - FSetULEf64rr_toi64>; - defm FVecUEQ : FVec_Compare_All<vsetueq, FSetUEQf32rr_toi32, - FSetUEQf64rr_toi64>; - defm FVecUNE : FVec_Compare_All<vsetune, FSetUNEf32rr_toi32, - FSetUNEf64rr_toi64>; - - defm FVecNUM : FVec_Compare_All<vseto, FSetNUMf32rr_toi32, - FSetNUMf64rr_toi64>; - defm FVecNAN : FVec_Compare_All<vsetuo, FSetNANf32rr_toi32, - FSetNANf64rr_toi64>; -} - -class LoadParamScalar4Inst<NVPTXRegClass regclass, string opstr> : - NVPTXInst<(outs regclass:$d1, regclass:$d2, regclass:$d3, regclass:$d4), - (ins i32imm:$a, i32imm:$b), - !strconcat(!strconcat("ld.param", opstr), - "\t{{$d1, $d2, $d3, $d4}}, [retval0+$b];"), []>; - -class LoadParamScalar2Inst<NVPTXRegClass regclass, string opstr> : - NVPTXInst<(outs regclass:$d1, regclass:$d2), - (ins i32imm:$a, i32imm:$b), - !strconcat(!strconcat("ld.param", opstr), - "\t{{$d1, $d2}}, [retval0+$b];"), []>; - - -class StoreParamScalar4Inst<NVPTXRegClass regclass, string opstr> : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, regclass:$s3, regclass:$s4, - i32imm:$a, i32imm:$b), - !strconcat(!strconcat("st.param", opstr), - "\t[param$a+$b], {{$s1, $s2, $s3, $s4}};"), []>; - -class StoreParamScalar2Inst<NVPTXRegClass regclass, string opstr> : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, i32imm:$a, i32imm:$b), - !strconcat(!strconcat("st.param", opstr), - "\t[param$a+$b], {{$s1, $s2}};"), []>; - -class StoreRetvalScalar4Inst<NVPTXRegClass regclass, string opstr> : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, regclass:$s3, regclass:$s4, - i32imm:$a), - !strconcat(!strconcat("st.param", opstr), - "\t[func_retval+$a], {{$s1, $s2, $s3, $s4}};"), []>; - -class StoreRetvalScalar2Inst<NVPTXRegClass regclass, string opstr> : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, i32imm:$a), - !strconcat(!strconcat("st.param", opstr), - "\t[func_retval+$a], {{$s1, $s2}};"), []>; - -def LoadParamScalar4I32 : LoadParamScalar4Inst<Int32Regs, ".v4.b32">; -def LoadParamScalar4I16 : LoadParamScalar4Inst<Int16Regs, ".v4.b16">; -def LoadParamScalar4I8 : LoadParamScalar4Inst<Int8Regs, ".v4.b8">; - -def LoadParamScalar2I64 : LoadParamScalar2Inst<Int32Regs, ".v2.b64">; -def LoadParamScalar2I32 : LoadParamScalar2Inst<Int32Regs, ".v2.b32">; -def LoadParamScalar2I16 : LoadParamScalar2Inst<Int32Regs, ".v2.b16">; -def LoadParamScalar2I8 : LoadParamScalar2Inst<Int32Regs, ".v2.b8">; - -def LoadParamScalar4F32 : LoadParamScalar4Inst<Float32Regs, ".v4.f32">; -def LoadParamScalar2F32 : LoadParamScalar2Inst<Float32Regs, ".v2.f32">; -def LoadParamScalar2F64 : LoadParamScalar2Inst<Float64Regs, ".v2.f64">; - -def StoreParamScalar4I32 : StoreParamScalar4Inst<Int32Regs, ".v4.b32">; -def StoreParamScalar4I16 : StoreParamScalar4Inst<Int16Regs, ".v4.b16">; -def StoreParamScalar4I8 : StoreParamScalar4Inst<Int8Regs, ".v4.b8">; - -def StoreParamScalar2I64 : StoreParamScalar2Inst<Int64Regs, ".v2.b64">; -def StoreParamScalar2I32 : StoreParamScalar2Inst<Int32Regs, ".v2.b32">; -def StoreParamScalar2I16 : StoreParamScalar2Inst<Int16Regs, ".v2.b16">; -def StoreParamScalar2I8 : StoreParamScalar2Inst<Int8Regs, ".v2.b8">; - -def StoreParamScalar4F32 : StoreParamScalar4Inst<Float32Regs, ".v4.f32">; -def StoreParamScalar2F32 : StoreParamScalar2Inst<Float32Regs, ".v2.f32">; -def StoreParamScalar2F64 : StoreParamScalar2Inst<Float64Regs, ".v2.f64">; - -def StoreRetvalScalar4I32 : StoreRetvalScalar4Inst<Int32Regs, ".v4.b32">; -def StoreRetvalScalar4I16 : StoreRetvalScalar4Inst<Int16Regs, ".v4.b16">; -def StoreRetvalScalar4I8 : StoreRetvalScalar4Inst<Int8Regs, ".v4.b8">; - -def StoreRetvalScalar2I64 : StoreRetvalScalar2Inst<Int64Regs, ".v2.b64">; -def StoreRetvalScalar2I32 : StoreRetvalScalar2Inst<Int32Regs, ".v2.b32">; -def StoreRetvalScalar2I16 : StoreRetvalScalar2Inst<Int16Regs, ".v2.b16">; -def StoreRetvalScalar2I8 : StoreRetvalScalar2Inst<Int8Regs, ".v2.b8">; - -def StoreRetvalScalar4F32 : StoreRetvalScalar4Inst<Float32Regs, ".v4.f32">; -def StoreRetvalScalar2F32 : StoreRetvalScalar2Inst<Float32Regs, ".v2.f32">; -def StoreRetvalScalar2F64 : StoreRetvalScalar2Inst<Float64Regs, ".v2.f64">; - -class LoadParamVecInst<NVPTXRegClass regclass, string opstr, NVPTXInst sop=NOP>: - NVPTXVecInst<(outs regclass:$dst), (ins i32imm:$a, i32imm:$b), - "loadparam : $dst <- [$a, $b]", - [(set regclass:$dst, (LoadParam (i32 imm:$a), (i32 imm:$b)))], - sop>; - -class StoreParamVecInst<NVPTXRegClass regclass, string opstr, NVPTXInst sop=NOP> - : NVPTXVecInst<(outs), (ins regclass:$val, i32imm:$a, i32imm:$b), - "storeparam : [$a, $b] <- $val", - [(StoreParam (i32 imm:$a), (i32 imm:$b), regclass:$val)], sop>; - -class StoreRetvalVecInst<NVPTXRegClass regclass, string opstr, - NVPTXInst sop=NOP> - : NVPTXVecInst<(outs), (ins regclass:$val, i32imm:$a), - "storeretval : retval[$a] <- $val", - [(StoreRetval (i32 imm:$a), regclass:$val)], sop>; - -let VecInstType=isVecLD.Value in { -def LoadParamV4I32 : LoadParamVecInst<V4I32Regs, ".v4.b32", - LoadParamScalar4I32>; -def LoadParamV4I16 : LoadParamVecInst<V4I16Regs, ".v4.b16", - LoadParamScalar4I16>; -def LoadParamV4I8 : LoadParamVecInst<V4I8Regs, ".v4.b8", - LoadParamScalar4I8>; - -def LoadParamV2I64 : LoadParamVecInst<V2I64Regs, ".v2.b64", - LoadParamScalar2I64>; -def LoadParamV2I32 : LoadParamVecInst<V2I32Regs, ".v2.b32", - LoadParamScalar2I32>; -def LoadParamV2I16 : LoadParamVecInst<V2I16Regs, ".v2.b16", - LoadParamScalar2I16>; -def LoadParamV2I8 : LoadParamVecInst<V2I8Regs, ".v2.b8", - LoadParamScalar2I8>; - -def LoadParamV4F32 : LoadParamVecInst<V4F32Regs, ".v4.f32", - LoadParamScalar4F32>; -def LoadParamV2F32 : LoadParamVecInst<V2F32Regs, ".v2.f32", - LoadParamScalar2F32>; -def LoadParamV2F64 : LoadParamVecInst<V2F64Regs, ".v2.f64", - LoadParamScalar2F64>; -} - -let VecInstType=isVecST.Value in { -def StoreParamV4I32 : StoreParamVecInst<V4I32Regs, ".v4.b32", - StoreParamScalar4I32>; -def StoreParamV4I16 : StoreParamVecInst<V4I16Regs, ".v4.b16", - StoreParamScalar4I16>; -def StoreParamV4I8 : StoreParamVecInst<V4I8Regs, ".v4.b8", - StoreParamScalar4I8>; - -def StoreParamV2I64 : StoreParamVecInst<V2I64Regs, ".v2.b64", - StoreParamScalar2I64>; -def StoreParamV2I32 : StoreParamVecInst<V2I32Regs, ".v2.b32", - StoreParamScalar2I32>; -def StoreParamV2I16 : StoreParamVecInst<V2I16Regs, ".v2.b16", - StoreParamScalar2I16>; -def StoreParamV2I8 : StoreParamVecInst<V2I8Regs, ".v2.b8", - StoreParamScalar2I8>; - -def StoreParamV4F32 : StoreParamVecInst<V4F32Regs, ".v4.f32", - StoreParamScalar4F32>; -def StoreParamV2F32 : StoreParamVecInst<V2F32Regs, ".v2.f32", - StoreParamScalar2F32>; -def StoreParamV2F64 : StoreParamVecInst<V2F64Regs, ".v2.f64", - StoreParamScalar2F64>; - -def StoreRetvalV4I32 : StoreRetvalVecInst<V4I32Regs, ".v4.b32", - StoreRetvalScalar4I32>; -def StoreRetvalV4I16 : StoreRetvalVecInst<V4I16Regs, ".v4.b16", - StoreRetvalScalar4I16>; -def StoreRetvalV4I8 : StoreRetvalVecInst<V4I8Regs, ".v4.b8", - StoreRetvalScalar4I8>; - -def StoreRetvalV2I64 : StoreRetvalVecInst<V2I64Regs, ".v2.b64", - StoreRetvalScalar2I64>; -def StoreRetvalV2I32 : StoreRetvalVecInst<V2I32Regs, ".v2.b32", - StoreRetvalScalar2I32>; -def StoreRetvalV2I16 : StoreRetvalVecInst<V2I16Regs, ".v2.b16", - StoreRetvalScalar2I16>; -def StoreRetvalV2I8 : StoreRetvalVecInst<V2I8Regs, ".v2.b8", - StoreRetvalScalar2I8>; - -def StoreRetvalV4F32 : StoreRetvalVecInst<V4F32Regs, ".v4.f32", - StoreRetvalScalar4F32>; -def StoreRetvalV2F32 : StoreRetvalVecInst<V2F32Regs, ".v2.f32", - StoreRetvalScalar2F32>; -def StoreRetvalV2F64 : StoreRetvalVecInst<V2F64Regs, ".v2.f64", - StoreRetvalScalar2F64>; - -} - - -// Int vector to int scalar bit convert -// v4i8 -> i32 -def : Pat<(i32 (bitconvert V4I8Regs:$s)), - (V4I8toI32 (V4i8Extract V4I8Regs:$s,0), (V4i8Extract V4I8Regs:$s,1), - (V4i8Extract V4I8Regs:$s,2), (V4i8Extract V4I8Regs:$s,3))>; -// v4i16 -> i64 -def : Pat<(i64 (bitconvert V4I16Regs:$s)), - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), - (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), - (V4i16Extract V4I16Regs:$s,3))>; -// v2i8 -> i16 -def : Pat<(i16 (bitconvert V2I8Regs:$s)), - (V2I8toI16 (V2i8Extract V2I8Regs:$s,0), (V2i8Extract V2I8Regs:$s,1))>; -// v2i16 -> i32 -def : Pat<(i32 (bitconvert V2I16Regs:$s)), - (V2I16toI32 (V2i16Extract V2I16Regs:$s,0), - (V2i16Extract V2I16Regs:$s,1))>; -// v2i32 -> i64 -def : Pat<(i64 (bitconvert V2I32Regs:$s)), - (V2I32toI64 (V2i32Extract V2I32Regs:$s,0), - (V2i32Extract V2I32Regs:$s,1))>; - -// Int scalar to int vector bit convert -let VecInstType=isVecDest.Value in { -// i32 -> v4i8 -def VecI32toV4I8 : NVPTXVecInst<(outs V4I8Regs:$d), (ins Int32Regs:$s), - "Error!", - [(set V4I8Regs:$d, (bitconvert Int32Regs:$s))], - I32toV4I8>; -// i64 -> v4i16 -def VecI64toV4I16 : NVPTXVecInst<(outs V4I16Regs:$d), (ins Int64Regs:$s), - "Error!", - [(set V4I16Regs:$d, (bitconvert Int64Regs:$s))], - I64toV4I16>; -// i16 -> v2i8 -def VecI16toV2I8 : NVPTXVecInst<(outs V2I8Regs:$d), (ins Int16Regs:$s), - "Error!", - [(set V2I8Regs:$d, (bitconvert Int16Regs:$s))], - I16toV2I8>; -// i32 -> v2i16 -def VecI32toV2I16 : NVPTXVecInst<(outs V2I16Regs:$d), (ins Int32Regs:$s), - "Error!", - [(set V2I16Regs:$d, (bitconvert Int32Regs:$s))], - I32toV2I16>; -// i64 -> v2i32 -def VecI64toV2I32 : NVPTXVecInst<(outs V2I32Regs:$d), (ins Int64Regs:$s), - "Error!", - [(set V2I32Regs:$d, (bitconvert Int64Regs:$s))], - I64toV2I32>; -} - -// Int vector to int vector bit convert -// v4i8 -> v2i16 -def : Pat<(v2i16 (bitconvert V4I8Regs:$s)), - (VecI32toV2I16 - (V4I8toI32 (V4i8Extract V4I8Regs:$s,0), (V4i8Extract V4I8Regs:$s,1), - (V4i8Extract V4I8Regs:$s,2), (V4i8Extract V4I8Regs:$s,3)))>; -// v4i16 -> v2i32 -def : Pat<(v2i32 (bitconvert V4I16Regs:$s)), - (VecI64toV2I32 - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), (V4i16Extract V4I16Regs:$s,3)))>; -// v2i16 -> v4i8 -def : Pat<(v4i8 (bitconvert V2I16Regs:$s)), - (VecI32toV4I8 - (V2I16toI32 (V2i16Extract V2I16Regs:$s,0), (V2i16Extract V2I16Regs:$s,1)))>; -// v2i32 -> v4i16 -def : Pat<(v4i16 (bitconvert V2I32Regs:$s)), - (VecI64toV4I16 - (V2I32toI64 (V2i32Extract V2I32Regs:$s,0), (V2i32Extract V2I32Regs:$s,1)))>; -// v2i64 -> v4i32 -def : Pat<(v4i32 (bitconvert V2I64Regs:$s)), - (Build_Vector4_i32 - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 0)), 0), - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 0)), 1), - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 1)), 0), - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 1)), 1))>; -// v4i32 -> v2i64 -def : Pat<(v2i64 (bitconvert V4I32Regs:$s)), - (Build_Vector2_i64 - (V2I32toI64 (V4i32Extract V4I32Regs:$s,0), (V4i32Extract V4I32Regs:$s,1)), - (V2I32toI64 (V4i32Extract V4I32Regs:$s,2), (V4i32Extract V4I32Regs:$s,3)))>; - -// Fp scalar to fp vector convert -// f64 -> v2f32 -let VecInstType=isVecDest.Value in { -def VecF64toV2F32 : NVPTXVecInst<(outs V2F32Regs:$d), (ins Float64Regs:$s), - "Error!", - [(set V2F32Regs:$d, (bitconvert Float64Regs:$s))], - F64toV2F32>; -} - -// Fp vector to fp scalar convert -// v2f32 -> f64 -def : Pat<(f64 (bitconvert V2F32Regs:$s)), - (V2F32toF64 (V2f32Extract V2F32Regs:$s,0), (V2f32Extract V2F32Regs:$s,1))>; - -// Fp scalar to int vector convert -// f32 -> v4i8 -def : Pat<(v4i8 (bitconvert Float32Regs:$s)), - (VecI32toV4I8 (BITCONVERT_32_F2I Float32Regs:$s))>; -// f32 -> v2i16 -def : Pat<(v2i16 (bitconvert Float32Regs:$s)), - (VecI32toV2I16 (BITCONVERT_32_F2I Float32Regs:$s))>; -// f64 -> v4i16 -def : Pat<(v4i16 (bitconvert Float64Regs:$s)), - (VecI64toV4I16 (BITCONVERT_64_F2I Float64Regs:$s))>; -// f64 -> v2i32 -def : Pat<(v2i32 (bitconvert Float64Regs:$s)), - (VecI64toV2I32 (BITCONVERT_64_F2I Float64Regs:$s))>; - -// Int vector to fp scalar convert -// v4i8 -> f32 -def : Pat<(f32 (bitconvert V4I8Regs:$s)), - (BITCONVERT_32_I2F - (V4I8toI32 (V4i8Extract V4I8Regs:$s,0), (V4i8Extract V4I8Regs:$s,1), - (V4i8Extract V4I8Regs:$s,2), (V4i8Extract V4I8Regs:$s,3)))>; -// v4i16 -> f64 -def : Pat<(f64 (bitconvert V4I16Regs:$s)), - (BITCONVERT_64_I2F - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), (V4i16Extract V4I16Regs:$s,3)))>; -// v2i16 -> f32 -def : Pat<(f32 (bitconvert V2I16Regs:$s)), - (BITCONVERT_32_I2F - (V2I16toI32 (V2i16Extract V2I16Regs:$s,0), (V2i16Extract V2I16Regs:$s,1)))>; -// v2i32 -> f64 -def : Pat<(f64 (bitconvert V2I32Regs:$s)), - (BITCONVERT_64_I2F - (V2I32toI64 (V2i32Extract V2I32Regs:$s,0), (V2i32Extract V2I32Regs:$s,1)))>; - -// Int scalar to fp vector convert -// i64 -> v2f32 -def : Pat<(v2f32 (bitconvert Int64Regs:$s)), - (VecF64toV2F32 (BITCONVERT_64_I2F Int64Regs:$s))>; - -// Fp vector to int scalar convert -// v2f32 -> i64 -def : Pat<(i64 (bitconvert V2F32Regs:$s)), - (BITCONVERT_64_F2I - (V2F32toF64 (V2f32Extract V2F32Regs:$s,0), (V2f32Extract V2F32Regs:$s,1)))>; - -// Int vector to fp vector convert -// v2i64 -> v4f32 -def : Pat<(v4f32 (bitconvert V2I64Regs:$s)), - (Build_Vector4_f32 - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 0)), 0)), - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 0)), 1)), - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 1)), 0)), - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 1)), 1)))>; -// v2i64 -> v2f64 -def : Pat<(v2f64 (bitconvert V2I64Regs:$s)), - (Build_Vector2_f64 - (BITCONVERT_64_I2F (V2i64Extract V2I64Regs:$s,0)), - (BITCONVERT_64_I2F (V2i64Extract V2I64Regs:$s,1)))>; -// v2i32 -> v2f32 -def : Pat<(v2f32 (bitconvert V2I32Regs:$s)), - (Build_Vector2_f32 - (BITCONVERT_32_I2F (V2i32Extract V2I32Regs:$s,0)), - (BITCONVERT_32_I2F (V2i32Extract V2I32Regs:$s,1)))>; -// v4i32 -> v2f64 -def : Pat<(v2f64 (bitconvert V4I32Regs:$s)), - (Build_Vector2_f64 - (BITCONVERT_64_I2F (V2I32toI64 (V4i32Extract V4I32Regs:$s,0), - (V4i32Extract V4I32Regs:$s,1))), - (BITCONVERT_64_I2F (V2I32toI64 (V4i32Extract V4I32Regs:$s,2), - (V4i32Extract V4I32Regs:$s,3))))>; -// v4i32 -> v4f32 -def : Pat<(v4f32 (bitconvert V4I32Regs:$s)), - (Build_Vector4_f32 - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,0)), - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,1)), - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,2)), - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,3)))>; -// v4i16 -> v2f32 -def : Pat<(v2f32 (bitconvert V4I16Regs:$s)), - (VecF64toV2F32 (BITCONVERT_64_I2F - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), - (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), - (V4i16Extract V4I16Regs:$s,3))))>; - -// Fp vector to int vector convert -// v2i64 <- v4f32 -def : Pat<(v2i64 (bitconvert V4F32Regs:$s)), - (Build_Vector2_i64 - (BITCONVERT_64_F2I (V2F32toF64 (V4f32Extract V4F32Regs:$s,0), - (V4f32Extract V4F32Regs:$s,1))), - (BITCONVERT_64_F2I (V2F32toF64 (V4f32Extract V4F32Regs:$s,2), - (V4f32Extract V4F32Regs:$s,3))))>; -// v2i64 <- v2f64 -def : Pat<(v2i64 (bitconvert V2F64Regs:$s)), - (Build_Vector2_i64 - (BITCONVERT_64_F2I (V2f64Extract V2F64Regs:$s,0)), - (BITCONVERT_64_F2I (V2f64Extract V2F64Regs:$s,1)))>; -// v2i32 <- v2f32 -def : Pat<(v2i32 (bitconvert V2F32Regs:$s)), - (Build_Vector2_i32 - (BITCONVERT_32_F2I (V2f32Extract V2F32Regs:$s,0)), - (BITCONVERT_32_F2I (V2f32Extract V2F32Regs:$s,1)))>; -// v4i32 <- v2f64 -def : Pat<(v4i32 (bitconvert V2F64Regs:$s)), - (Build_Vector4_i32 - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 0)), 0)), - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 0)), 1)), - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 1)), 0)), - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 1)), 1)))>; -// v4i32 <- v4f32 -def : Pat<(v4i32 (bitconvert V4F32Regs:$s)), - (Build_Vector4_i32 - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,0)), - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,1)), - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,2)), - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,3)))>; -// v4i16 <- v2f32 -def : Pat<(v4i16 (bitconvert V2F32Regs:$s)), - (VecI64toV4I16 (BITCONVERT_64_F2I - (V2F32toF64 (V2f32Extract V2F32Regs:$s,0), - (V2f32Extract V2F32Regs:$s,1))))>; diff --git a/gnu/llvm/lib/Target/PowerPC/p9-instrs.txt b/gnu/llvm/lib/Target/PowerPC/p9-instrs.txt deleted file mode 100644 index a70582aca39..00000000000 --- a/gnu/llvm/lib/Target/PowerPC/p9-instrs.txt +++ /dev/null @@ -1,442 +0,0 @@ -Content: -======== -. Remaining Instructions (Total 56 Instructions, include 2 unknow instructions) -. Done (Total 155 Instructions: 101 VSX, 54 Altivec) - -//------------------------------------------------------------------------------ -//. Remaining Instructions -//------------------------------------------------------------------------------ -GCC reference: https://sourceware.org/ml/binutils/2015-11/msg00071.html - -// Add PC Immediate Shifted DX-form p69 -[PO RT d1 d0 XO d2] addpcis RT,D - subpcis Rx,value = addpcis Rx,-value - -// 6.17.2 Decimal Integer Format Conversion Instructions - -// Decimal Convert From National VX-form p352 -[PO VRT EO VRB 1 PS XO] bcdcfn. VRT,VRB,PS - -// Decimal Convert From Zoned VX-form p353 -[PO VRT EO VRB 1 PS XO] bcdcfz. VRT,VRB,PS - -// Decimal Convert To National VX-form p354 -[PO VRT EO VRB 1 / XO] bcdctn. VRT,VRB - -// Decimal Convert To Zoned VX-form p355 -[PO VRT EO VRB 1 PS XO] bcdctz. VRT,VRB,PS - -// Decimal Convert From Signed Quadword VX-form p356 -[PO VRT EO VRB 1 PS XO] bcdcfsq. VRT,VRB,PS - -// Decimal Convert To Signed Quadword VX-form p356 -[PO VRT EO VRB 1 / XO] bcdctsq. VRT,VRB - -// 6.17.3 Decimal Integer Sign Manipulation Instructions - -// Decimal Copy Sign VX-form p358 -[PO VRT VRA VRB XO] bcdcpsgn. VRT,VRA,VRB - -// Decimal Set Sign VX-form p358 -[PO VRT EO VRB 1 PS XO] bcdsetsgn. VRT,VRB,PS - -// Decimal Shift VX-form p359 -[PO VRT VRA VRB 1 PS XO] bcds. VRT,VRA,VRB,PS - -// Decimal Unsigned Shift VX-form p360 -[PO VRT VRA VRB 1 / XO] bcdus. VRT,VRA,VRB - -// Decimal Shift and Round VX-form p361 -[PO VRT VRA VRB 1 PS XO] bcdsr. VRT,VRA,VRB,PS - -// 6.17.5 Decimal Integer Truncate Instructions - -// Decimal Truncate VX-form p362 -[PO VRT VRA VRB 1 PS XO] bcdtrunc. VRT,VRA,VRB,PS - -// Decimal Unsigned Truncate VX-form p363 -[PO VRT VRA VRB 1 / XO] bcdutrunc. VRT,VRA,VRB - -// 3.3.10.1 Character-Type Compare Instructions - -// Compare Ranged Byte X-form p87 -[PO BF / L RA RB XO /] cmprb BF,L,RA,RB - -// Compare Equal Byte X-form p88 -[PO BF // RA RB XO /] cmpeqb BF,RA,RB - -// 3.3.13 Fixed-Point Logical Instructions - -// Count Trailing Zeros Word X-form p95 -[PO RS RA /// XO Rc] cnttzw(.) RA,RS - -// 3.3.13.1 64-bit Fixed-Point Logical Instructions - -// Count Trailing Zeros Doubleword X-form p98 -[PO RS RA /// XO Rc] cnttzd(.) RA,RS - -// 4.4 Copy-Paste Facility - -// Copy X-form p858 -[PO /// L RA RB XO /] copy RA,RB,L - copy_first = copy RA, RB, 1 -// CP_Abort p860 -[PO /// /// /// XO /] cp_abort - -// Paste p859 -[PO /// L RA RB XO Rc] paste(.) RA,RB,L - paste_last = paste RA,RB,1 - -// 3.3.9 Fixed-Point Arithmetic Instructions - -// Deliver A Random Number X-form p79 -[PO RT /// L /// XO /] darn RT,L - -// Multiply-Add High Doubleword VA-form p81 -[PO RT RA RB RC XO] maddhd RT,RA.RB,RC - -// Multiply-Add High Doubleword Unsigned VA-form p81 -[PO RT RA RB RC XO] maddhdu RT,RA.RB,RC - -// Multiply-Add Low Doubleword VA-form p81 -[PO RT RA RB RC XO] maddld RT,RA.RB,RC - -// Modulo Signed Word X-form p76 -[PO RT RA RB XO /] modsw RT,RA,RB - -// Modulo Unsigned Word X-form p76 -[PO RT RA RB XO /] moduw RT,RA,RB - -// Modulo Signed Doubleword X-form p84 -[PO RT RA RB XO /] modsd RT,RA,RB - -// Modulo Unsigned Doubleword X-form p84 -[PO RT RA RB XO /] modud RT,RA,RB - - -// DFP Test Significance Immediate [Quad] X-form p204 -[PO BF / UIM FRB XO /] dtstsfi BF,UIM,FRB -[PO BF / UIM FRBp XO /] dtstsfiq BF,UIM,FRBp - -// 3.3.14.2.1 64-bit Fixed-Point Shift Instructions - -// Extend-Sign Word and Shift Left Immediate XS-form p109 -[PO RS RA sh XO sh Rc] extswsli(.) RA,RS,SH - -// 4.5.1 Load Atomic - -// Load Word Atomic X-form p864 -[PO RT RA FC XO /] lwat RT,RA,FC - -// Load Doubleword Atomic X-form p864 -[PO RT RA FC XO /] ldat RT,RA,FC - -// 4.5.2 Store Atomic - -// Store Word Atomic X-form p866 -[PO RS RA FC XO /] stwat RS,RA,FC - -// Store Doubleword Atomic X-form p866 -[PO RS RA FC XO /] stdat RS,RA,FC - -// 3.3.2.1 64-bit Fixed-Point Load Instructions - -// Load Doubleword Monitored Indexed X-form p54 -[PO RT RA RB XO /] ldmx RT,RA,RB - -// 3.3.16 Move To/From Vector-Scalar Register Instructions - -// Move From VSR Lower Doubleword XX1-form p111 -[PO S RA /// XO SX] mfvsrld RA,XS - -// Move To VSR Double Doubleword XX1-form p114 -[PO T RA RB XO TX] mtvsrdd XT,RA,RB - -// Move To VSR Word & Splat XX1-form p115 -[PO T RA /// XO TX] mtvsrws XT,RA - -// Move to CR from XER Extended X-form p119 -[PO BF // /// /// XO /] mcrxrx BF - -// Set Boolean X-form p121 -[PO RT BFA // /// XO /] setb RT,BFA - -// Message Synchronize X-form p1126 -[PO /// /// /// XO /] msgsync - -// SLB Invalidate Entry Global X-form p1026 -[PO RS /// RB XO /] slbieg RS,RB - -// SLB Synchronize X-form p1031 -[PO /// /// /// XO /] slbsync - -// 3.3.2.1 Power-Saving Mode Instruction - -// stop XL-form p957 -[PO /// /// /// XO /] stop - -// 4.6.4 Wait Instruction -// Wait X-form p880 -[PO /// WC /// /// XO /] wait - -// Unknow Instructions: -urfid -- gcc's implementation: - {"urfid", XL(19,306), 0xffffffff, POWER9, PPCNONE, {0}}, - (4c 00 02 64|64 02 00 4c) urfid - -rmieg -- gcc's implementation: - {"rmieg", X(31,882), XRTRA_MASK, POWER9, PPCNONE, {RB}}, - (7c 00 f6 e4|e4 f6 00 7c) rmieg r30 - -//------------------------------------------------------------------------------ -//. Done: -//------------------------------------------------------------------------------ - -//====================================== -"vsx instructions" - -//-------------------------------------- -"7.6.1.2.1 VSX Scalar Move Instructions" -// VSX Scalar Quad-Precision Move Instructions - -// VSX Scalar Copy Sign Quad-Precision X-form p.553 -[PO VRT VRA VRB XO /] xscpsgnqp - -// VSX Scalar Absolute Quad-Precision X-form 531 -// VSX Scalar Negate Quad-Precision X-form 627 -// VSX Scalar Negative Absolute Quad-Precision X-form 626 -[PO VRT XO VRB XO /] xsabsqp xsnegqp xsnabsqp - -//-------------------------------------- -"7.6.1.3 VSX Floating-Point Arithmetic Instructions" - -// VSX Scalar Quad-Precision Elementary Arithmetic - -// VSX Scalar Add Quad-Precision [using round to Odd] X-form 539 -// VSX Scalar Divide Quad-Precision [using round to Odd] X-form 584 -// VSX Scalar Multiply Quad-Precision [using round to Odd] X-form 622 -[PO VRT VRA VRB XO RO] xsaddqp xsaddqpo xsdivqp xsdivqpo xsmulqp xsmulqpo - -// VSX Scalar Square Root Quad-Precision [using round to Odd] X-form 662 -// VSX Scalar Subtract Quad-Precision [using round to Odd] X-form 667 - xssubqp xssubqpo - -[PO VRT XO VRB XO RO] xssqrtqp xssqrtqpo - -// VSX Scalar Quad-Precision Multiply-Add Arithmetic Instructions - -// VSX Scalar Multiply-Add Quad-Precision [using round to Odd] X-form 596 -// VSX Scalar Multiply-Subtract Quad-Precision [using round to Odd] X-form 617 -// VSX Scalar Negative Multiply-Add Quad-Precision [using round to Odd] X-form 636 -// VSX Scalar Negative Multiply-Subtract Quad-Precision [using round to Odd] -// X-form 645 -[PO VRT VRA VRB XO RO] xsmaddqp xsmaddqpo xsmsubqp xsmsubqpo - xsnmaddqp xsnmaddqpo xsnmsubqp xsnmsubqpo - -22 -//-------------------------------------- -"7.6.1.4 VSX Floating-Point Compare Instructions" - -// VSX Scalar Quad-Precision Compare Instructions - -// VSX Scalar Compare Ordered Quad-Precision X-form 549 -// VSX Scalar Compare Unordered Quad-Precision X-form 552 -[PO BF // VRA VRB XO /] xscmpoqp xscmpuqp - -"7.6.1.8 VSX Scalar Floating-Point Support Instructions" -// VSX Scalar Compare Exponents Quad-Precision X-form p. 541 542 -[PO BF // A B XO AX BX /] xscmpexpdp -[PO BF // VRA VRB XO /] xscmpexpqp - -// VSX Scalar Compare DP, XX3-form, p.543 544 545 -// VSX Scalar Compare Equal Double-Precision, -[PO T A B XO AX BX TX] xscmpeqdp xscmpgedp xscmpgtdp xscmpnedp - -// VSX Vector Compare Not Equal Double-Precision XX3-form 691 -[PO T A B Rc XO AX BX TX] xvcmpnedp xvcmpnedp. xvcmpnesp xvcmpnesp. - -//-------------------------------------- -"7.6.1.5 VSX FP-FP Conversion Instructions" -// VSX Scalar Quad-Precision Floating-Point Conversion Instructions - -// VSX Scalar round & Convert Quad-Precision format to Double-Precision format -// [using round to Odd] X-form 567 -[PO VRT XO VRB XO /] xscvqpdp xscvqpdpo (actually [PO VRT XO VRB XO RO]) -[PO VRT XO VRB XO /] xscvdpqp - -// VSX Scalar Quad-Precision Convert to Integer Instructions - -// VSX Scalar truncate & Convert Quad-Precision format to Signed Doubleword format -// 568 570 572 574 -[PO VRT XO VRB XO /] xscvqpsdz xscvqpswz xscvqpudz xscvqpuwz -576 = 580 xscvsdqp xscvudqp - -"7.6.1.7 VSX Round to Floating-Point Integer Instructions" -// VSX Scalar round & Convert Double-Precision format to Half-Precision format -// XX2-form 554 566 -[PO T XO B XO BX TX] xscvdphp xscvhpdp - -// VSX Vector Convert Half-Precision format to Single-Precision format -// XX2-form 703 705 -[PO T XO B XO BX TX] xvcvhpsp xvcvsphp - -// VSX Scalar Round to Quad-Precision Integer [with Inexact] Z23-form 654 -[PO VRT /// R VRB RMC XO EX] xsrqpi xsrqpix - -// VSX Scalar Round Quad-Precision to Double-Extended Precision Z23-form 656 -[PO VRT /// R VRB RMC XO /] xsrqpxp -def XSRQPXP : Z23Form_1<63, 37, - (outs vrrc:$vT), (ins u5imm:$R, vrrc:$vB, u2imm:$RMC), - "xsrqpxp $vT, $R, $vB, $RMC"), IIC_VecFP, []>; - -27~28 -//-------------------------------------- -// VSX Scalar Insert Exponent Double-Precision X-form 588 -// VSX Scalar Insert Exponent Quad-Precision X-form 589 -[PO VT rA rB XO /] xsiexpdp -[PO VRT VRA VRB XO /] xsiexpqp - -// VSX Vector Insert Exponent Double-Precision XX3-form 722 -[PO T A B XO AX BX TX] xviexpdp xviexpsp - -// VSX Vector Extract Unsigned Word XX2-form 788 -// VSX Vector Insert Word XX2-form -[PO T / UIM B XO BX TX] xxextractuw xxinsertw - -// VSX Scalar Extract Exponent Double-Precision XX2-form 676 -[PO BF DCMX B XO BX /] -[PO T XO B XO BX /] xsxexpdp xsxsigdp -// X-form -[PO VRT XO VRB XO /] xsxexpqp xsxsigqp - -// VSX Vector Extract Exponent Double-Precision XX2-form 784 -[PO T XO B XO BX TX] xvxexpdp xvxexpsp - -// VSX Vector Extract Significand Double-Precision XX2-form 785 -[PO T XO B XO BX TX] xvxsigdp xvxsigsp - -//-------------------------------------- -// VSX Scalar Test Data Class Double-Precision XX2-form p673 -// VSX Scalar Test Data Class Quad-Precision X-form 674 -// VSX Scalar Test Data Class Single-Precision XX2-form 675 -[PO BF DCMX B XO BX /] xststdcdp xststdcsp -[PO BF DCMX VRB XO /] xststdcqp - -// VSX Vector Test Data Class Double-Precision XX2-form 782 783 -[PO T dx B XO dc XO dm BX TX] xvtstdcdp xvtstdcsp - -//-------------------------------------- -// VSX Scalar Maximum Type-C Double-Precision XX3-form 601 ~ 609 -[PO T A B XO AX BX TX] xsmaxcdp xsmaxjdp xsmincdp xsminjdp - -//-------------------------------------- -// VSX Vector Byte-Reverse Doubleword XX2-form 786 787 -[PO T XO B XO BX TX] xxbrd xxbrh xxbrq xxbrw - -// VSX Vector Permute XX3-form 794 -[PO T A B XO AX BX TX] xxperm xxpermr - -// VSX Vector Splat Immediate Byte 796 x-form -[PO T EO IMM8 XO TX] xxspltib <= sign or unsigned? - -30 -//-------------------------------------- -// Load VSX Vector DQ-form 511 -[PO T RA DQ TX XO] lxv - -// Store VSX Vector DQ-form 526 -[PO S RA DQ SX XO] stxv - -// Load VSX Scalar Doubleword DS-form 499 -// Load VSX Scalar Single DS-form 504 -[PO VRT RA DS XO] lxsd lxssp - -// Store VSX Scalar Doubleword DS-form 517 -// Store VSX Scalar Single DS-form 520 -[PO VRT RA DS XO] stxsd stxssp - - -// Load VSX Vector Indexed X-form 511 -// Load VSX Scalar as Integer Byte & Zero Indexed X-form 501 -// Load VSX Vector Byte*16 Indexed X-form 506 -// Load VSX Vector with Length X-form 508 -// Load VSX Vector Left-justified with Length X-form 510 -// Load VSX Vector Halfword*8 Indexed X-form 514 -// Load VSX Vector Word & Splat Indexed X-form 516 -[PO T RA RB XO TX] lxvx lxsibzx lxsihzx lxvb16x lxvl lxvll lxvh8x lxvwsx - -// Store VSX Scalar as Integer Byte Indexed X-form 518 -// Store VSX Scalar as Integer Halfword Indexed X-form 518 -// Store VSX Vector Byte*16 Indexed X-form 522 -// Store VSX Vector Halfword*8 Indexed X-form 524 -// Store VSX Vector with Length X-form 526 -// Store VSX Vector Left-justified with Length X-form 528 -// Store VSX Vector Indexed X-form 529 -[PO S RA RB XO SX] stxsibx stxsihx stxvb16x stxvh8x stxvl stxvll stxvx - -21 - -//-------------------------------------- -". vector instructions" - -[1] PowerISA-v3.0 p.933 - Table 1, and Chapter 6. Vector Facility (altivec) -[2] https://sourceware.org/ml/binutils/2015-11/msg00071.html - -//-------------------------------------- -New patch: -// vector bit, p.367, 6.16 Vector Bit Permute Instruction -[PO VRT VRA VRB XO] vbpermd, (existing: vbpermq) - -// vector permute, p.280 -[PO VRT VRA VRB VRC XO] vpermr - -// vector rotate left, p.341 -[PO VRT VRA VRB XO] vrlwnm vrlwmi vrldnm vrldmi - -// vector shift, p.285 -[PO VRT VRA VRB XO] vslv vsrv - -// vector multiply-by-10, p.375 -[PO VRT VRA /// XO] vmul10cuq vmul10uq -[PO VRT VRA VRB XO] vmul10ecuq vmul10euq - -12 -//-------------------------------------- -http://reviews.llvm.org/D15887 + ext + neg + prty - vbpermd -// vector count leading/trailing zero -. new vx-form: p.31, 1.6.14 VX-FORM -[PO RT EO VRB XO] vclzlsbb vctzlsbb (p.363) - -// Vector Count Trailing Zeros Instructions, 362 -[PO VRT EO VRB XO] vctzb vctzh vctzw vctzd (v16i8 v8i16 v4i32 v2i64) - -// vector extend sign (p.314) -[PO VRT EO VRB XO] vextsb2w vextsh2w vextsb2d vextsh2d vextsw2d - -// vector negate, p.313 -[PO VRT EO VRB XO] vnegd vnegw - -// vector parity, p.335 -[PO VRT EO VRB XO] vprtybd vprtybq vprtybw - -16 -//-------------------------------------- -// vector compare, p.330 -[PO VRT VRA VRB RC XO] vcmpneb vcmpneb. vcmpneh vcmpneh. vcmpnew vcmpnew. - vcmpnezb vcmpnezb. vcmpnezh vcmpnezh. vcmpnezw vcmpnezw. -12 -//-------------------------------------- -http://reviews.llvm.org/D15917 + insert -// vector extract (p.287) ref: vspltb (v2.07, p.227) -// vector insert, p.288 -[PO VRT / UIM VRB XO] vinsertb vinsertd vinserth vinsertw - -// Vector Extract Unsigned -[PO VRT / UIM VRB XO] vextractub vextractuh vextractuw vextractd - -// p.364: Vector Extract Unsigned Left/Right-Indexed -[PO RT RA VRB XO] vextublx vextubrx vextuhlx vextuhrx vextuwlx vextuwrx - -14 diff --git a/gnu/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp b/gnu/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp deleted file mode 100644 index 3b15a0a3e60..00000000000 --- a/gnu/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp +++ /dev/null @@ -1,96 +0,0 @@ -//===- CmpInstAnalysis.cpp - Utils to help fold compares ---------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file holds routines to help analyse compare instructions -// and fold them into constants or other compare instructions -// -//===----------------------------------------------------------------------===// - -#include "llvm/Transforms/Utils/CmpInstAnalysis.h" -#include "llvm/IR/Constants.h" -#include "llvm/IR/Instructions.h" - -using namespace llvm; - -/// getICmpCode - Encode a icmp predicate into a three bit mask. These bits -/// are carefully arranged to allow folding of expressions such as: -/// -/// (A < B) | (A > B) --> (A != B) -/// -/// Note that this is only valid if the first and second predicates have the -/// same sign. Is illegal to do: (A u< B) | (A s> B) -/// -/// Three bits are used to represent the condition, as follows: -/// 0 A > B -/// 1 A == B -/// 2 A < B -/// -/// <=> Value Definition -/// 000 0 Always false -/// 001 1 A > B -/// 010 2 A == B -/// 011 3 A >= B -/// 100 4 A < B -/// 101 5 A != B -/// 110 6 A <= B -/// 111 7 Always true -/// -unsigned llvm::getICmpCode(const ICmpInst *ICI, bool InvertPred) { - ICmpInst::Predicate Pred = InvertPred ? ICI->getInversePredicate() - : ICI->getPredicate(); - switch (Pred) { - // False -> 0 - case ICmpInst::ICMP_UGT: return 1; // 001 - case ICmpInst::ICMP_SGT: return 1; // 001 - case ICmpInst::ICMP_EQ: return 2; // 010 - case ICmpInst::ICMP_UGE: return 3; // 011 - case ICmpInst::ICMP_SGE: return 3; // 011 - case ICmpInst::ICMP_ULT: return 4; // 100 - case ICmpInst::ICMP_SLT: return 4; // 100 - case ICmpInst::ICMP_NE: return 5; // 101 - case ICmpInst::ICMP_ULE: return 6; // 110 - case ICmpInst::ICMP_SLE: return 6; // 110 - // True -> 7 - default: - llvm_unreachable("Invalid ICmp predicate!"); - } -} - -/// getICmpValue - This is the complement of getICmpCode, which turns an -/// opcode and two operands into either a constant true or false, or the -/// predicate for a new ICmp instruction. The sign is passed in to determine -/// which kind of predicate to use in the new icmp instruction. -/// Non-NULL return value will be a true or false constant. -/// NULL return means a new ICmp is needed. The predicate for which is -/// output in NewICmpPred. -Value *llvm::getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS, - CmpInst::Predicate &NewICmpPred) { - switch (Code) { - default: llvm_unreachable("Illegal ICmp code!"); - case 0: // False. - return ConstantInt::get(CmpInst::makeCmpResultType(LHS->getType()), 0); - case 1: NewICmpPred = Sign ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; break; - case 2: NewICmpPred = ICmpInst::ICMP_EQ; break; - case 3: NewICmpPred = Sign ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE; break; - case 4: NewICmpPred = Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT; break; - case 5: NewICmpPred = ICmpInst::ICMP_NE; break; - case 6: NewICmpPred = Sign ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_ULE; break; - case 7: // True. - return ConstantInt::get(CmpInst::makeCmpResultType(LHS->getType()), 1); - } - return nullptr; -} - -/// PredicatesFoldable - Return true if both predicates match sign or if at -/// least one of them is an equality comparison (which is signless). -bool llvm::PredicatesFoldable(ICmpInst::Predicate p1, ICmpInst::Predicate p2) { - return (CmpInst::isSigned(p1) == CmpInst::isSigned(p2)) || - (CmpInst::isSigned(p1) && ICmpInst::isEquality(p2)) || - (CmpInst::isSigned(p2) && ICmpInst::isEquality(p1)); -} diff --git a/gnu/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h b/gnu/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h deleted file mode 100644 index 931190e43a6..00000000000 --- a/gnu/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h +++ /dev/null @@ -1,480 +0,0 @@ -//=== AnalysisContext.h - Analysis context for Path Sens analysis --*- C++ -*-// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines AnalysisDeclContext, a class that manages the analysis -// context data for path sensitive analysis. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H -#define LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H - -#include "clang/AST/Decl.h" -#include "clang/Analysis/CFG.h" -#include "clang/Analysis/CodeInjector.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/FoldingSet.h" -#include "llvm/Support/Allocator.h" -#include <memory> - -namespace clang { - -class Stmt; -class CFGReverseBlockReachabilityAnalysis; -class CFGStmtMap; -class LiveVariables; -class ManagedAnalysis; -class ParentMap; -class PseudoConstantAnalysis; -class LocationContextManager; -class StackFrameContext; -class BlockInvocationContext; -class AnalysisDeclContextManager; -class LocationContext; - -namespace idx { class TranslationUnit; } - -/// The base class of a hierarchy of objects representing analyses tied -/// to AnalysisDeclContext. -class ManagedAnalysis { -protected: - ManagedAnalysis() {} -public: - virtual ~ManagedAnalysis(); - - // Subclasses need to implement: - // - // static const void *getTag(); - // - // Which returns a fixed pointer address to distinguish classes of - // analysis objects. They also need to implement: - // - // static [Derived*] create(AnalysisDeclContext &Ctx); - // - // which creates the analysis object given an AnalysisDeclContext. -}; - - -/// AnalysisDeclContext contains the context data for the function or method -/// under analysis. -class AnalysisDeclContext { - /// Backpoint to the AnalysisManager object that created this - /// AnalysisDeclContext. This may be null. - AnalysisDeclContextManager *Manager; - - const Decl * const D; - - std::unique_ptr<CFG> cfg, completeCFG; - std::unique_ptr<CFGStmtMap> cfgStmtMap; - - CFG::BuildOptions cfgBuildOptions; - CFG::BuildOptions::ForcedBlkExprs *forcedBlkExprs; - - bool builtCFG, builtCompleteCFG; - std::unique_ptr<ParentMap> PM; - std::unique_ptr<PseudoConstantAnalysis> PCA; - std::unique_ptr<CFGReverseBlockReachabilityAnalysis> CFA; - - llvm::BumpPtrAllocator A; - - llvm::DenseMap<const BlockDecl*,void*> *ReferencedBlockVars; - - void *ManagedAnalyses; - -public: - AnalysisDeclContext(AnalysisDeclContextManager *Mgr, - const Decl *D); - - AnalysisDeclContext(AnalysisDeclContextManager *Mgr, - const Decl *D, - const CFG::BuildOptions &BuildOptions); - - ~AnalysisDeclContext(); - - ASTContext &getASTContext() const { return D->getASTContext(); } - const Decl *getDecl() const { return D; } - - /// Return the AnalysisDeclContextManager (if any) that created - /// this AnalysisDeclContext. - AnalysisDeclContextManager *getManager() const { - return Manager; - } - - /// Return the build options used to construct the CFG. - CFG::BuildOptions &getCFGBuildOptions() { - return cfgBuildOptions; - } - - const CFG::BuildOptions &getCFGBuildOptions() const { - return cfgBuildOptions; - } - - /// getAddEHEdges - Return true iff we are adding exceptional edges from - /// callExprs. If this is false, then try/catch statements and blocks - /// reachable from them can appear to be dead in the CFG, analysis passes must - /// cope with that. - bool getAddEHEdges() const { return cfgBuildOptions.AddEHEdges; } - bool getUseUnoptimizedCFG() const { - return !cfgBuildOptions.PruneTriviallyFalseEdges; - } - bool getAddImplicitDtors() const { return cfgBuildOptions.AddImplicitDtors; } - bool getAddInitializers() const { return cfgBuildOptions.AddInitializers; } - - void registerForcedBlockExpression(const Stmt *stmt); - const CFGBlock *getBlockForRegisteredExpression(const Stmt *stmt); - - /// \brief Get the body of the Declaration. - Stmt *getBody() const; - - /// \brief Get the body of the Declaration. - /// \param[out] IsAutosynthesized Specifies if the body is auto-generated - /// by the BodyFarm. - Stmt *getBody(bool &IsAutosynthesized) const; - - /// \brief Checks if the body of the Decl is generated by the BodyFarm. - /// - /// Note, the lookup is not free. We are going to call getBody behind - /// the scenes. - /// \sa getBody - bool isBodyAutosynthesized() const; - - /// \brief Checks if the body of the Decl is generated by the BodyFarm from a - /// model file. - /// - /// Note, the lookup is not free. We are going to call getBody behind - /// the scenes. - /// \sa getBody - bool isBodyAutosynthesizedFromModelFile() const; - - CFG *getCFG(); - - CFGStmtMap *getCFGStmtMap(); - - CFGReverseBlockReachabilityAnalysis *getCFGReachablityAnalysis(); - - /// Return a version of the CFG without any edges pruned. - CFG *getUnoptimizedCFG(); - - void dumpCFG(bool ShowColors); - - /// \brief Returns true if we have built a CFG for this analysis context. - /// Note that this doesn't correspond to whether or not a valid CFG exists, it - /// corresponds to whether we *attempted* to build one. - bool isCFGBuilt() const { return builtCFG; } - - ParentMap &getParentMap(); - PseudoConstantAnalysis *getPseudoConstantAnalysis(); - - typedef const VarDecl * const * referenced_decls_iterator; - - llvm::iterator_range<referenced_decls_iterator> - getReferencedBlockVars(const BlockDecl *BD); - - /// Return the ImplicitParamDecl* associated with 'self' if this - /// AnalysisDeclContext wraps an ObjCMethodDecl. Returns NULL otherwise. - const ImplicitParamDecl *getSelfDecl() const; - - const StackFrameContext *getStackFrame(LocationContext const *Parent, - const Stmt *S, - const CFGBlock *Blk, - unsigned Idx); - - const BlockInvocationContext * - getBlockInvocationContext(const LocationContext *parent, - const BlockDecl *BD, - const void *ContextData); - - /// Return the specified analysis object, lazily running the analysis if - /// necessary. Return NULL if the analysis could not run. - template <typename T> - T *getAnalysis() { - const void *tag = T::getTag(); - ManagedAnalysis *&data = getAnalysisImpl(tag); - if (!data) { - data = T::create(*this); - } - return static_cast<T*>(data); - } -private: - ManagedAnalysis *&getAnalysisImpl(const void* tag); - - LocationContextManager &getLocationContextManager(); -}; - -class LocationContext : public llvm::FoldingSetNode { -public: - enum ContextKind { StackFrame, Scope, Block }; - -private: - ContextKind Kind; - - // AnalysisDeclContext can't be const since some methods may modify its - // member. - AnalysisDeclContext *Ctx; - - const LocationContext *Parent; - -protected: - LocationContext(ContextKind k, AnalysisDeclContext *ctx, - const LocationContext *parent) - : Kind(k), Ctx(ctx), Parent(parent) {} - -public: - virtual ~LocationContext(); - - ContextKind getKind() const { return Kind; } - - AnalysisDeclContext *getAnalysisDeclContext() const { return Ctx; } - - const LocationContext *getParent() const { return Parent; } - - bool isParentOf(const LocationContext *LC) const; - - const Decl *getDecl() const { return getAnalysisDeclContext()->getDecl(); } - - CFG *getCFG() const { return getAnalysisDeclContext()->getCFG(); } - - template <typename T> - T *getAnalysis() const { - return getAnalysisDeclContext()->getAnalysis<T>(); - } - - ParentMap &getParentMap() const { - return getAnalysisDeclContext()->getParentMap(); - } - - const ImplicitParamDecl *getSelfDecl() const { - return Ctx->getSelfDecl(); - } - - const StackFrameContext *getCurrentStackFrame() const; - - /// Return true if the current LocationContext has no caller context. - virtual bool inTopFrame() const; - - virtual void Profile(llvm::FoldingSetNodeID &ID) = 0; - - void dumpStack(raw_ostream &OS, StringRef Indent = "") const; - void dumpStack() const; - -public: - static void ProfileCommon(llvm::FoldingSetNodeID &ID, - ContextKind ck, - AnalysisDeclContext *ctx, - const LocationContext *parent, - const void *data); -}; - -class StackFrameContext : public LocationContext { - // The callsite where this stack frame is established. - const Stmt *CallSite; - - // The parent block of the callsite. - const CFGBlock *Block; - - // The index of the callsite in the CFGBlock. - unsigned Index; - - friend class LocationContextManager; - StackFrameContext(AnalysisDeclContext *ctx, const LocationContext *parent, - const Stmt *s, const CFGBlock *blk, - unsigned idx) - : LocationContext(StackFrame, ctx, parent), CallSite(s), - Block(blk), Index(idx) {} - -public: - ~StackFrameContext() override {} - - const Stmt *getCallSite() const { return CallSite; } - - const CFGBlock *getCallSiteBlock() const { return Block; } - - /// Return true if the current LocationContext has no caller context. - bool inTopFrame() const override { return getParent() == nullptr; } - - unsigned getIndex() const { return Index; } - - void Profile(llvm::FoldingSetNodeID &ID) override; - - static void Profile(llvm::FoldingSetNodeID &ID, AnalysisDeclContext *ctx, - const LocationContext *parent, const Stmt *s, - const CFGBlock *blk, unsigned idx) { - ProfileCommon(ID, StackFrame, ctx, parent, s); - ID.AddPointer(blk); - ID.AddInteger(idx); - } - - static bool classof(const LocationContext *Ctx) { - return Ctx->getKind() == StackFrame; - } -}; - -class ScopeContext : public LocationContext { - const Stmt *Enter; - - friend class LocationContextManager; - ScopeContext(AnalysisDeclContext *ctx, const LocationContext *parent, - const Stmt *s) - : LocationContext(Scope, ctx, parent), Enter(s) {} - -public: - ~ScopeContext() override {} - - void Profile(llvm::FoldingSetNodeID &ID) override; - - static void Profile(llvm::FoldingSetNodeID &ID, AnalysisDeclContext *ctx, - const LocationContext *parent, const Stmt *s) { - ProfileCommon(ID, Scope, ctx, parent, s); - } - - static bool classof(const LocationContext *Ctx) { - return Ctx->getKind() == Scope; - } -}; - -class BlockInvocationContext : public LocationContext { - const BlockDecl *BD; - - // FIXME: Come up with a more type-safe way to model context-sensitivity. - const void *ContextData; - - friend class LocationContextManager; - - BlockInvocationContext(AnalysisDeclContext *ctx, - const LocationContext *parent, - const BlockDecl *bd, const void *contextData) - : LocationContext(Block, ctx, parent), BD(bd), ContextData(contextData) {} - -public: - ~BlockInvocationContext() override {} - - const BlockDecl *getBlockDecl() const { return BD; } - - const void *getContextData() const { return ContextData; } - - void Profile(llvm::FoldingSetNodeID &ID) override; - - static void Profile(llvm::FoldingSetNodeID &ID, AnalysisDeclContext *ctx, - const LocationContext *parent, const BlockDecl *bd, - const void *contextData) { - ProfileCommon(ID, Block, ctx, parent, bd); - ID.AddPointer(contextData); - } - - static bool classof(const LocationContext *Ctx) { - return Ctx->getKind() == Block; - } -}; - -class LocationContextManager { - llvm::FoldingSet<LocationContext> Contexts; -public: - ~LocationContextManager(); - - const StackFrameContext *getStackFrame(AnalysisDeclContext *ctx, - const LocationContext *parent, - const Stmt *s, - const CFGBlock *blk, unsigned idx); - - const ScopeContext *getScope(AnalysisDeclContext *ctx, - const LocationContext *parent, - const Stmt *s); - - const BlockInvocationContext * - getBlockInvocationContext(AnalysisDeclContext *ctx, - const LocationContext *parent, - const BlockDecl *BD, - const void *ContextData); - - /// Discard all previously created LocationContext objects. - void clear(); -private: - template <typename LOC, typename DATA> - const LOC *getLocationContext(AnalysisDeclContext *ctx, - const LocationContext *parent, - const DATA *d); -}; - -class AnalysisDeclContextManager { - typedef llvm::DenseMap<const Decl*, AnalysisDeclContext*> ContextMap; - - ContextMap Contexts; - LocationContextManager LocContexts; - CFG::BuildOptions cfgBuildOptions; - - /// Pointer to an interface that can provide function bodies for - /// declarations from external source. - std::unique_ptr<CodeInjector> Injector; - - /// Flag to indicate whether or not bodies should be synthesized - /// for well-known functions. - bool SynthesizeBodies; - -public: - AnalysisDeclContextManager(bool useUnoptimizedCFG = false, - bool addImplicitDtors = false, - bool addInitializers = false, - bool addTemporaryDtors = false, - bool synthesizeBodies = false, - bool addStaticInitBranches = false, - bool addCXXNewAllocator = true, - CodeInjector* injector = nullptr); - - ~AnalysisDeclContextManager(); - - AnalysisDeclContext *getContext(const Decl *D); - - bool getUseUnoptimizedCFG() const { - return !cfgBuildOptions.PruneTriviallyFalseEdges; - } - - CFG::BuildOptions &getCFGBuildOptions() { - return cfgBuildOptions; - } - - /// Return true if faux bodies should be synthesized for well-known - /// functions. - bool synthesizeBodies() const { return SynthesizeBodies; } - - const StackFrameContext *getStackFrame(AnalysisDeclContext *Ctx, - LocationContext const *Parent, - const Stmt *S, - const CFGBlock *Blk, - unsigned Idx) { - return LocContexts.getStackFrame(Ctx, Parent, S, Blk, Idx); - } - - // Get the top level stack frame. - const StackFrameContext *getStackFrame(const Decl *D) { - return LocContexts.getStackFrame(getContext(D), nullptr, nullptr, nullptr, - 0); - } - - // Get a stack frame with parent. - StackFrameContext const *getStackFrame(const Decl *D, - LocationContext const *Parent, - const Stmt *S, - const CFGBlock *Blk, - unsigned Idx) { - return LocContexts.getStackFrame(getContext(D), Parent, S, Blk, Idx); - } - - /// Discard all previously created AnalysisDeclContexts. - void clear(); - -private: - friend class AnalysisDeclContext; - - LocationContextManager &getLocationContextManager() { - return LocContexts; - } -}; - -} // end clang namespace -#endif diff --git a/gnu/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h b/gnu/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h deleted file mode 100644 index 197d27a2f37..00000000000 --- a/gnu/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h +++ /dev/null @@ -1,366 +0,0 @@ -//===--- BugReporterVisitor.h - Generate PathDiagnostics -------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file declares BugReporterVisitors, which are used to generate enhanced -// diagnostic traces. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_BUGREPORTERVISITOR_H -#define LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_BUGREPORTERVISITOR_H - -#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h" -#include "llvm/ADT/FoldingSet.h" - -namespace clang { - -namespace ento { - -class BugReport; -class BugReporterContext; -class ExplodedNode; -class MemRegion; -class PathDiagnosticPiece; - -/// \brief BugReporterVisitors are used to add custom diagnostics along a path. -/// -/// Custom visitors should subclass the BugReporterVisitorImpl class for a -/// default implementation of the clone() method. -/// (Warning: if you have a deep subclass of BugReporterVisitorImpl, the -/// default implementation of clone() will NOT do the right thing, and you -/// will have to provide your own implementation.) -class BugReporterVisitor : public llvm::FoldingSetNode { -public: - BugReporterVisitor() = default; - BugReporterVisitor(const BugReporterVisitor &) = default; - BugReporterVisitor(BugReporterVisitor &&) {} - virtual ~BugReporterVisitor(); - - /// \brief Returns a copy of this BugReporter. - /// - /// Custom BugReporterVisitors should not override this method directly. - /// Instead, they should inherit from BugReporterVisitorImpl and provide - /// a protected or public copy constructor. - /// - /// (Warning: if you have a deep subclass of BugReporterVisitorImpl, the - /// default implementation of clone() will NOT do the right thing, and you - /// will have to provide your own implementation.) - virtual std::unique_ptr<BugReporterVisitor> clone() const = 0; - - /// \brief Return a diagnostic piece which should be associated with the - /// given node. - /// - /// The last parameter can be used to register a new visitor with the given - /// BugReport while processing a node. - virtual PathDiagnosticPiece *VisitNode(const ExplodedNode *Succ, - const ExplodedNode *Pred, - BugReporterContext &BRC, - BugReport &BR) = 0; - - /// \brief Provide custom definition for the final diagnostic piece on the - /// path - the piece, which is displayed before the path is expanded. - /// - /// If returns NULL the default implementation will be used. - /// Also note that at most one visitor of a BugReport should generate a - /// non-NULL end of path diagnostic piece. - virtual std::unique_ptr<PathDiagnosticPiece> - getEndPath(BugReporterContext &BRC, const ExplodedNode *N, BugReport &BR); - - virtual void Profile(llvm::FoldingSetNodeID &ID) const = 0; - - /// \brief Generates the default final diagnostic piece. - static std::unique_ptr<PathDiagnosticPiece> - getDefaultEndPath(BugReporterContext &BRC, const ExplodedNode *N, - BugReport &BR); -}; - -/// This class provides a convenience implementation for clone() using the -/// Curiously-Recurring Template Pattern. If you are implementing a custom -/// BugReporterVisitor, subclass BugReporterVisitorImpl and provide a public -/// or protected copy constructor. -/// -/// (Warning: if you have a deep subclass of BugReporterVisitorImpl, the -/// default implementation of clone() will NOT do the right thing, and you -/// will have to provide your own implementation.) -template <class DERIVED> -class BugReporterVisitorImpl : public BugReporterVisitor { - std::unique_ptr<BugReporterVisitor> clone() const override { - return llvm::make_unique<DERIVED>(*static_cast<const DERIVED *>(this)); - } -}; - -class FindLastStoreBRVisitor final - : public BugReporterVisitorImpl<FindLastStoreBRVisitor> { - const MemRegion *R; - SVal V; - bool Satisfied; - - /// If the visitor is tracking the value directly responsible for the - /// bug, we are going to employ false positive suppression. - bool EnableNullFPSuppression; - -public: - /// Creates a visitor for every VarDecl inside a Stmt and registers it with - /// the BugReport. - static void registerStatementVarDecls(BugReport &BR, const Stmt *S, - bool EnableNullFPSuppression); - - FindLastStoreBRVisitor(KnownSVal V, const MemRegion *R, - bool InEnableNullFPSuppression) - : R(R), - V(V), - Satisfied(false), - EnableNullFPSuppression(InEnableNullFPSuppression) {} - - void Profile(llvm::FoldingSetNodeID &ID) const override; - - PathDiagnosticPiece *VisitNode(const ExplodedNode *N, - const ExplodedNode *PrevN, - BugReporterContext &BRC, - BugReport &BR) override; -}; - -class TrackConstraintBRVisitor final - : public BugReporterVisitorImpl<TrackConstraintBRVisitor> { - DefinedSVal Constraint; - bool Assumption; - bool IsSatisfied; - bool IsZeroCheck; - - /// We should start tracking from the last node along the path in which the - /// value is constrained. - bool IsTrackingTurnedOn; - -public: - TrackConstraintBRVisitor(DefinedSVal constraint, bool assumption) - : Constraint(constraint), Assumption(assumption), IsSatisfied(false), - IsZeroCheck(!Assumption && Constraint.getAs<Loc>()), - IsTrackingTurnedOn(false) {} - - void Profile(llvm::FoldingSetNodeID &ID) const override; - - /// Return the tag associated with this visitor. This tag will be used - /// to make all PathDiagnosticPieces created by this visitor. - static const char *getTag(); - - PathDiagnosticPiece *VisitNode(const ExplodedNode *N, - const ExplodedNode *PrevN, - BugReporterContext &BRC, - BugReport &BR) override; - -private: - /// Checks if the constraint is valid in the current state. - bool isUnderconstrained(const ExplodedNode *N) const; - -}; - -/// \class NilReceiverBRVisitor -/// \brief Prints path notes when a message is sent to a nil receiver. -class NilReceiverBRVisitor final - : public BugReporterVisitorImpl<NilReceiverBRVisitor> { -public: - - void Profile(llvm::FoldingSetNodeID &ID) const override { - static int x = 0; - ID.AddPointer(&x); - } - - PathDiagnosticPiece *VisitNode(const ExplodedNode *N, - const ExplodedNode *PrevN, - BugReporterContext &BRC, - BugReport &BR) override; - - /// If the statement is a message send expression with nil receiver, returns - /// the receiver expression. Returns NULL otherwise. - static const Expr *getNilReceiver(const Stmt *S, const ExplodedNode *N); -}; - -/// Visitor that tries to report interesting diagnostics from conditions. -class ConditionBRVisitor final - : public BugReporterVisitorImpl<ConditionBRVisitor> { -public: - void Profile(llvm::FoldingSetNodeID &ID) const override { - static int x = 0; - ID.AddPointer(&x); - } - - /// Return the tag associated with this visitor. This tag will be used - /// to make all PathDiagnosticPieces created by this visitor. - static const char *getTag(); - - PathDiagnosticPiece *VisitNode(const ExplodedNode *N, - const ExplodedNode *Prev, - BugReporterContext &BRC, - BugReport &BR) override; - - PathDiagnosticPiece *VisitNodeImpl(const ExplodedNode *N, - const ExplodedNode *Prev, - BugReporterContext &BRC, - BugReport &BR); - - PathDiagnosticPiece *VisitTerminator(const Stmt *Term, - const ExplodedNode *N, - const CFGBlock *srcBlk, - const CFGBlock *dstBlk, - BugReport &R, - BugReporterContext &BRC); - - PathDiagnosticPiece *VisitTrueTest(const Expr *Cond, - bool tookTrue, - BugReporterContext &BRC, - BugReport &R, - const ExplodedNode *N); - - PathDiagnosticPiece *VisitTrueTest(const Expr *Cond, - const DeclRefExpr *DR, - const bool tookTrue, - BugReporterContext &BRC, - BugReport &R, - const ExplodedNode *N); - - PathDiagnosticPiece *VisitTrueTest(const Expr *Cond, - const BinaryOperator *BExpr, - const bool tookTrue, - BugReporterContext &BRC, - BugReport &R, - const ExplodedNode *N); - - PathDiagnosticPiece *VisitConditionVariable(StringRef LhsString, - const Expr *CondVarExpr, - const bool tookTrue, - BugReporterContext &BRC, - BugReport &R, - const ExplodedNode *N); - - bool patternMatch(const Expr *Ex, - raw_ostream &Out, - BugReporterContext &BRC, - BugReport &R, - const ExplodedNode *N, - Optional<bool> &prunable); -}; - -/// \brief Suppress reports that might lead to known false positives. -/// -/// Currently this suppresses reports based on locations of bugs. -class LikelyFalsePositiveSuppressionBRVisitor final - : public BugReporterVisitorImpl<LikelyFalsePositiveSuppressionBRVisitor> { -public: - static void *getTag() { - static int Tag = 0; - return static_cast<void *>(&Tag); - } - - void Profile(llvm::FoldingSetNodeID &ID) const override { - ID.AddPointer(getTag()); - } - - PathDiagnosticPiece *VisitNode(const ExplodedNode *N, - const ExplodedNode *Prev, - BugReporterContext &BRC, - BugReport &BR) override { - return nullptr; - } - - std::unique_ptr<PathDiagnosticPiece> getEndPath(BugReporterContext &BRC, - const ExplodedNode *N, - BugReport &BR) override; -}; - -/// \brief When a region containing undefined value or '0' value is passed -/// as an argument in a call, marks the call as interesting. -/// -/// As a result, BugReporter will not prune the path through the function even -/// if the region's contents are not modified/accessed by the call. -class UndefOrNullArgVisitor final - : public BugReporterVisitorImpl<UndefOrNullArgVisitor> { - - /// The interesting memory region this visitor is tracking. - const MemRegion *R; - -public: - UndefOrNullArgVisitor(const MemRegion *InR) : R(InR) {} - - void Profile(llvm::FoldingSetNodeID &ID) const override { - static int Tag = 0; - ID.AddPointer(&Tag); - ID.AddPointer(R); - } - - PathDiagnosticPiece *VisitNode(const ExplodedNode *N, - const ExplodedNode *PrevN, - BugReporterContext &BRC, - BugReport &BR) override; -}; - -class SuppressInlineDefensiveChecksVisitor final - : public BugReporterVisitorImpl<SuppressInlineDefensiveChecksVisitor> { - /// The symbolic value for which we are tracking constraints. - /// This value is constrained to null in the end of path. - DefinedSVal V; - - /// Track if we found the node where the constraint was first added. - bool IsSatisfied; - - /// Since the visitors can be registered on nodes previous to the last - /// node in the BugReport, but the path traversal always starts with the last - /// node, the visitor invariant (that we start with a node in which V is null) - /// might not hold when node visitation starts. We are going to start tracking - /// from the last node in which the value is null. - bool IsTrackingTurnedOn; - -public: - SuppressInlineDefensiveChecksVisitor(DefinedSVal Val, const ExplodedNode *N); - - void Profile(llvm::FoldingSetNodeID &ID) const override; - - /// Return the tag associated with this visitor. This tag will be used - /// to make all PathDiagnosticPieces created by this visitor. - static const char *getTag(); - - PathDiagnosticPiece *VisitNode(const ExplodedNode *Succ, - const ExplodedNode *Pred, - BugReporterContext &BRC, - BugReport &BR) override; -}; - -namespace bugreporter { - -/// Attempts to add visitors to trace a null or undefined value back to its -/// point of origin, whether it is a symbol constrained to null or an explicit -/// assignment. -/// -/// \param N A node "downstream" from the evaluation of the statement. -/// \param S The statement whose value is null or undefined. -/// \param R The bug report to which visitors should be attached. -/// \param IsArg Whether the statement is an argument to an inlined function. -/// If this is the case, \p N \em must be the CallEnter node for -/// the function. -/// \param EnableNullFPSuppression Whether we should employ false positive -/// suppression (inlined defensive checks, returned null). -/// -/// \return Whether or not the function was able to add visitors for this -/// statement. Note that returning \c true does not actually imply -/// that any visitors were added. -bool trackNullOrUndefValue(const ExplodedNode *N, const Stmt *S, BugReport &R, - bool IsArg = false, - bool EnableNullFPSuppression = true); - -const Expr *getDerefExpr(const Stmt *S); -const Stmt *GetDenomExpr(const ExplodedNode *N); -const Stmt *GetRetValExpr(const ExplodedNode *N); -bool isDeclRefExprToReference(const Expr *E); - - -} // end namespace clang -} // end namespace ento -} // end namespace bugreporter - - -#endif diff --git a/gnu/llvm/tools/clang/include/clang/Tooling/Core/QualTypeNames.h b/gnu/llvm/tools/clang/include/clang/Tooling/Core/QualTypeNames.h deleted file mode 100644 index 7248356e748..00000000000 --- a/gnu/llvm/tools/clang/include/clang/Tooling/Core/QualTypeNames.h +++ /dev/null @@ -1,79 +0,0 @@ -//===--- QualTypeNames.h - Generate Complete QualType Names ----*- C++ -*-===// -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -// ===----------------------------------------------------------------------===// -// -// \file -// Functionality to generate the fully-qualified names of QualTypes, -// including recursively expanding any subtypes and template -// parameters. -// -// More precisely: Generates a name that can be used to name the same -// type if used at the end of the current translation unit--with -// certain limitations. See below. -// -// This code desugars names only very minimally, so in this code: -// -// namespace A { -// struct X {}; -// } -// using A::X; -// namespace B { -// using std::tuple; -// typedef tuple<X> TX; -// TX t; -// } -// -// B::t's type is reported as "B::TX", rather than std::tuple<A::X>. -// -// Also, this code replaces types found via using declarations with -// their more qualified name, so for the code: -// -// using std::tuple; -// tuple<int> TInt; -// -// TInt's type will be named, "std::tuple<int>". -// -// Limitations: -// -// Some types have ambiguous names at the end of a translation unit, -// are not namable at all there, or are special cases in other ways. -// -// 1) Types with only local scope will have their local names: -// -// void foo() { -// struct LocalType {} LocalVar; -// } -// -// LocalVar's type will be named, "struct LocalType", without any -// qualification. -// -// 2) Types that have been shadowed are reported normally, but a -// client using that name at the end of the translation unit will be -// referring to a different type. -// -// ===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_TOOLING_CORE_QUALTYPENAMES_H -#define LLVM_CLANG_TOOLING_CORE_QUALTYPENAMES_H - -#include "clang/AST/ASTContext.h" - -namespace clang { -namespace TypeName { -/// \brief Get the fully qualified name for a type. This includes full -/// qualification of all template parameters etc. -/// -/// \param[in] QT - the type for which the fully qualified name will be -/// returned. -/// \param[in] Ctx - the ASTContext to be used. -/// \param[in] WithGlobalNsPrefix - If true, then the global namespace -/// specifier "::" will be prepended to the fully qualified name. -std::string getFullyQualifiedName(QualType QT, - const ASTContext &Ctx, - bool WithGlobalNsPrefix = false); -} // end namespace TypeName -} // end namespace clang -#endif // LLVM_CLANG_TOOLING_CORE_QUALTYPENAMES_H diff --git a/gnu/llvm/tools/clang/lib/Analysis/BodyFarm.h b/gnu/llvm/tools/clang/lib/Analysis/BodyFarm.h deleted file mode 100644 index 91379437231..00000000000 --- a/gnu/llvm/tools/clang/lib/Analysis/BodyFarm.h +++ /dev/null @@ -1,51 +0,0 @@ -//== BodyFarm.h - Factory for conjuring up fake bodies -------------*- C++ -*-// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// BodyFarm is a factory for creating faux implementations for functions/methods -// for analysis purposes. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_LIB_ANALYSIS_BODYFARM_H -#define LLVM_CLANG_LIB_ANALYSIS_BODYFARM_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/Optional.h" - -namespace clang { - -class ASTContext; -class Decl; -class FunctionDecl; -class ObjCMethodDecl; -class ObjCPropertyDecl; -class Stmt; -class CodeInjector; - -class BodyFarm { -public: - BodyFarm(ASTContext &C, CodeInjector *injector) : C(C), Injector(injector) {} - - /// Factory method for creating bodies for ordinary functions. - Stmt *getBody(const FunctionDecl *D); - - /// Factory method for creating bodies for Objective-C properties. - Stmt *getBody(const ObjCMethodDecl *D); - -private: - typedef llvm::DenseMap<const Decl *, Optional<Stmt *> > BodyMap; - - ASTContext &C; - BodyMap Bodies; - CodeInjector *Injector; -}; -} - -#endif diff --git a/gnu/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.cpp b/gnu/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.cpp deleted file mode 100644 index d8f541dfbaf..00000000000 --- a/gnu/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.cpp +++ /dev/null @@ -1,190 +0,0 @@ -//===--- Bitrig.cpp - Bitrig ToolChain Implementations ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "Bitrig.h" -#include "CommonArgs.h" -#include "clang/Driver/Compilation.h" -#include "clang/Driver/Options.h" -#include "llvm/Option/ArgList.h" - -using namespace clang::driver; -using namespace clang::driver::toolchains; -using namespace clang::driver::tools; -using namespace clang; -using namespace llvm::opt; - -void bitrig::Assembler::ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &Args, - const char *LinkingOutput) const { - claimNoWarnArgs(Args); - ArgStringList CmdArgs; - - Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); - - CmdArgs.push_back("-o"); - CmdArgs.push_back(Output.getFilename()); - - for (const auto &II : Inputs) - CmdArgs.push_back(II.getFilename()); - - const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as")); - C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs)); -} - -void bitrig::Linker::ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &Args, - const char *LinkingOutput) const { - const Driver &D = getToolChain().getDriver(); - ArgStringList CmdArgs; - - if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) { - CmdArgs.push_back("-e"); - CmdArgs.push_back("__start"); - } - - if (Args.hasArg(options::OPT_static)) { - CmdArgs.push_back("-Bstatic"); - } else { - if (Args.hasArg(options::OPT_rdynamic)) - CmdArgs.push_back("-export-dynamic"); - CmdArgs.push_back("--eh-frame-hdr"); - CmdArgs.push_back("-Bdynamic"); - if (Args.hasArg(options::OPT_shared)) { - CmdArgs.push_back("-shared"); - } else { - CmdArgs.push_back("-dynamic-linker"); - CmdArgs.push_back("/usr/libexec/ld.so"); - } - } - - if (Output.isFilename()) { - CmdArgs.push_back("-o"); - CmdArgs.push_back(Output.getFilename()); - } else { - assert(Output.isNothing() && "Invalid output."); - } - - if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { - if (!Args.hasArg(options::OPT_shared)) { - if (Args.hasArg(options::OPT_pg)) - CmdArgs.push_back( - Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o"))); - else - CmdArgs.push_back( - Args.MakeArgString(getToolChain().GetFilePath("crt0.o"))); - CmdArgs.push_back( - Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o"))); - } else { - CmdArgs.push_back( - Args.MakeArgString(getToolChain().GetFilePath("crtbeginS.o"))); - } - } - - Args.AddAllArgs(CmdArgs, - {options::OPT_L, options::OPT_T_Group, options::OPT_e}); - - AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA); - - if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { - if (D.CCCIsCXX()) { - getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs); - if (Args.hasArg(options::OPT_pg)) - CmdArgs.push_back("-lm_p"); - else - CmdArgs.push_back("-lm"); - } - - if (Args.hasArg(options::OPT_pthread)) { - if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg)) - CmdArgs.push_back("-lpthread_p"); - else - CmdArgs.push_back("-lpthread"); - } - - if (!Args.hasArg(options::OPT_shared)) { - if (Args.hasArg(options::OPT_pg)) - CmdArgs.push_back("-lc_p"); - else - CmdArgs.push_back("-lc"); - } - - StringRef MyArch; - switch (getToolChain().getArch()) { - case llvm::Triple::arm: - MyArch = "arm"; - break; - case llvm::Triple::x86: - MyArch = "i386"; - break; - case llvm::Triple::x86_64: - MyArch = "amd64"; - break; - default: - llvm_unreachable("Unsupported architecture"); - } - CmdArgs.push_back(Args.MakeArgString("-lclang_rt." + MyArch)); - } - - if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { - if (!Args.hasArg(options::OPT_shared)) - CmdArgs.push_back( - Args.MakeArgString(getToolChain().GetFilePath("crtend.o"))); - else - CmdArgs.push_back( - Args.MakeArgString(getToolChain().GetFilePath("crtendS.o"))); - } - - const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath()); - C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs)); -} - -/// Bitrig - Bitrig tool chain which can call as(1) and ld(1) directly. - -Bitrig::Bitrig(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) - : Generic_ELF(D, Triple, Args) { - getFilePaths().push_back(getDriver().Dir + "/../lib"); - getFilePaths().push_back("/usr/lib"); -} - -Tool *Bitrig::buildAssembler() const { - return new tools::bitrig::Assembler(*this); -} - -Tool *Bitrig::buildLinker() const { return new tools::bitrig::Linker(*this); } - -ToolChain::CXXStdlibType Bitrig::GetDefaultCXXStdlibType() const { - return ToolChain::CST_Libcxx; -} - -void Bitrig::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - llvm::opt::ArgStringList &CC1Args) const { - std::string Triple = getTriple().str(); - if (StringRef(Triple).startswith("amd64")) - Triple = "x86_64" + Triple.substr(5); - addLibStdCXXIncludePaths(getDriver().SysRoot, "/usr/include/c++/stdc++", - Triple, "", "", "", DriverArgs, CC1Args); -} - -void Bitrig::AddCXXStdlibLibArgs(const ArgList &Args, - ArgStringList &CmdArgs) const { - switch (GetCXXStdlibType(Args)) { - case ToolChain::CST_Libcxx: - CmdArgs.push_back("-lc++"); - CmdArgs.push_back("-lc++abi"); - CmdArgs.push_back("-lpthread"); - break; - case ToolChain::CST_Libstdcxx: - CmdArgs.push_back("-lstdc++"); - break; - } -} diff --git a/gnu/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.h b/gnu/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.h deleted file mode 100644 index 6edb2e8c7e8..00000000000 --- a/gnu/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.h +++ /dev/null @@ -1,79 +0,0 @@ -//===--- Bitrig.h - Bitrig ToolChain Implementations ------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_BITRIG_H -#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_BITRIG_H - -#include "Gnu.h" -#include "clang/Driver/Driver.h" -#include "clang/Driver/ToolChain.h" - -namespace clang { -namespace driver { -namespace tools { -/// bitrig -- Directly call GNU Binutils assembler and linker -namespace bitrig { -class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { -public: - Assembler(const ToolChain &TC) - : GnuTool("bitrig::Assembler", "assembler", TC) {} - - bool hasIntegratedCPP() const override { return false; } - - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; -}; - -class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { -public: - Linker(const ToolChain &TC) : GnuTool("bitrig::Linker", "linker", TC) {} - - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } - - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; -}; -} // end namespace bitrig -} // end namespace tools - -namespace toolchains { - -class LLVM_LIBRARY_VISIBILITY Bitrig : public Generic_ELF { -public: - Bitrig(const Driver &D, const llvm::Triple &Triple, - const llvm::opt::ArgList &Args); - - bool IsMathErrnoDefault() const override { return false; } - bool IsObjCNonFragileABIDefault() const override { return true; } - - CXXStdlibType GetDefaultCXXStdlibType() const override; - void addLibStdCxxIncludePaths( - const llvm::opt::ArgList &DriverArgs, - llvm::opt::ArgStringList &CC1Args) const override; - void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs) const override; - unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override { - return 1; - } - -protected: - Tool *buildAssembler() const override; - Tool *buildLinker() const override; -}; - -} // end namespace toolchains -} // end namespace driver -} // end namespace clang - -#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_BITRIG_H diff --git a/gnu/llvm/tools/clang/lib/Tooling/Core/QualTypeNames.cpp b/gnu/llvm/tools/clang/lib/Tooling/Core/QualTypeNames.cpp deleted file mode 100644 index 619dae1ee10..00000000000 --- a/gnu/llvm/tools/clang/lib/Tooling/Core/QualTypeNames.cpp +++ /dev/null @@ -1,479 +0,0 @@ -//===------- QualTypeNames.cpp - Generate Complete QualType Names ---------===// -// -// The LLVM Compiler Infrastructure -// -//===----------------------------------------------------------------------===// -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "clang/Tooling/Core/QualTypeNames.h" -#include "clang/AST/DeclTemplate.h" -#include "clang/AST/DeclarationName.h" -#include "clang/AST/GlobalDecl.h" -#include "clang/AST/Mangle.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/StringRef.h" - -#include <stdio.h> -#include <memory> - -namespace clang { - -namespace TypeName { -/// \brief Generates a QualType that can be used to name the same type -/// if used at the end of the current translation unit. This ignores -/// issues such as type shadowing. -/// -/// \param[in] QT - the type for which the fully qualified type will be -/// returned. -/// \param[in] Ctx - the ASTContext to be used. -/// \param[in] WithGlobalNsPrefix - Indicate whether the global namespace -/// specifier "::" should be prepended or not. -static QualType getFullyQualifiedType(QualType QT, const ASTContext &Ctx, - bool WithGlobalNsPrefix); - -/// \brief Create a NestedNameSpecifier for Namesp and its enclosing -/// scopes. -/// -/// \param[in] Ctx - the AST Context to be used. -/// \param[in] Namesp - the NamespaceDecl for which a NestedNameSpecifier -/// is requested. -/// \param[in] WithGlobalNsPrefix - Indicate whether the global namespace -/// specifier "::" should be prepended or not. -static NestedNameSpecifier *createNestedNameSpecifier( - const ASTContext &Ctx, - const NamespaceDecl *Namesp, - bool WithGlobalNsPrefix); - -/// \brief Create a NestedNameSpecifier for TagDecl and its enclosing -/// scopes. -/// -/// \param[in] Ctx - the AST Context to be used. -/// \param[in] TD - the TagDecl for which a NestedNameSpecifier is -/// requested. -/// \param[in] FullyQualify - Convert all template arguments into fully -/// qualified names. -/// \param[in] WithGlobalNsPrefix - Indicate whether the global namespace -/// specifier "::" should be prepended or not. -static NestedNameSpecifier *createNestedNameSpecifier( - const ASTContext &Ctx, const TypeDecl *TD, - bool FullyQualify, bool WithGlobalNsPrefix); - -static NestedNameSpecifier *createNestedNameSpecifierForScopeOf( - const ASTContext &Ctx, const Decl *decl, - bool FullyQualified, bool WithGlobalNsPrefix); - -static NestedNameSpecifier *getFullyQualifiedNestedNameSpecifier( - const ASTContext &Ctx, NestedNameSpecifier *scope, bool WithGlobalNsPrefix); - -static bool getFullyQualifiedTemplateName(const ASTContext &Ctx, - TemplateName &TName, - bool WithGlobalNsPrefix) { - bool Changed = false; - NestedNameSpecifier *NNS = nullptr; - - TemplateDecl *ArgTDecl = TName.getAsTemplateDecl(); - // ArgTDecl won't be NULL because we asserted that this isn't a - // dependent context very early in the call chain. - assert(ArgTDecl != nullptr); - QualifiedTemplateName *QTName = TName.getAsQualifiedTemplateName(); - - if (QTName && !QTName->hasTemplateKeyword()) { - NNS = QTName->getQualifier(); - NestedNameSpecifier *QNNS = getFullyQualifiedNestedNameSpecifier( - Ctx, NNS, WithGlobalNsPrefix); - if (QNNS != NNS) { - Changed = true; - NNS = QNNS; - } else { - NNS = nullptr; - } - } else { - NNS = createNestedNameSpecifierForScopeOf( - Ctx, ArgTDecl, true, WithGlobalNsPrefix); - } - if (NNS) { - TName = Ctx.getQualifiedTemplateName(NNS, - /*TemplateKeyword=*/false, ArgTDecl); - Changed = true; - } - return Changed; -} - -static bool getFullyQualifiedTemplateArgument(const ASTContext &Ctx, - TemplateArgument &Arg, - bool WithGlobalNsPrefix) { - bool Changed = false; - - // Note: we do not handle TemplateArgument::Expression, to replace it - // we need the information for the template instance decl. - - if (Arg.getKind() == TemplateArgument::Template) { - TemplateName TName = Arg.getAsTemplate(); - Changed = getFullyQualifiedTemplateName(Ctx, TName, WithGlobalNsPrefix); - if (Changed) { - Arg = TemplateArgument(TName); - } - } else if (Arg.getKind() == TemplateArgument::Type) { - QualType SubTy = Arg.getAsType(); - // Check if the type needs more desugaring and recurse. - QualType QTFQ = getFullyQualifiedType(SubTy, Ctx, WithGlobalNsPrefix); - if (QTFQ != SubTy) { - Arg = TemplateArgument(QTFQ); - Changed = true; - } - } - return Changed; -} - -static const Type *getFullyQualifiedTemplateType(const ASTContext &Ctx, - const Type *TypePtr, - bool WithGlobalNsPrefix) { - // DependentTemplateTypes exist within template declarations and - // definitions. Therefore we shouldn't encounter them at the end of - // a translation unit. If we do, the caller has made an error. - assert(!isa<DependentTemplateSpecializationType>(TypePtr)); - // In case of template specializations, iterate over the arguments - // and fully qualify them as well. - if (const auto *TST = dyn_cast<const TemplateSpecializationType>(TypePtr)) { - bool MightHaveChanged = false; - SmallVector<TemplateArgument, 4> FQArgs; - for (TemplateSpecializationType::iterator I = TST->begin(), E = TST->end(); - I != E; ++I) { - // Cheap to copy and potentially modified by - // getFullyQualifedTemplateArgument. - TemplateArgument Arg(*I); - MightHaveChanged |= getFullyQualifiedTemplateArgument( - Ctx, Arg, WithGlobalNsPrefix); - FQArgs.push_back(Arg); - } - - // If a fully qualified arg is different from the unqualified arg, - // allocate new type in the AST. - if (MightHaveChanged) { - QualType QT = Ctx.getTemplateSpecializationType( - TST->getTemplateName(), FQArgs, - TST->getCanonicalTypeInternal()); - // getTemplateSpecializationType returns a fully qualified - // version of the specialization itself, so no need to qualify - // it. - return QT.getTypePtr(); - } - } else if (const auto *TSTRecord = dyn_cast<const RecordType>(TypePtr)) { - // We are asked to fully qualify and we have a Record Type, - // which can point to a template instantiation with no sugar in any of - // its template argument, however we still need to fully qualify them. - - if (const auto *TSTDecl = - dyn_cast<ClassTemplateSpecializationDecl>(TSTRecord->getDecl())) { - const TemplateArgumentList &TemplateArgs = TSTDecl->getTemplateArgs(); - - bool MightHaveChanged = false; - SmallVector<TemplateArgument, 4> FQArgs; - for (unsigned int I = 0, E = TemplateArgs.size(); I != E; ++I) { - // cheap to copy and potentially modified by - // getFullyQualifedTemplateArgument - TemplateArgument Arg(TemplateArgs[I]); - MightHaveChanged |= getFullyQualifiedTemplateArgument( - Ctx, Arg, WithGlobalNsPrefix); - FQArgs.push_back(Arg); - } - - // If a fully qualified arg is different from the unqualified arg, - // allocate new type in the AST. - if (MightHaveChanged) { - TemplateName TN(TSTDecl->getSpecializedTemplate()); - QualType QT = Ctx.getTemplateSpecializationType( - TN, FQArgs, - TSTRecord->getCanonicalTypeInternal()); - // getTemplateSpecializationType returns a fully qualified - // version of the specialization itself, so no need to qualify - // it. - return QT.getTypePtr(); - } - } - } - return TypePtr; -} - -static NestedNameSpecifier *createOuterNNS(const ASTContext &Ctx, const Decl *D, - bool FullyQualify, - bool WithGlobalNsPrefix) { - const DeclContext *DC = D->getDeclContext(); - if (const auto *NS = dyn_cast<NamespaceDecl>(DC)) { - while (NS && NS->isInline()) { - // Ignore inline namespace; - NS = dyn_cast<NamespaceDecl>(NS->getDeclContext()); - } - if (NS->getDeclName()) { - return createNestedNameSpecifier(Ctx, NS, WithGlobalNsPrefix); - } - return nullptr; // no starting '::', no anonymous - } else if (const auto *TD = dyn_cast<TagDecl>(DC)) { - return createNestedNameSpecifier(Ctx, TD, FullyQualify, WithGlobalNsPrefix); - } else if (const auto *TDD = dyn_cast<TypedefNameDecl>(DC)) { - return createNestedNameSpecifier( - Ctx, TDD, FullyQualify, WithGlobalNsPrefix); - } else if (WithGlobalNsPrefix && DC->isTranslationUnit()) { - return NestedNameSpecifier::GlobalSpecifier(Ctx); - } - return nullptr; // no starting '::' if |WithGlobalNsPrefix| is false -} - -/// \brief Return a fully qualified version of this name specifier. -static NestedNameSpecifier *getFullyQualifiedNestedNameSpecifier( - const ASTContext &Ctx, NestedNameSpecifier *Scope, - bool WithGlobalNsPrefix) { - switch (Scope->getKind()) { - case NestedNameSpecifier::Global: - // Already fully qualified - return Scope; - case NestedNameSpecifier::Namespace: - return TypeName::createNestedNameSpecifier( - Ctx, Scope->getAsNamespace(), WithGlobalNsPrefix); - case NestedNameSpecifier::NamespaceAlias: - // Namespace aliases are only valid for the duration of the - // scope where they were introduced, and therefore are often - // invalid at the end of the TU. So use the namespace name more - // likely to be valid at the end of the TU. - return TypeName::createNestedNameSpecifier( - Ctx, - Scope->getAsNamespaceAlias()->getNamespace()->getCanonicalDecl(), - WithGlobalNsPrefix); - case NestedNameSpecifier::Identifier: - // A function or some other construct that makes it un-namable - // at the end of the TU. Skip the current component of the name, - // but use the name of it's prefix. - return getFullyQualifiedNestedNameSpecifier( - Ctx, Scope->getPrefix(), WithGlobalNsPrefix); - case NestedNameSpecifier::Super: - case NestedNameSpecifier::TypeSpec: - case NestedNameSpecifier::TypeSpecWithTemplate: { - const Type *Type = Scope->getAsType(); - // Find decl context. - const TagDecl *TD = nullptr; - if (const TagType *TagDeclType = Type->getAs<TagType>()) { - TD = TagDeclType->getDecl(); - } else { - TD = Type->getAsCXXRecordDecl(); - } - if (TD) { - return TypeName::createNestedNameSpecifier(Ctx, TD, - true /*FullyQualified*/, - WithGlobalNsPrefix); - } else if (const auto *TDD = dyn_cast<TypedefType>(Type)) { - return TypeName::createNestedNameSpecifier(Ctx, TDD->getDecl(), - true /*FullyQualified*/, - WithGlobalNsPrefix); - } - return Scope; - } - } - llvm_unreachable("bad NNS kind"); -} - -/// \brief Create a nested name specifier for the declaring context of -/// the type. -static NestedNameSpecifier *createNestedNameSpecifierForScopeOf( - const ASTContext &Ctx, const Decl *Decl, - bool FullyQualified, bool WithGlobalNsPrefix) { - assert(Decl); - - const DeclContext *DC = Decl->getDeclContext()->getRedeclContext(); - const auto *Outer = dyn_cast_or_null<NamedDecl>(DC); - const auto *OuterNS = dyn_cast_or_null<NamespaceDecl>(DC); - if (Outer && !(OuterNS && OuterNS->isAnonymousNamespace())) { - if (const auto *CxxDecl = dyn_cast<CXXRecordDecl>(DC)) { - if (ClassTemplateDecl *ClassTempl = - CxxDecl->getDescribedClassTemplate()) { - // We are in the case of a type(def) that was declared in a - // class template but is *not* type dependent. In clang, it - // gets attached to the class template declaration rather than - // any specific class template instantiation. This result in - // 'odd' fully qualified typename: - // - // vector<_Tp,_Alloc>::size_type - // - // Make the situation is 'useable' but looking a bit odd by - // picking a random instance as the declaring context. - if (ClassTempl->spec_begin() != ClassTempl->spec_end()) { - Decl = *(ClassTempl->spec_begin()); - Outer = dyn_cast<NamedDecl>(Decl); - OuterNS = dyn_cast<NamespaceDecl>(Decl); - } - } - } - - if (OuterNS) { - return createNestedNameSpecifier(Ctx, OuterNS, WithGlobalNsPrefix); - } else if (const auto *TD = dyn_cast<TagDecl>(Outer)) { - return createNestedNameSpecifier( - Ctx, TD, FullyQualified, WithGlobalNsPrefix); - } else if (dyn_cast<TranslationUnitDecl>(Outer)) { - // Context is the TU. Nothing needs to be done. - return nullptr; - } else { - // Decl's context was neither the TU, a namespace, nor a - // TagDecl, which means it is a type local to a scope, and not - // accessible at the end of the TU. - return nullptr; - } - } else if (WithGlobalNsPrefix && DC->isTranslationUnit()) { - return NestedNameSpecifier::GlobalSpecifier(Ctx); - } - return nullptr; -} - -/// \brief Create a nested name specifier for the declaring context of -/// the type. -static NestedNameSpecifier *createNestedNameSpecifierForScopeOf( - const ASTContext &Ctx, const Type *TypePtr, - bool FullyQualified, bool WithGlobalNsPrefix) { - if (!TypePtr) return nullptr; - - Decl *Decl = nullptr; - // There are probably other cases ... - if (const auto *TDT = dyn_cast<TypedefType>(TypePtr)) { - Decl = TDT->getDecl(); - } else if (const auto *TagDeclType = dyn_cast<TagType>(TypePtr)) { - Decl = TagDeclType->getDecl(); - } else if (const auto *TST = dyn_cast<TemplateSpecializationType>(TypePtr)) { - Decl = TST->getTemplateName().getAsTemplateDecl(); - } else { - Decl = TypePtr->getAsCXXRecordDecl(); - } - - if (!Decl) return nullptr; - - return createNestedNameSpecifierForScopeOf( - Ctx, Decl, FullyQualified, WithGlobalNsPrefix); -} - -NestedNameSpecifier *createNestedNameSpecifier(const ASTContext &Ctx, - const NamespaceDecl *Namespace, - bool WithGlobalNsPrefix) { - while (Namespace && Namespace->isInline()) { - // Ignore inline namespace; - Namespace = dyn_cast<NamespaceDecl>(Namespace->getDeclContext()); - } - if (!Namespace) return nullptr; - - bool FullyQualified = true; // doesn't matter, DeclContexts are namespaces - return NestedNameSpecifier::Create( - Ctx, - createOuterNNS(Ctx, Namespace, FullyQualified, WithGlobalNsPrefix), - Namespace); -} - -NestedNameSpecifier *createNestedNameSpecifier(const ASTContext &Ctx, - const TypeDecl *TD, - bool FullyQualify, - bool WithGlobalNsPrefix) { - return NestedNameSpecifier::Create( - Ctx, - createOuterNNS(Ctx, TD, FullyQualify, WithGlobalNsPrefix), - false /*No TemplateKeyword*/, - TD->getTypeForDecl()); -} - -/// \brief Return the fully qualified type, including fully-qualified -/// versions of any template parameters. -QualType getFullyQualifiedType(QualType QT, const ASTContext &Ctx, - bool WithGlobalNsPrefix) { - // In case of myType* we need to strip the pointer first, fully - // qualify and attach the pointer once again. - if (isa<PointerType>(QT.getTypePtr())) { - // Get the qualifiers. - Qualifiers Quals = QT.getQualifiers(); - QT = getFullyQualifiedType(QT->getPointeeType(), Ctx, WithGlobalNsPrefix); - QT = Ctx.getPointerType(QT); - // Add back the qualifiers. - QT = Ctx.getQualifiedType(QT, Quals); - return QT; - } - - // In case of myType& we need to strip the reference first, fully - // qualify and attach the reference once again. - if (isa<ReferenceType>(QT.getTypePtr())) { - // Get the qualifiers. - bool IsLValueRefTy = isa<LValueReferenceType>(QT.getTypePtr()); - Qualifiers Quals = QT.getQualifiers(); - QT = getFullyQualifiedType(QT->getPointeeType(), Ctx, WithGlobalNsPrefix); - // Add the r- or l-value reference type back to the fully - // qualified one. - if (IsLValueRefTy) - QT = Ctx.getLValueReferenceType(QT); - else - QT = Ctx.getRValueReferenceType(QT); - // Add back the qualifiers. - QT = Ctx.getQualifiedType(QT, Quals); - return QT; - } - - // Remove the part of the type related to the type being a template - // parameter (we won't report it as part of the 'type name' and it - // is actually make the code below to be more complex (to handle - // those) - while (isa<SubstTemplateTypeParmType>(QT.getTypePtr())) { - // Get the qualifiers. - Qualifiers Quals = QT.getQualifiers(); - - QT = dyn_cast<SubstTemplateTypeParmType>(QT.getTypePtr())->desugar(); - - // Add back the qualifiers. - QT = Ctx.getQualifiedType(QT, Quals); - } - - NestedNameSpecifier *Prefix = nullptr; - // Local qualifiers are attached to the QualType outside of the - // elaborated type. Retrieve them before descending into the - // elaborated type. - Qualifiers PrefixQualifiers = QT.getLocalQualifiers(); - QT = QualType(QT.getTypePtr(), 0); - ElaboratedTypeKeyword Keyword = ETK_None; - if (const auto *ETypeInput = dyn_cast<ElaboratedType>(QT.getTypePtr())) { - QT = ETypeInput->getNamedType(); - assert(!QT.hasLocalQualifiers()); - Keyword = ETypeInput->getKeyword(); - } - // Create a nested name specifier if needed. - Prefix = createNestedNameSpecifierForScopeOf(Ctx, QT.getTypePtr(), - true /*FullyQualified*/, - WithGlobalNsPrefix); - - // In case of template specializations iterate over the arguments and - // fully qualify them as well. - if (isa<const TemplateSpecializationType>(QT.getTypePtr()) || - isa<const RecordType>(QT.getTypePtr())) { - // We are asked to fully qualify and we have a Record Type (which - // may point to a template specialization) or Template - // Specialization Type. We need to fully qualify their arguments. - - const Type *TypePtr = getFullyQualifiedTemplateType( - Ctx, QT.getTypePtr(), WithGlobalNsPrefix); - QT = QualType(TypePtr, 0); - } - if (Prefix || Keyword != ETK_None) { - QT = Ctx.getElaboratedType(Keyword, Prefix, QT); - } - QT = Ctx.getQualifiedType(QT, PrefixQualifiers); - return QT; -} - -std::string getFullyQualifiedName(QualType QT, - const ASTContext &Ctx, - bool WithGlobalNsPrefix) { - PrintingPolicy Policy(Ctx.getPrintingPolicy()); - Policy.SuppressScope = false; - Policy.AnonymousTagLocations = false; - Policy.PolishForDeclaration = true; - Policy.SuppressUnwrittenScope = true; - QualType FQQT = getFullyQualifiedType(QT, Ctx, WithGlobalNsPrefix); - return FQQT.getAsString(Policy); -} - -} // end namespace TypeName -} // end namespace clang diff --git a/gnu/llvm/tools/lld/COFF/Error.cpp b/gnu/llvm/tools/lld/COFF/Error.cpp deleted file mode 100644 index 602a8544ce2..00000000000 --- a/gnu/llvm/tools/lld/COFF/Error.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===- Error.cpp ----------------------------------------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "Error.h" - -#include "llvm/ADT/Twine.h" -#include "llvm/Support/Error.h" -#include "llvm/Support/raw_ostream.h" - -namespace lld { -namespace coff { - -void fatal(const Twine &Msg) { - llvm::errs() << Msg << "\n"; - exit(1); -} - -void fatal(std::error_code EC, const Twine &Msg) { - fatal(Msg + ": " + EC.message()); -} - -void fatal(llvm::Error &Err, const Twine &Msg) { - fatal(errorToErrorCode(std::move(Err)), Msg); -} - -} // namespace coff -} // namespace lld diff --git a/gnu/llvm/tools/lld/COFF/Error.h b/gnu/llvm/tools/lld/COFF/Error.h deleted file mode 100644 index c9f64c66258..00000000000 --- a/gnu/llvm/tools/lld/COFF/Error.h +++ /dev/null @@ -1,38 +0,0 @@ -//===- Error.h --------------------------------------------------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_COFF_ERROR_H -#define LLD_COFF_ERROR_H - -#include "lld/Core/LLVM.h" -#include "llvm/Support/Error.h" - -namespace lld { -namespace coff { - -LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void fatal(std::error_code EC, const Twine &Prefix); -LLVM_ATTRIBUTE_NORETURN void fatal(llvm::Error &Err, const Twine &Prefix); - -template <class T> T check(ErrorOr<T> &&V, const Twine &Prefix) { - if (auto EC = V.getError()) - fatal(EC, Prefix); - return std::move(*V); -} - -template <class T> T check(Expected<T> E, const Twine &Prefix) { - if (llvm::Error Err = E.takeError()) - fatal(Err, Prefix); - return std::move(*E); -} - -} // namespace coff -} // namespace lld - -#endif diff --git a/gnu/llvm/tools/lld/COFF/Memory.h b/gnu/llvm/tools/lld/COFF/Memory.h deleted file mode 100644 index 526f11344a0..00000000000 --- a/gnu/llvm/tools/lld/COFF/Memory.h +++ /dev/null @@ -1,52 +0,0 @@ -//===- Memory.h -------------------------------------------------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// See ELF/Memory.h -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_COFF_MEMORY_H -#define LLD_COFF_MEMORY_H - -#include "llvm/Support/Allocator.h" -#include "llvm/Support/StringSaver.h" -#include <vector> - -namespace lld { -namespace coff { - -extern llvm::BumpPtrAllocator BAlloc; -extern llvm::StringSaver Saver; - -struct SpecificAllocBase { - SpecificAllocBase() { Instances.push_back(this); } - virtual ~SpecificAllocBase() = default; - virtual void reset() = 0; - static std::vector<SpecificAllocBase *> Instances; -}; - -template <class T> struct SpecificAlloc : public SpecificAllocBase { - void reset() override { Alloc.DestroyAll(); } - llvm::SpecificBumpPtrAllocator<T> Alloc; -}; - -template <typename T, typename... U> T *make(U &&... Args) { - static SpecificAlloc<T> Alloc; - return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...); -} - -inline void freeArena() { - for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances) - Alloc->reset(); - BAlloc.Reset(); -} -} -} - -#endif diff --git a/gnu/llvm/tools/lld/ELF/Error.cpp b/gnu/llvm/tools/lld/ELF/Error.cpp deleted file mode 100644 index 59a49c17b97..00000000000 --- a/gnu/llvm/tools/lld/ELF/Error.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===- Error.cpp ----------------------------------------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "Error.h" -#include "Config.h" - -#include "llvm/ADT/Twine.h" -#include "llvm/Support/Error.h" -#include "llvm/Support/raw_ostream.h" - -using namespace llvm; - -namespace lld { -namespace elf { - -bool HasError; -raw_ostream *ErrorOS; - -void log(const Twine &Msg) { - if (Config->Verbose) - outs() << Msg << "\n"; -} - -void warning(const Twine &Msg) { - if (Config->FatalWarnings) - error(Msg); - else - *ErrorOS << Msg << "\n"; -} - -void error(const Twine &Msg) { - *ErrorOS << Msg << "\n"; - HasError = true; -} - -void error(std::error_code EC, const Twine &Prefix) { - error(Prefix + ": " + EC.message()); -} - -void fatal(const Twine &Msg) { - *ErrorOS << Msg << "\n"; - exit(1); -} - -void fatal(const Twine &Msg, const Twine &Prefix) { - fatal(Prefix + ": " + Msg); -} - -void check(std::error_code EC) { - if (EC) - fatal(EC.message()); -} - -void check(Error Err) { - check(errorToErrorCode(std::move(Err))); -} - -} // namespace elf -} // namespace lld diff --git a/gnu/llvm/tools/lld/ELF/Error.h b/gnu/llvm/tools/lld/ELF/Error.h deleted file mode 100644 index 552f5049846..00000000000 --- a/gnu/llvm/tools/lld/ELF/Error.h +++ /dev/null @@ -1,61 +0,0 @@ -//===- Error.h --------------------------------------------------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_COFF_ERROR_H -#define LLD_COFF_ERROR_H - -#include "lld/Core/LLVM.h" - -namespace lld { -namespace elf { - -extern bool HasError; -extern llvm::raw_ostream *ErrorOS; - -void log(const Twine &Msg); -void warning(const Twine &Msg); - -void error(const Twine &Msg); -void error(std::error_code EC, const Twine &Prefix); - -template <typename T> void error(const ErrorOr<T> &V, const Twine &Prefix) { - error(V.getError(), Prefix); -} - -LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg, const Twine &Prefix); - -template <class T> T check(ErrorOr<T> E) { - if (auto EC = E.getError()) - fatal(EC.message()); - return std::move(*E); -} - -template <class T> T check(Expected<T> E) { - if (!E) - fatal(errorToErrorCode(E.takeError()).message()); - return std::move(*E); -} - -template <class T> T check(ErrorOr<T> E, const Twine &Prefix) { - if (auto EC = E.getError()) - fatal(EC.message(), Prefix); - return std::move(*E); -} - -template <class T> T check(Expected<T> E, const Twine &Prefix) { - if (!E) - fatal(errorToErrorCode(E.takeError()).message(), Prefix); - return std::move(*E); -} - -} // namespace elf -} // namespace lld - -#endif diff --git a/gnu/llvm/tools/lld/ELF/Memory.h b/gnu/llvm/tools/lld/ELF/Memory.h deleted file mode 100644 index e5a04ed1e5a..00000000000 --- a/gnu/llvm/tools/lld/ELF/Memory.h +++ /dev/null @@ -1,67 +0,0 @@ -//===- Memory.h -------------------------------------------------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines arena allocators. -// -// Almost all large objects, such as files, sections or symbols, are -// used for the entire lifetime of the linker once they are created. -// This usage characteristic makes arena allocator an attractive choice -// where the entire linker is one arena. With an arena, newly created -// objects belong to the arena and freed all at once when everything is done. -// Arena allocators are efficient and easy to understand. -// Most objects are allocated using the arena allocators defined by this file. -// -// If you edit this file, please edit COFF/Memory.h too. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_ELF_MEMORY_H -#define LLD_ELF_MEMORY_H - -#include "llvm/Support/Allocator.h" -#include "llvm/Support/StringSaver.h" -#include <vector> - -namespace lld { -namespace elf { - -// Use this arena if your object doesn't have a destructor. -extern llvm::BumpPtrAllocator BAlloc; -extern llvm::StringSaver Saver; - -// These two classes are hack to keep track of all -// SpecificBumpPtrAllocator instances. -struct SpecificAllocBase { - SpecificAllocBase() { Instances.push_back(this); } - virtual ~SpecificAllocBase() = default; - virtual void reset() = 0; - static std::vector<SpecificAllocBase *> Instances; -}; - -template <class T> struct SpecificAlloc : public SpecificAllocBase { - void reset() override { Alloc.DestroyAll(); } - llvm::SpecificBumpPtrAllocator<T> Alloc; -}; - -// Use this arena if your object has a destructor. -// Your destructor will be invoked from freeArena(). -template <typename T, typename... U> T *make(U &&... Args) { - static SpecificAlloc<T> Alloc; - return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...); -} - -inline void freeArena() { - for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances) - Alloc->reset(); - BAlloc.Reset(); -} -} -} - -#endif diff --git a/gnu/llvm/tools/lld/ELF/Threads.h b/gnu/llvm/tools/lld/ELF/Threads.h deleted file mode 100644 index c03e15253e1..00000000000 --- a/gnu/llvm/tools/lld/ELF/Threads.h +++ /dev/null @@ -1,90 +0,0 @@ -//===- Threads.h ------------------------------------------------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// LLD supports threads to distribute workloads to multiple cores. Using -// multicore is most effective when more than one core are idle. At the -// last step of a build, it is often the case that a linker is the only -// active process on a computer. So, we are naturally interested in using -// threads wisely to reduce latency to deliver results to users. -// -// That said, we don't want to do "too clever" things using threads. -// Complex multi-threaded algorithms are sometimes extremely hard to -// justify the correctness and can easily mess up the entire design. -// -// Fortunately, when a linker links large programs (when the link time is -// most critical), it spends most of the time to work on massive number of -// small pieces of data of the same kind, and there are opportunities for -// large parallelism there. Here are examples: -// -// - We have hundreds of thousands of input sections that need to be -// copied to a result file at the last step of link. Once we fix a file -// layout, each section can be copied to its destination and its -// relocations can be applied independently. -// -// - We have tens of millions of small strings when constructing a -// mergeable string section. -// -// For the cases such as the former, we can just use parallel_for_each -// instead of std::for_each (or a plain for loop). Because tasks are -// completely independent from each other, we can run them in parallel -// without any coordination between them. That's very easy to understand -// and justify. -// -// For the cases such as the latter, we can use parallel algorithms to -// deal with massive data. We have to write code for a tailored algorithm -// for each problem, but the complexity of multi-threading is isolated in -// a single pass and doesn't affect the linker's overall design. -// -// The above approach seems to be working fairly well. As an example, when -// linking Chromium (output size 1.6 GB), using 4 cores reduces latency to -// 75% compared to single core (from 12.66 seconds to 9.55 seconds) on my -// Ivy Bridge Xeon 2.8 GHz machine. Using 40 cores reduces it to 63% (from -// 12.66 seconds to 7.95 seconds). Because of the Amdahl's law, the -// speedup is not linear, but as you add more cores, it gets faster. -// -// On a final note, if you are trying to optimize, keep the axiom "don't -// guess, measure!" in mind. Some important passes of the linker are not -// that slow. For example, resolving all symbols is not a very heavy pass, -// although it would be very hard to parallelize it. You want to first -// identify a slow pass and then optimize it. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_ELF_THREADS_H -#define LLD_ELF_THREADS_H - -#include "Config.h" - -#include "lld/Core/Parallel.h" -#include <algorithm> -#include <functional> - -namespace lld { -namespace elf { - -template <class IterTy, class FuncTy> -void forEach(IterTy Begin, IterTy End, FuncTy Fn) { - if (Config->Threads) - parallel_for_each(Begin, End, Fn); - else - std::for_each(Begin, End, Fn); -} - -inline void forLoop(size_t Begin, size_t End, std::function<void(size_t)> Fn) { - if (Config->Threads) { - parallel_for(Begin, End, Fn); - } else { - for (size_t I = Begin; I < End; ++I) - Fn(I); - } -} -} -} - -#endif diff --git a/gnu/llvm/tools/lld/include/lld/Config/Version.h b/gnu/llvm/tools/lld/include/lld/Config/Version.h deleted file mode 100644 index 41433c1175e..00000000000 --- a/gnu/llvm/tools/lld/include/lld/Config/Version.h +++ /dev/null @@ -1,51 +0,0 @@ -//===- lld/Config/Version.h - LLD Version Number ----------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines version macros and version-related utility functions -/// for lld. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLD_VERSION_H -#define LLD_VERSION_H - -#include "lld/Config/Version.inc" -#include "llvm/ADT/StringRef.h" -#include <string> - -/// \brief Helper macro for LLD_VERSION_STRING. -#define LLD_MAKE_VERSION_STRING2(X) #X - -/// \brief Helper macro for LLD_VERSION_STRING. -#define LLD_MAKE_VERSION_STRING(X, Y) LLD_MAKE_VERSION_STRING2(X.Y) - -/// \brief A string that describes the lld version number, e.g., "1.0". -#define LLD_VERSION_STRING \ - LLD_MAKE_VERSION_STRING(LLD_VERSION_MAJOR, LLD_VERSION_MINOR) - -namespace lld { -/// \brief Retrieves the repository path (e.g., Subversion path) that -/// identifies the particular lld branch, tag, or trunk from which this -/// lld was built. -llvm::StringRef getLLDRepositoryPath(); - -/// \brief Retrieves the repository revision number (or identifer) from which -/// this lld was built. -llvm::StringRef getLLDRevision(); - -/// \brief Retrieves the full repository version that is an amalgamation of -/// the information in getLLDRepositoryPath() and getLLDRevision(). -std::string getLLDRepositoryVersion(); - -/// \brief Retrieves a string representing the complete lld version. -llvm::StringRef getLLDVersion(); -} - -#endif // LLD_VERSION_H diff --git a/gnu/llvm/tools/lld/include/lld/Config/Version.inc.in b/gnu/llvm/tools/lld/include/lld/Config/Version.inc.in deleted file mode 100644 index c893a56686c..00000000000 --- a/gnu/llvm/tools/lld/include/lld/Config/Version.inc.in +++ /dev/null @@ -1,5 +0,0 @@ -#define LLD_VERSION @LLD_VERSION@ -#define LLD_VERSION_MAJOR @LLD_VERSION_MAJOR@ -#define LLD_VERSION_MINOR @LLD_VERSION_MINOR@ -#define LLD_REVISION_STRING "@LLD_REVISION@" -#define LLD_REPOSITORY_STRING "@LLD_REPOSITORY@" diff --git a/gnu/llvm/tools/lld/include/lld/Core/LLVM.h b/gnu/llvm/tools/lld/include/lld/Core/LLVM.h deleted file mode 100644 index ccf08859f4a..00000000000 --- a/gnu/llvm/tools/lld/include/lld/Core/LLVM.h +++ /dev/null @@ -1,83 +0,0 @@ -//===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file forward declares and imports various common LLVM datatypes that -// lld wants to use unqualified. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_CORE_LLVM_H -#define LLD_CORE_LLVM_H - -// This should be the only #include, force #includes of all the others on -// clients. -#include "llvm/ADT/Hashing.h" -#include "llvm/Support/Casting.h" -#include <utility> - -namespace llvm { - // ADT's. - class Error; - class StringRef; - class Twine; - class MemoryBuffer; - class MemoryBufferRef; - template<typename T> class ArrayRef; - template<unsigned InternalLen> class SmallString; - template<typename T, unsigned N> class SmallVector; - template<typename T> class SmallVectorImpl; - - template<typename T> - struct SaveAndRestore; - - template<typename T> - class ErrorOr; - - template<typename T> - class Expected; - - class raw_ostream; - // TODO: DenseMap, ... -} - -namespace lld { - // Casting operators. - using llvm::isa; - using llvm::cast; - using llvm::dyn_cast; - using llvm::dyn_cast_or_null; - using llvm::cast_or_null; - - // ADT's. - using llvm::Error; - using llvm::StringRef; - using llvm::Twine; - using llvm::MemoryBuffer; - using llvm::MemoryBufferRef; - using llvm::ArrayRef; - using llvm::SmallString; - using llvm::SmallVector; - using llvm::SmallVectorImpl; - using llvm::SaveAndRestore; - using llvm::ErrorOr; - using llvm::Expected; - - using llvm::raw_ostream; -} // end namespace lld. - -namespace std { -template <> struct hash<llvm::StringRef> { -public: - size_t operator()(const llvm::StringRef &s) const { - return llvm::hash_value(s); - } -}; -} - -#endif diff --git a/gnu/llvm/tools/lld/include/lld/Core/Reproduce.h b/gnu/llvm/tools/lld/include/lld/Core/Reproduce.h deleted file mode 100644 index 6e1d36a5491..00000000000 --- a/gnu/llvm/tools/lld/include/lld/Core/Reproduce.h +++ /dev/null @@ -1,39 +0,0 @@ -//===- Reproduce.h - Utilities for creating reproducers ---------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_CORE_REPRODUCE_H -#define LLD_CORE_REPRODUCE_H - -#include "lld/Core/LLVM.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Error.h" - -namespace llvm { -namespace opt { class Arg; } -} - -namespace lld { - -// Makes a given pathname an absolute path first, and then remove -// beginning /. For example, "../foo.o" is converted to "home/john/foo.o", -// assuming that the current directory is "/home/john/bar". -std::string relativeToRoot(StringRef Path); - -// Quote a given string if it contains a space character. -std::string quote(StringRef S); - -// Rewrite the given path if a file exists with that pathname, otherwise -// returns the original path. -std::string rewritePath(StringRef S); - -// Returns the string form of the given argument. -std::string toString(llvm::opt::Arg *Arg); -} - -#endif diff --git a/gnu/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h b/gnu/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h deleted file mode 100644 index 9ba99d94b95..00000000000 --- a/gnu/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h +++ /dev/null @@ -1,20 +0,0 @@ -//===-- TargetOptionsCommandFlags.h ----------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Helper to create TargetOptions from command line flags. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/CodeGen.h" -#include "llvm/Target/TargetOptions.h" - -namespace lld { -llvm::TargetOptions InitTargetOptionsFromCodeGenFlags(); -llvm::CodeModel::Model GetCodeModelFromCMModel(); -} diff --git a/gnu/llvm/tools/lld/include/lld/Driver/Driver.h b/gnu/llvm/tools/lld/include/lld/Driver/Driver.h deleted file mode 100644 index 312f4f812b7..00000000000 --- a/gnu/llvm/tools/lld/include/lld/Driver/Driver.h +++ /dev/null @@ -1,32 +0,0 @@ -//===- lld/Driver/Driver.h - Linker Driver Emulator -----------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_DRIVER_DRIVER_H -#define LLD_DRIVER_DRIVER_H - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/Support/raw_ostream.h" - -namespace lld { -namespace coff { -bool link(llvm::ArrayRef<const char *> Args); -} - -namespace elf { -bool link(llvm::ArrayRef<const char *> Args, - llvm::raw_ostream &Diag = llvm::errs()); -} - -namespace mach_o { -bool link(llvm::ArrayRef<const char *> Args, - llvm::raw_ostream &Diag = llvm::errs()); -} -} - -#endif diff --git a/gnu/llvm/tools/lld/lib/Config/CMakeLists.txt b/gnu/llvm/tools/lld/lib/Config/CMakeLists.txt deleted file mode 100644 index e971b0b7aa6..00000000000 --- a/gnu/llvm/tools/lld/lib/Config/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_lld_library(lldConfig - Version.cpp - - ADDITIONAL_HEADER_DIRS - ${LLD_INCLUDE_DIR}/lld/Config - - LINK_LIBS - LLVMSupport - ) diff --git a/gnu/llvm/tools/lld/lib/Config/Version.cpp b/gnu/llvm/tools/lld/lib/Config/Version.cpp deleted file mode 100644 index 60687b9d894..00000000000 --- a/gnu/llvm/tools/lld/lib/Config/Version.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//===- lib/Config/Version.cpp - LLD Version Number ---------------*- C++-=====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines several version-related utility functions for LLD. -// -//===----------------------------------------------------------------------===// - -#include "lld/Config/Version.h" -#include "llvm/Support/raw_ostream.h" - -using namespace llvm; - -namespace lld { - -StringRef getLLDRepositoryPath() { -#ifdef LLD_REPOSITORY_STRING - return LLD_REPOSITORY_STRING; -#else - return ""; -#endif -} - -StringRef getLLDRevision() { -#ifdef LLD_REVISION_STRING - return LLD_REVISION_STRING; -#else - return ""; -#endif -} - -std::string getLLDRepositoryVersion() { - std::string S = getLLDRepositoryPath(); - std::string T = getLLDRevision(); - if (S.empty() && T.empty()) - return ""; - if (!S.empty() && !T.empty()) - return "(" + S + " " + T + ")"; - if (!S.empty()) - return "(" + S + ")"; - return "(" + T + ")"; -} - -StringRef getLLDVersion() { -#ifdef LLD_VERSION_STRING - return LLD_VERSION_STRING; -#else - return ""; -#endif -} - -} // end namespace lld diff --git a/gnu/llvm/tools/lld/lib/Core/Reproduce.cpp b/gnu/llvm/tools/lld/lib/Core/Reproduce.cpp deleted file mode 100644 index e3629a93cbe..00000000000 --- a/gnu/llvm/tools/lld/lib/Core/Reproduce.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//===- Reproduce.cpp - Utilities for creating reproducers -----------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lld/Core/Reproduce.h" -#include "llvm/Option/Arg.h" -#include "llvm/Support/Error.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/Path.h" - -using namespace lld; -using namespace llvm; -using namespace llvm::sys; - -// Makes a given pathname an absolute path first, and then remove -// beginning /. For example, "../foo.o" is converted to "home/john/foo.o", -// assuming that the current directory is "/home/john/bar". -// Returned string is a forward slash separated path even on Windows to avoid -// a mess with backslash-as-escape and backslash-as-path-separator. -std::string lld::relativeToRoot(StringRef Path) { - SmallString<128> Abs = Path; - if (fs::make_absolute(Abs)) - return Path; - path::remove_dots(Abs, /*remove_dot_dot=*/true); - - // This is Windows specific. root_name() returns a drive letter - // (e.g. "c:") or a UNC name (//net). We want to keep it as part - // of the result. - SmallString<128> Res; - StringRef Root = path::root_name(Abs); - if (Root.endswith(":")) - Res = Root.drop_back(); - else if (Root.startswith("//")) - Res = Root.substr(2); - - path::append(Res, path::relative_path(Abs)); - return path::convert_to_slash(Res); -} - -// Quote a given string if it contains a space character. -std::string lld::quote(StringRef S) { - if (S.find(' ') == StringRef::npos) - return S; - return ("\"" + S + "\"").str(); -} - -std::string lld::rewritePath(StringRef S) { - if (fs::exists(S)) - return relativeToRoot(S); - return S; -} - -std::string lld::toString(opt::Arg *Arg) { - std::string K = Arg->getSpelling(); - if (Arg->getNumValues() == 0) - return K; - std::string V = quote(Arg->getValue()); - if (Arg->getOption().getRenderStyle() == opt::Option::RenderJoinedStyle) - return K + V; - return K + " " + V; -} diff --git a/gnu/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp b/gnu/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp deleted file mode 100644 index e0f26761e70..00000000000 --- a/gnu/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//===-- TargetOptionsCommandFlags.cpp ---------------------------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file exists as a place for global variables defined in LLVM's -// CodeGen/CommandFlags.h. By putting the resulting object file in -// an archive and linking with it, the definitions will automatically be -// included when needed and skipped when already present. -// -//===----------------------------------------------------------------------===// - -#include "lld/Core/TargetOptionsCommandFlags.h" - -#include "llvm/CodeGen/CommandFlags.h" -#include "llvm/Target/TargetOptions.h" - -// Define an externally visible version of -// InitTargetOptionsFromCodeGenFlags, so that its functionality can be -// used without having to include llvm/CodeGen/CommandFlags.h, which -// would lead to multiple definitions of the command line flags. -llvm::TargetOptions lld::InitTargetOptionsFromCodeGenFlags() { - return ::InitTargetOptionsFromCodeGenFlags(); -} - -llvm::CodeModel::Model lld::GetCodeModelFromCMModel() { - return CMModel; -} diff --git a/gnu/llvm/tools/lldb/cmake/LLDBDependencies.cmake b/gnu/llvm/tools/lldb/cmake/LLDBDependencies.cmake deleted file mode 100644 index 55ce3790856..00000000000 --- a/gnu/llvm/tools/lldb/cmake/LLDBDependencies.cmake +++ /dev/null @@ -1,52 +0,0 @@ -set(LLDB_SYSTEM_LIBS) - -# Windows-only libraries -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - list(APPEND LLDB_SYSTEM_LIBS - ws2_32 - rpcrt4 - ) -endif () - -if (NOT LLDB_DISABLE_LIBEDIT) - list(APPEND LLDB_SYSTEM_LIBS edit) -endif() -if (NOT LLDB_DISABLE_CURSES) - list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES}) - if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO) - list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS}) - endif() -endif() - -if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) - list(APPEND LLDB_SYSTEM_LIBS atomic) -endif() - -list(APPEND LLDB_SYSTEM_LIBS ${Backtrace_LIBRARY}) - -if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC) - list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES}) -endif() - -list(APPEND LLDB_SYSTEM_LIBS ${system_libs}) - -if (LLVM_BUILD_STATIC) - if (NOT LLDB_DISABLE_PYTHON) - list(APPEND LLDB_SYSTEM_LIBS python2.7 util) - endif() - if (NOT LLDB_DISABLE_CURSES) - list(APPEND LLDB_SYSTEM_LIBS gpm) - endif() -endif() - -if ( NOT LLDB_DISABLE_PYTHON ) - set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1) - if (CLANG_CL) - set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES COMPILE_FLAGS -Wno-unused-function) - endif() - if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND - NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") - set_property(SOURCE ${LLDB_WRAP_PYTHON} - APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual") - endif () -endif() diff --git a/gnu/llvm/tools/lldb/include/lldb/Core/ArchSpec.h b/gnu/llvm/tools/lldb/include/lldb/Core/ArchSpec.h deleted file mode 100644 index 75c7079be08..00000000000 --- a/gnu/llvm/tools/lldb/include/lldb/Core/ArchSpec.h +++ /dev/null @@ -1,665 +0,0 @@ -//===-- ArchSpec.h ----------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef liblldb_ArchSpec_h_ -#define liblldb_ArchSpec_h_ - -#if defined(__cplusplus) - -#include "lldb/Utility/ConstString.h" -#include "lldb/lldb-enumerations.h" -#include "lldb/lldb-private-enumerations.h" -#include "llvm/ADT/StringRef.h" // for StringRef -#include "llvm/ADT/Triple.h" - -#include <string> // for string - -#include <stddef.h> // for size_t -#include <stdint.h> // for uint32_t - -namespace lldb_private { -class Platform; -} -namespace lldb_private { -class Stream; -} -namespace lldb_private { -class StringList; -} -namespace lldb_private { -class Thread; -} - -namespace lldb_private { - -//---------------------------------------------------------------------- -/// @class ArchSpec ArchSpec.h "lldb/Core/ArchSpec.h" -/// @brief An architecture specification class. -/// -/// A class designed to be created from a cpu type and subtype, a -/// string representation, or an llvm::Triple. Keeping all of the -/// conversions of strings to architecture enumeration values confined -/// to this class allows new architecture support to be added easily. -//---------------------------------------------------------------------- -class ArchSpec { -public: - enum MIPSSubType { - eMIPSSubType_unknown, - eMIPSSubType_mips32, - eMIPSSubType_mips32r2, - eMIPSSubType_mips32r6, - eMIPSSubType_mips32el, - eMIPSSubType_mips32r2el, - eMIPSSubType_mips32r6el, - eMIPSSubType_mips64, - eMIPSSubType_mips64r2, - eMIPSSubType_mips64r6, - eMIPSSubType_mips64el, - eMIPSSubType_mips64r2el, - eMIPSSubType_mips64r6el, - }; - - // Masks for the ases word of an ABI flags structure. - enum MIPSASE { - eMIPSAse_dsp = 0x00000001, // DSP ASE - eMIPSAse_dspr2 = 0x00000002, // DSP R2 ASE - eMIPSAse_eva = 0x00000004, // Enhanced VA Scheme - eMIPSAse_mcu = 0x00000008, // MCU (MicroController) ASE - eMIPSAse_mdmx = 0x00000010, // MDMX ASE - eMIPSAse_mips3d = 0x00000020, // MIPS-3D ASE - eMIPSAse_mt = 0x00000040, // MT ASE - eMIPSAse_smartmips = 0x00000080, // SmartMIPS ASE - eMIPSAse_virt = 0x00000100, // VZ ASE - eMIPSAse_msa = 0x00000200, // MSA ASE - eMIPSAse_mips16 = 0x00000400, // MIPS16 ASE - eMIPSAse_micromips = 0x00000800, // MICROMIPS ASE - eMIPSAse_xpa = 0x00001000, // XPA ASE - eMIPSAse_mask = 0x00001fff, - eMIPSABI_O32 = 0x00002000, - eMIPSABI_N32 = 0x00004000, - eMIPSABI_N64 = 0x00008000, - eMIPSABI_O64 = 0x00020000, - eMIPSABI_EABI32 = 0x00040000, - eMIPSABI_EABI64 = 0x00080000, - eMIPSABI_mask = 0x000ff000 - }; - - // MIPS Floating point ABI Values - enum MIPS_ABI_FP { - eMIPS_ABI_FP_ANY = 0x00000000, - eMIPS_ABI_FP_DOUBLE = 0x00100000, // hard float / -mdouble-float - eMIPS_ABI_FP_SINGLE = 0x00200000, // hard float / -msingle-float - eMIPS_ABI_FP_SOFT = 0x00300000, // soft float - eMIPS_ABI_FP_OLD_64 = 0x00400000, // -mips32r2 -mfp64 - eMIPS_ABI_FP_XX = 0x00500000, // -mfpxx - eMIPS_ABI_FP_64 = 0x00600000, // -mips32r2 -mfp64 - eMIPS_ABI_FP_64A = 0x00700000, // -mips32r2 -mfp64 -mno-odd-spreg - eMIPS_ABI_FP_mask = 0x00700000 - }; - - // ARM specific e_flags - enum ARMeflags { - eARM_abi_soft_float = 0x00000200, - eARM_abi_hard_float = 0x00000400 - }; - - enum Core { - eCore_arm_generic, - eCore_arm_armv4, - eCore_arm_armv4t, - eCore_arm_armv5, - eCore_arm_armv5e, - eCore_arm_armv5t, - eCore_arm_armv6, - eCore_arm_armv6m, - eCore_arm_armv7, - eCore_arm_armv7f, - eCore_arm_armv7s, - eCore_arm_armv7k, - eCore_arm_armv7m, - eCore_arm_armv7em, - eCore_arm_xscale, - - eCore_thumb, - eCore_thumbv4t, - eCore_thumbv5, - eCore_thumbv5e, - eCore_thumbv6, - eCore_thumbv6m, - eCore_thumbv7, - eCore_thumbv7s, - eCore_thumbv7k, - eCore_thumbv7f, - eCore_thumbv7m, - eCore_thumbv7em, - eCore_arm_arm64, - eCore_arm_armv8, - eCore_arm_aarch64, - - eCore_mips32, - eCore_mips32r2, - eCore_mips32r3, - eCore_mips32r5, - eCore_mips32r6, - eCore_mips32el, - eCore_mips32r2el, - eCore_mips32r3el, - eCore_mips32r5el, - eCore_mips32r6el, - eCore_mips64, - eCore_mips64r2, - eCore_mips64r3, - eCore_mips64r5, - eCore_mips64r6, - eCore_mips64el, - eCore_mips64r2el, - eCore_mips64r3el, - eCore_mips64r5el, - eCore_mips64r6el, - - eCore_ppc_generic, - eCore_ppc_ppc601, - eCore_ppc_ppc602, - eCore_ppc_ppc603, - eCore_ppc_ppc603e, - eCore_ppc_ppc603ev, - eCore_ppc_ppc604, - eCore_ppc_ppc604e, - eCore_ppc_ppc620, - eCore_ppc_ppc750, - eCore_ppc_ppc7400, - eCore_ppc_ppc7450, - eCore_ppc_ppc970, - - eCore_ppc64_generic, - eCore_ppc64_ppc970_64, - - eCore_s390x_generic, - - eCore_sparc_generic, - - eCore_sparc9_generic, - - eCore_x86_32_i386, - eCore_x86_32_i486, - eCore_x86_32_i486sx, - eCore_x86_32_i686, - - eCore_x86_64_x86_64, - eCore_x86_64_x86_64h, // Haswell enabled x86_64 - eCore_hexagon_generic, - eCore_hexagon_hexagonv4, - eCore_hexagon_hexagonv5, - - eCore_uknownMach32, - eCore_uknownMach64, - - eCore_kalimba3, - eCore_kalimba4, - eCore_kalimba5, - - kNumCores, - - kCore_invalid, - // The following constants are used for wildcard matching only - kCore_any, - kCore_arm_any, - kCore_ppc_any, - kCore_ppc64_any, - kCore_x86_32_any, - kCore_x86_64_any, - kCore_hexagon_any, - - kCore_arm_first = eCore_arm_generic, - kCore_arm_last = eCore_arm_xscale, - - kCore_thumb_first = eCore_thumb, - kCore_thumb_last = eCore_thumbv7em, - - kCore_ppc_first = eCore_ppc_generic, - kCore_ppc_last = eCore_ppc_ppc970, - - kCore_ppc64_first = eCore_ppc64_generic, - kCore_ppc64_last = eCore_ppc64_ppc970_64, - - kCore_x86_32_first = eCore_x86_32_i386, - kCore_x86_32_last = eCore_x86_32_i686, - - kCore_x86_64_first = eCore_x86_64_x86_64, - kCore_x86_64_last = eCore_x86_64_x86_64h, - - kCore_hexagon_first = eCore_hexagon_generic, - kCore_hexagon_last = eCore_hexagon_hexagonv5, - - kCore_kalimba_first = eCore_kalimba3, - kCore_kalimba_last = eCore_kalimba5, - - kCore_mips32_first = eCore_mips32, - kCore_mips32_last = eCore_mips32r6, - - kCore_mips32el_first = eCore_mips32el, - kCore_mips32el_last = eCore_mips32r6el, - - kCore_mips64_first = eCore_mips64, - kCore_mips64_last = eCore_mips64r6, - - kCore_mips64el_first = eCore_mips64el, - kCore_mips64el_last = eCore_mips64r6el, - - kCore_mips_first = eCore_mips32, - kCore_mips_last = eCore_mips64r6el - - }; - - typedef void (*StopInfoOverrideCallbackType)(lldb_private::Thread &thread); - - //------------------------------------------------------------------ - /// Default constructor. - /// - /// Default constructor that initializes the object with invalid - /// cpu type and subtype values. - //------------------------------------------------------------------ - ArchSpec(); - - //------------------------------------------------------------------ - /// Constructor over triple. - /// - /// Constructs an ArchSpec with properties consistent with the given - /// Triple. - //------------------------------------------------------------------ - explicit ArchSpec(const llvm::Triple &triple); - explicit ArchSpec(const char *triple_cstr); - explicit ArchSpec(llvm::StringRef triple_str); - ArchSpec(const char *triple_cstr, Platform *platform); - ArchSpec(llvm::StringRef triple_str, Platform *platform); - //------------------------------------------------------------------ - /// Constructor over architecture name. - /// - /// Constructs an ArchSpec with properties consistent with the given - /// object type and architecture name. - //------------------------------------------------------------------ - explicit ArchSpec(ArchitectureType arch_type, uint32_t cpu_type, - uint32_t cpu_subtype); - - //------------------------------------------------------------------ - /// Destructor. - //------------------------------------------------------------------ - ~ArchSpec(); - - //------------------------------------------------------------------ - /// Assignment operator. - /// - /// @param[in] rhs another ArchSpec object to copy. - /// - /// @return A const reference to this object. - //------------------------------------------------------------------ - const ArchSpec &operator=(const ArchSpec &rhs); - - static size_t AutoComplete(llvm::StringRef name, StringList &matches); - - //------------------------------------------------------------------ - /// Returns a static string representing the current architecture. - /// - /// @return A static string correcponding to the current - /// architecture. - //------------------------------------------------------------------ - const char *GetArchitectureName() const; - - //----------------------------------------------------------------- - /// if MIPS architecture return true. - /// - /// @return a boolean value. - //----------------------------------------------------------------- - bool IsMIPS() const; - - //------------------------------------------------------------------ - /// Returns a string representing current architecture as a target CPU - /// for tools like compiler, disassembler etc. - /// - /// @return A string representing target CPU for the current - /// architecture. - //------------------------------------------------------------------ - std::string GetClangTargetCPU() const; - - //------------------------------------------------------------------ - /// Return a string representing target application ABI. - /// - /// @return A string representing target application ABI. - //------------------------------------------------------------------ - std::string GetTargetABI() const; - - //------------------------------------------------------------------ - /// Clears the object state. - /// - /// Clears the object state back to a default invalid state. - //------------------------------------------------------------------ - void Clear(); - - //------------------------------------------------------------------ - /// Returns the size in bytes of an address of the current - /// architecture. - /// - /// @return The byte size of an address of the current architecture. - //------------------------------------------------------------------ - uint32_t GetAddressByteSize() const; - - //------------------------------------------------------------------ - /// Returns a machine family for the current architecture. - /// - /// @return An LLVM arch type. - //------------------------------------------------------------------ - llvm::Triple::ArchType GetMachine() const; - - //------------------------------------------------------------------ - /// Returns the distribution id of the architecture. - /// - /// This will be something like "ubuntu", "fedora", etc. on Linux. - /// - /// @return A ConstString ref containing the distribution id, - /// potentially empty. - //------------------------------------------------------------------ - const ConstString &GetDistributionId() const; - - //------------------------------------------------------------------ - /// Set the distribution id of the architecture. - /// - /// This will be something like "ubuntu", "fedora", etc. on Linux. - /// This should be the same value returned by - /// HostInfo::GetDistributionId (). - ///------------------------------------------------------------------ - void SetDistributionId(const char *distribution_id); - - //------------------------------------------------------------------ - /// Tests if this ArchSpec is valid. - /// - /// @return True if the current architecture is valid, false - /// otherwise. - //------------------------------------------------------------------ - bool IsValid() const { - return m_core >= eCore_arm_generic && m_core < kNumCores; - } - - bool TripleVendorWasSpecified() const { - return !m_triple.getVendorName().empty(); - } - - bool TripleVendorIsUnspecifiedUnknown() const { - return m_triple.getVendor() == llvm::Triple::UnknownVendor && - m_triple.getVendorName().empty(); - } - - bool TripleOSWasSpecified() const { return !m_triple.getOSName().empty(); } - - bool TripleEnvironmentWasSpecified() const { - return !m_triple.getEnvironmentName().empty(); - } - - bool TripleOSIsUnspecifiedUnknown() const { - return m_triple.getOS() == llvm::Triple::UnknownOS && - m_triple.getOSName().empty(); - } - - //------------------------------------------------------------------ - /// Merges fields from another ArchSpec into this ArchSpec. - /// - /// This will use the supplied ArchSpec to fill in any fields of - /// the triple in this ArchSpec which were unspecified. This can - /// be used to refine a generic ArchSpec with a more specific one. - /// For example, if this ArchSpec's triple is something like - /// i386-unknown-unknown-unknown, and we have a triple which is - /// x64-pc-windows-msvc, then merging that triple into this one - /// will result in the triple i386-pc-windows-msvc. - /// - //------------------------------------------------------------------ - void MergeFrom(const ArchSpec &other); - - //------------------------------------------------------------------ - /// Change the architecture object type, CPU type and OS type. - /// - /// @param[in] arch_type The object type of this ArchSpec. - /// - /// @param[in] cpu The required CPU type. - /// - /// @param[in] os The optional OS type - /// The default value of 0 was chosen to from the ELF spec value - /// ELFOSABI_NONE. ELF is the only one using this parameter. If another - /// format uses this parameter and 0 does not work, use a value over - /// 255 because in the ELF header this is value is only a byte. - /// - /// @return True if the object, and CPU were successfully set. - /// - /// As a side effect, the vendor value is usually set to unknown. - /// The exections are - /// aarch64-apple-ios - /// arm-apple-ios - /// thumb-apple-ios - /// x86-apple- - /// x86_64-apple- - /// - /// As a side effect, the os value is usually set to unknown - /// The exceptions are - /// *-*-aix - /// aarch64-apple-ios - /// arm-apple-ios - /// thumb-apple-ios - /// powerpc-apple-darwin - /// *-*-freebsd - /// *-*-linux - /// *-*-netbsd - /// *-*-openbsd - /// *-*-solaris - //------------------------------------------------------------------ - bool SetArchitecture(ArchitectureType arch_type, uint32_t cpu, uint32_t sub, - uint32_t os = 0); - - //------------------------------------------------------------------ - /// Returns the byte order for the architecture specification. - /// - /// @return The endian enumeration for the current endianness of - /// the architecture specification - //------------------------------------------------------------------ - lldb::ByteOrder GetByteOrder() const; - - //------------------------------------------------------------------ - /// Sets this ArchSpec's byte order. - /// - /// In the common case there is no need to call this method as the - /// byte order can almost always be determined by the architecture. - /// However, many CPU's are bi-endian (ARM, Alpha, PowerPC, etc) - /// and the default/assumed byte order may be incorrect. - //------------------------------------------------------------------ - void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; } - - uint32_t GetMinimumOpcodeByteSize() const; - - uint32_t GetMaximumOpcodeByteSize() const; - - Core GetCore() const { return m_core; } - - uint32_t GetMachOCPUType() const; - - uint32_t GetMachOCPUSubType() const; - - //------------------------------------------------------------------ - /// Architecture data byte width accessor - /// - /// @return the size in 8-bit (host) bytes of a minimum addressable - /// unit from the Architecture's data bus - //------------------------------------------------------------------ - uint32_t GetDataByteSize() const; - - //------------------------------------------------------------------ - /// Architecture code byte width accessor - /// - /// @return the size in 8-bit (host) bytes of a minimum addressable - /// unit from the Architecture's code bus - //------------------------------------------------------------------ - uint32_t GetCodeByteSize() const; - - //------------------------------------------------------------------ - /// Architecture tripple accessor. - /// - /// @return A triple describing this ArchSpec. - //------------------------------------------------------------------ - llvm::Triple &GetTriple() { return m_triple; } - - //------------------------------------------------------------------ - /// Architecture tripple accessor. - /// - /// @return A triple describing this ArchSpec. - //------------------------------------------------------------------ - const llvm::Triple &GetTriple() const { return m_triple; } - - void DumpTriple(Stream &s) const; - - //------------------------------------------------------------------ - /// Architecture tripple setter. - /// - /// Configures this ArchSpec according to the given triple. If the - /// triple has unknown components in all of the vendor, OS, and - /// the optional environment field (i.e. "i386-unknown-unknown") - /// then default values are taken from the host. Architecture and - /// environment components are used to further resolve the CPU type - /// and subtype, endian characteristics, etc. - /// - /// @return A triple describing this ArchSpec. - //------------------------------------------------------------------ - bool SetTriple(const llvm::Triple &triple); - - bool SetTriple(llvm::StringRef triple_str); - bool SetTriple(llvm::StringRef triple_str, Platform *platform); - - bool SetTriple(const char *triple_cstr); - bool SetTriple(const char *triple_cstr, Platform *platform); - - //------------------------------------------------------------------ - /// Returns the default endianness of the architecture. - /// - /// @return The endian enumeration for the default endianness of - /// the architecture. - //------------------------------------------------------------------ - lldb::ByteOrder GetDefaultEndian() const; - - //------------------------------------------------------------------ - /// Returns true if 'char' is a signed type by defualt in the - /// architecture false otherwise - /// - /// @return True if 'char' is a signed type by default on the - /// architecture and false otherwise. - //------------------------------------------------------------------ - bool CharIsSignedByDefault() const; - - //------------------------------------------------------------------ - /// Compare an ArchSpec to another ArchSpec, requiring an exact cpu - /// type match between them. - /// e.g. armv7s is not an exact match with armv7 - this would return false - /// - /// @return true if the two ArchSpecs match. - //------------------------------------------------------------------ - bool IsExactMatch(const ArchSpec &rhs) const; - - //------------------------------------------------------------------ - /// Compare an ArchSpec to another ArchSpec, requiring a compatible - /// cpu type match between them. - /// e.g. armv7s is compatible with armv7 - this method would return true - /// - /// @return true if the two ArchSpecs are compatible - //------------------------------------------------------------------ - bool IsCompatibleMatch(const ArchSpec &rhs) const; - - //------------------------------------------------------------------ - /// Get a stop info override callback for the current architecture. - /// - /// Most platform specific code should go in lldb_private::Platform, - /// but there are cases where no matter which platform you are on - /// certain things hold true. - /// - /// This callback is currently intended to handle cases where a - /// program stops at an instruction that won't get executed and it - /// allows the stop reasonm, like "breakpoint hit", to be replaced - /// with a different stop reason like "no stop reason". - /// - /// This is specifically used for ARM in Thumb code when we stop in - /// an IT instruction (if/then/else) where the instruction won't get - /// executed and therefore it wouldn't be correct to show the program - /// stopped at the current PC. The code is generic and applies to all - /// ARM CPUs. - /// - /// @return NULL or a valid stop info override callback for the - /// current architecture. - //------------------------------------------------------------------ - StopInfoOverrideCallbackType GetStopInfoOverrideCallback() const; - - bool IsFullySpecifiedTriple() const; - - void PiecewiseTripleCompare(const ArchSpec &other, bool &arch_different, - bool &vendor_different, bool &os_different, - bool &os_version_different, bool &env_different); - - //------------------------------------------------------------------ - /// Detect whether this architecture uses thumb code exclusively - /// - /// Some embedded ARM chips (e.g. the ARM Cortex M0-7 line) can - /// only execute the Thumb instructions, never Arm. We should normally - /// pick up arm/thumbness from their the processor status bits (cpsr/xpsr) - /// or hints on each function - but when doing bare-boards low level - /// debugging (especially common with these embedded processors), we may - /// not have those things easily accessible. - /// - /// @return true if this is an arm ArchSpec which can only execute Thumb - /// instructions - //------------------------------------------------------------------ - bool IsAlwaysThumbInstructions() const; - - uint32_t GetFlags() const { return m_flags; } - - void SetFlags(uint32_t flags) { m_flags = flags; } - - void SetFlags(std::string elf_abi); - -protected: - bool IsEqualTo(const ArchSpec &rhs, bool exact_match) const; - void UpdateCore(); - - llvm::Triple m_triple; - Core m_core = kCore_invalid; - lldb::ByteOrder m_byte_order = lldb::eByteOrderInvalid; - - // Additional arch flags which we cannot get from triple and core - // For MIPS these are application specific extensions like - // micromips, mips16 etc. - uint32_t m_flags = 0; - - ConstString m_distribution_id; - - // Called when m_def or m_entry are changed. Fills in all remaining - // members with default values. - void CoreUpdated(bool update_triple); -}; - -//------------------------------------------------------------------ -/// @fn bool operator< (const ArchSpec& lhs, const ArchSpec& rhs) -/// @brief Less than operator. -/// -/// Tests two ArchSpec objects to see if \a lhs is less than \a -/// rhs. -/// -/// @param[in] lhs The Left Hand Side ArchSpec object to compare. -/// @param[in] rhs The Left Hand Side ArchSpec object to compare. -/// -/// @return true if \a lhs is less than \a rhs -//------------------------------------------------------------------ -bool operator<(const ArchSpec &lhs, const ArchSpec &rhs); - -bool ParseMachCPUDashSubtypeTriple(llvm::StringRef triple_str, ArchSpec &arch); - -} // namespace lldb_private - -#endif // #if defined(__cplusplus) -#endif // #ifndef liblldb_ArchSpec_h_ diff --git a/gnu/llvm/tools/lldb/include/lldb/Utility/TaskPool.h b/gnu/llvm/tools/lldb/include/lldb/Utility/TaskPool.h deleted file mode 100644 index f2deaee506b..00000000000 --- a/gnu/llvm/tools/lldb/include/lldb/Utility/TaskPool.h +++ /dev/null @@ -1,92 +0,0 @@ -//===--------------------- TaskPool.h ---------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef utility_TaskPool_h_ -#define utility_TaskPool_h_ - -#include "llvm/ADT/STLExtras.h" -#include <functional> // for bind, function -#include <future> -#include <list> -#include <memory> // for make_shared -#include <mutex> // for mutex, unique_lock, condition_variable -#include <type_traits> // for forward, result_of, move - -// Global TaskPool class for running tasks in parallel on a set of worker thread -// created the first -// time the task pool is used. The TaskPool provide no guarantee about the order -// the task will be run -// and about what tasks will run in parallel. None of the task added to the task -// pool should block -// on something (mutex, future, condition variable) what will be set only by the -// completion of an -// other task on the task pool as they may run on the same thread sequentally. -class TaskPool { -public: - // Add a new task to the task pool and return a std::future belonging to the - // newly created task. - // The caller of this function has to wait on the future for this task to - // complete. - template <typename F, typename... Args> - static std::future<typename std::result_of<F(Args...)>::type> - AddTask(F &&f, Args &&... args); - - // Run all of the specified tasks on the task pool and wait until all of them - // are finished - // before returning. This method is intended to be used for small number tasks - // where listing - // them as function arguments is acceptable. For running large number of tasks - // you should use - // AddTask for each task and then call wait() on each returned future. - template <typename... T> static void RunTasks(T &&... tasks); - -private: - TaskPool() = delete; - - template <typename... T> struct RunTaskImpl; - - static void AddTaskImpl(std::function<void()> &&task_fn); -}; - -template <typename F, typename... Args> -std::future<typename std::result_of<F(Args...)>::type> -TaskPool::AddTask(F &&f, Args &&... args) { - auto task_sp = std::make_shared< - std::packaged_task<typename std::result_of<F(Args...)>::type()>>( - std::bind(std::forward<F>(f), std::forward<Args>(args)...)); - - AddTaskImpl([task_sp]() { (*task_sp)(); }); - - return task_sp->get_future(); -} - -template <typename... T> void TaskPool::RunTasks(T &&... tasks) { - RunTaskImpl<T...>::Run(std::forward<T>(tasks)...); -} - -template <typename Head, typename... Tail> -struct TaskPool::RunTaskImpl<Head, Tail...> { - static void Run(Head &&h, Tail &&... t) { - auto f = AddTask(std::forward<Head>(h)); - RunTaskImpl<Tail...>::Run(std::forward<Tail>(t)...); - f.wait(); - } -}; - -template <> struct TaskPool::RunTaskImpl<> { - static void Run() {} -}; - -// Run 'func' on every value from begin .. end-1. Each worker will grab -// 'batch_size' numbers at a time to work on, so for very fast functions, batch -// should be large enough to avoid too much cache line contention. -void TaskMapOverInt(size_t begin, size_t end, - const llvm::function_ref<void(size_t)> &func); - -#endif // #ifndef utility_TaskPool_h_ diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py deleted file mode 100644 index 4ddda525537..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py +++ /dev/null @@ -1,57 +0,0 @@ -""" -Test some ARM instruction emulation. -""" - -from __future__ import print_function - - -import os -import time -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class ARMEmulationTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - @no_debug_info_test - def test_thumb_emulations(self): - current_dir = os.getcwd() - test_dir = os.path.join(current_dir, "new-test-files") - files = os.listdir(test_dir) - thumb_files = list() - for f in files: - if '-thumb.dat' in f: - thumb_files.append(f) - - for f in thumb_files: - test_file = os.path.join(test_dir, f) - self.run_a_single_test(test_file) - - @no_debug_info_test - def test_arm_emulations(self): - current_dir = os.getcwd() - test_dir = os.path.join(current_dir, "new-test-files") - files = os.listdir(test_dir) - arm_files = list() - for f in files: - if '-arm.dat' in f: - arm_files.append(f) - - for f in arm_files: - test_file = os.path.join(test_dir, f) - self.run_a_single_test(test_file) - - def run_a_single_test(self, filename): - insn = lldb.SBInstruction() - stream = lldb.SBStream() - success = insn.TestEmulation(stream, filename) - output = stream.GetData() - if self.TraceOn(): - print('\nRunning test ' + os.path.basename(filename)) - print(output) - - self.assertTrue(success, 'Emulation test succeeded.') diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-1-arm.dat deleted file mode 100644 index 64b2506f9d5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r0, r0, r15" -triple=arm-apple-ios -opcode=0xe080000f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00003000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-1-thumb.dat deleted file mode 100644 index daa32d25a41..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r0, r13, #0" -triple=thumb-apple-ios -opcode=0xa800 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-10-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-10-thumb.dat deleted file mode 100644 index bb3d760219b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-10-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add sp, r13" -triple=thumb-apple-ios -opcode=0x44ed -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x5fbffca0 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-11-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-11-thumb.dat deleted file mode 100644 index e26f2218cbc..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-11-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add sp, r15" -triple=thumb-apple-ios -opcode=0x44fd -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fe02e50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-12-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-12-thumb.dat deleted file mode 100644 index a7f7344e7d9..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-12-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add sp, r8" -triple=thumb-apple-ios -opcode=0x44c5 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-2-arm.dat deleted file mode 100644 index cf6e0a9779a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-2-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r0, r13, #0" -triple=arm-apple-ios -opcode=0xe28d0000 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-2-thumb.dat deleted file mode 100644 index 9a178a0a159..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r0, sp, r0" -triple=thumb-apple-ios -opcode=0x4468 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-3-arm.dat deleted file mode 100644 index 9fc44b79395..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-3-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r0, r1, r0, lsl #2" -triple=arm-apple-ios -opcode=0xe0810100 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000001 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-3-thumb.dat deleted file mode 100644 index c8f96ec09d3..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add.w r10, r13, #31" -triple=thumb-apple-ios -opcode=0xf10d0a1f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe5f -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-4-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-4-arm.dat deleted file mode 100644 index 12b40ed76fc..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-4-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r0, r2, r7, lsl r1" -triple=arm-apple-ios -opcode=0xe0820117 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x5fbffc82 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-4-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-4-thumb.dat deleted file mode 100644 index 922b8ecdba5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-4-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r3, r13, #16" -triple=thumb-apple-ios -opcode=0xab04 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x2fdffe58 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-5-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-5-arm.dat deleted file mode 100644 index dfb6a87f014..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-5-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r10, r13, #31" -triple=arm-apple-ios -opcode=0xe28da01f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe6f -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-5-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-5-thumb.dat deleted file mode 100644 index 16ff517436b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-5-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r3, sp, r3" -triple=thumb-apple-ios -opcode=0x446b -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x2fdffe53 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-6-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-6-arm.dat deleted file mode 100644 index 8a87eff5f00..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-6-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r12, r13, #24" -triple=arm-apple-ios -opcode=0xe28dc018 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x2fdffe68 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-6-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-6-thumb.dat deleted file mode 100644 index e8abd6950f2..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-6-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r5, r13, #32" -triple=thumb-apple-ios -opcode=0xad08 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x2fdffe68 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-7-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-7-arm.dat deleted file mode 100644 index 312514246e3..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-7-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add r6, sp, #8" -triple=arm-apple-ios -opcode=0xe28d6008 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x2fdffe68 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-7-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-7-thumb.dat deleted file mode 100644 index 506071309d7..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-7-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add sp, #16" -triple=thumb-apple-ios -opcode=0xb004 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe68 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-8-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-8-arm.dat deleted file mode 100644 index 44a400f5287..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-8-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add sp, r8" -triple=arm-apple-ios -opcode=0xe08dd008 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe68 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-8-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-8-thumb.dat deleted file mode 100644 index 8bc6c789a51..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-8-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add sp, #4" -triple=thumb-apple-ios -opcode=0xb001 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe5c -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-9-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-9-thumb.dat deleted file mode 100644 index 832af4cf0b4..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-add-9-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="add sp, r10" -triple=thumb-apple-ios -opcode=0x44d5 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe5a -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-bic-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-bic-1-arm.dat deleted file mode 100644 index c1cd4f15ab3..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-bic-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="bic r4, r9" -triple=arm-apple-ios -opcode=0xe1c44009 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-bic-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-bic-1-thumb.dat deleted file mode 100644 index c6242265018..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-bic-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="bics r4, r6" -triple=thumb-apple-ios -opcode=0x43b4 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000000 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-1-arm.dat deleted file mode 100644 index e1922d9edb9..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-1-arm.dat +++ /dev/null @@ -1,119 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldmia r0!, {r1, r3}" -triple=arm-apple-ios -opcode=0xe8b0000a -before_state={ -memory={ -address=0x2fdffe50 -data_encoding=uint32_t -data=[ - 0x0 - 0x2e7c -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x00000000 -r2=0x2fdffe70 -r3=0x00002e7c -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-1-thumb.dat deleted file mode 100644 index 60a805e09d8..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-1-thumb.dat +++ /dev/null @@ -1,119 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldmia r0!, {r1, r3}" -triple=thumb-apple-ios -opcode=0xc80a -before_state={ -memory={ -address=0x2fdffe40 -data_encoding=uint32_t -data=[ -0x0 -0x2f84 -] -} -registers={ -r0=0x2fdffe40 -r1=0x2fdffe50 -r2=0x2fdffe60 -r3=0x2fdffe70 -r4=0x2fdffe80 -r5=0x2fdffe90 -r6=0x2fdffea0 -r7=0x2fdffe40 -r8=0x2fdffec0 -r9=0x2fdffed0 -r10=0x2fdffee0 -r11=0x2fdffef0 -r12=0x2fdfff00 -r13=0x2fdffe40 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe48 -r1=0x00000000 -r2=0x2fdffe60 -r3=0x00002f84 -r4=0x2fdffe80 -r5=0x2fdffe90 -r6=0x2fdffea0 -r7=0x2fdffe40 -r8=0x2fdffec0 -r9=0x2fdffed0 -r10=0x2fdffee0 -r11=0x2fdffef0 -r12=0x2fdfff00 -r13=0x2fdffe40 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-2-arm.dat deleted file mode 100644 index 99401bbd2e2..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-2-arm.dat +++ /dev/null @@ -1,123 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldmia r0!, {r2, r4, r6, r8, r10, r12}" -triple=arm-apple-ios -opcode=0xe8b01554 -before_state={ -memory={ -address=0x2fdffe20 -data_encoding=uint32_t -data=[ -0x0 -0x2e7c -0x1 -0x2fdffe84 -0x0 -0x0 -] -} -registers={ -r0=0x2fdffe20 -r1=0x2fdffe30 -r2=0x2fdffe40 -r3=0x0000001f -r4=0x2fdffe60 -r5=0x2fdffe70 -r6=0x2fdffe80 -r7=0x2fdffe20 -r8=0x2fdffea0 -r9=0x2fdffeb0 -r10=0x2fdffec0 -r11=0x2fdffed0 -r12=0x2fdffee0 -r13=0x2fdffe20 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe38 -r1=0x2fdffe30 -r2=0x00000000 -r3=0x0000001f -r4=0x00002e7c -r5=0x2fdffe70 -r6=0x00000001 -r7=0x2fdffe20 -r8=0x2fdffe84 -r9=0x2fdffeb0 -r10=0x00000000 -r11=0x2fdffed0 -r12=0x00000000 -r13=0x2fdffe20 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-2-thumb.dat deleted file mode 100644 index 39ecf947c6d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-2-thumb.dat +++ /dev/null @@ -1,123 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldmia.w r0!,{r2,r4,r6,r8,r10,r12}" -triple=thumb-apple-ios -opcode=0xe8b01554 -before_state={ -memory={ -address=0x2fdffe50 -data_encoding=uint32_t -data=[ -0x0 -0x2f80 -0x1 -0x2fdffeac -0x0 -0x0 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe68 -r1=0x2fdffe60 -r2=0x00000000 -r3=0x2fdffe80 -r4=0x00002f80 -r5=0x2fdffea0 -r6=0x00000001 -r7=0x2fdffe50 -r8=0x2fdffeac -r9=0x2fdffee0 -r10=0x00000000 -r11=0x2fdfff00 -r12=0x00000000 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-3-arm.dat deleted file mode 100644 index 427d7b27485..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-3-arm.dat +++ /dev/null @@ -1,119 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldmia r14!, {r1, r3}" -triple=arm-apple-ios -opcode=0xe8be000a -before_state={ -memory={ -address=0x2e7c -data_encoding=uint32_t -data=[ -0xe59fc00c -0xe08fc00c -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0xe59fc00c -r2=0x2fdffe70 -r3=0xe08fc00c -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e84 -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-3-thumb.dat deleted file mode 100644 index 9738073c038..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldmia-3-thumb.dat +++ /dev/null @@ -1,119 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldmia.w r14!, {r1, r3}" -triple=thumb-apple-ios -opcode=0xe8be000a -before_state={ -memory={ -address=0x2f80 -data_encoding=uint32_t -data=[ -0xe59fc00c -0xe08fc00c -] -} -registers={ -r0=0x2fdffe78 -r1=0x2fdffe88 -r2=0x2fdffe98 -r3=0x2fdffea8 -r4=0x2fdffeb8 -r5=0x2fdffec8 -r6=0x2fdffed8 -r7=0x2fdffe78 -r8=0x2fdffef8 -r9=0x2fdfff08 -r10=0x2fdfff18 -r11=0x2fdfff28 -r12=0x2fdfff38 -r13=0x2fdffe78 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe78 -r1=0xe59fc00c -r2=0x2fdffe98 -r3=0xe08fc00c -r4=0x2fdffeb8 -r5=0x2fdffec8 -r6=0x2fdffed8 -r7=0x2fdffe78 -r8=0x2fdffef8 -r9=0x2fdfff08 -r10=0x2fdfff18 -r11=0x2fdfff28 -r12=0x2fdfff38 -r13=0x2fdffe78 -r14=0x00002f88 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-1-arm.dat deleted file mode 100644 index 307402fd2f5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-1-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r0, [pc, #+24]" -triple=arm-apple-ios -opcode=0xe59f0018 -before_state={ -memory={ -address=0x3018 -data_encoding=uint32_t -data=[ -0x3030 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00003030 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-1-thumb.dat deleted file mode 100644 index 471669b0cb6..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-1-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r0, [pc, #12]" -triple=thumb-apple-ios -opcode=0x4803 -before_state={ -memory={ -address=0x300c -data_encoding=uint32_t -data=[ -0x3024 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00003024 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-10-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-10-thumb.dat deleted file mode 100644 index bc7693c9a68..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-10-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr.w r10,[ pc, #4]" -triple=thumb-apple-ios -opcode=0xf8dfa004 -before_state={ -memory={ -address=0x3000 -data_encoding=uint32_t -data=[ -0x2fe01000 -] -} -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fe01000 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-11-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-11-thumb.dat deleted file mode 100644 index b5bf18127cd..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-11-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr.w r8, [pc , #0]" -triple=thumb-apple-ios -opcode=0xf8df8000 -before_state={ -memory={ -address=0x2ffc -data_encoding=uint32_t -data=[ -0xa0e1defe -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0xa0e1defe -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-12-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-12-thumb.dat deleted file mode 100644 index 5c3a5485f0b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-12-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr.w r9, [pc, #-4]" -triple=thumb-apple-ios -opcode=0xf85f9004 -before_state={ -memory={ -address=0x2fec -data_encoding=uint32_t -data=[ -0x9004f85f -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x9004f85f -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-2-arm.dat deleted file mode 100644 index 068297e3edc..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-2-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r0, [pc, #256]" -triple=arm-apple-ios -opcode=0xe59f0100 -before_state={ -memory={ -address=0x3100 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-2-thumb.dat deleted file mode 100644 index 27727831d6d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-2-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r0, [pc, #+24]" -triple=thumb-apple-ios -opcode=0x4806 -before_state={ -memory={ -address=0x3018 -data_encoding=uint32_t -data=[ -0x3030 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00003030 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-3-arm.dat deleted file mode 100644 index f0d6d8aaba6..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-3-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r0, [r13, #+24]" -triple=arm-apple-ios -opcode=0xe59d0018 -before_state={ -memory={ -address=0x2fdffe70 -data_encoding=uint32_t -data=[ -0x2fdffe80 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe80 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-3-thumb.dat deleted file mode 100644 index 012e1c53e66..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-3-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r0, [pc, #256]" -triple=thumb-apple-ios -opcode=0x4840 -before_state={ -memory={ -address=0x3100 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-4-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-4-arm.dat deleted file mode 100644 index e2d2aa6aa88..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-4-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r1, [r5, #16]" -triple=arm-apple-ios -opcode=0xe5951010 -before_state={ -memory={ -address=0x2fdffeb8 -data_encoding=uint32_t -data=[ -0x7365742d -] -} -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x7365742d -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-4-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-4-thumb.dat deleted file mode 100644 index 3eb6f167b48..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-4-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r0, [r13, #+24]" -triple=thumb-apple-ios -opcode=0x9806 -before_state={ -memory={ -address=0x2fdffe60 -data_encoding=uint32_t -data=[ -0x2fdffe70 -] -} -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe70 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-5-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-5-arm.dat deleted file mode 100644 index 45210d9600d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-5-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r2, [r0]" -triple=arm-apple-ios -opcode=0xe5902000 -before_state={ -memory={ -address=0x2fdffe60 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x2fdffe60 -r1=0x2fdffe70 -r2=0x2fdffe80 -r3=0x0000001f -r4=0x2fdffea0 -r5=0x2fdffeb0 -r6=0x2fdffec0 -r7=0x2fdffe60 -r8=0x2fdffee0 -r9=0x2fdffef0 -r10=0x2fdfff00 -r11=0x2fdfff10 -r12=0x2fdfff20 -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe60 -r1=0x2fdffe70 -r2=0x00000000 -r3=0x0000001f -r4=0x2fdffea0 -r5=0x2fdffeb0 -r6=0x2fdffec0 -r7=0x2fdffe60 -r8=0x2fdffee0 -r9=0x2fdffef0 -r10=0x2fdfff00 -r11=0x2fdfff10 -r12=0x2fdfff20 -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-5-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-5-thumb.dat deleted file mode 100644 index 45289e7e899..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-5-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r1, [pc, #0]" -triple=thumb-apple-ios -opcode=0x4900 -before_state={ -memory={ -address=0x3000 -data_encoding=uint32_t -data=[ -0x2fe01000 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fe01000 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-6-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-6-arm.dat deleted file mode 100644 index 0f379fd4980..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-6-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r2, [r6], +r8, lsl #2" -triple=arm-apple-ios -opcode=0xe6962108 -before_state={ -memory={ -address=0x2fdffea8 -data_encoding=uint32_t -data=[ -0x7365742d -] -} -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x0000001f -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x7365742d -r3=0x0000001f -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0xef5ff9c8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-6-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-6-thumb.dat deleted file mode 100644 index 5b3c119e743..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-6-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r1, [r5, #16]" -triple=thumb-apple-ios -opcode=0x6929 -before_state={ -memory={ -address=0x2fdffeb0 -data_encoding=uint32_t -data=[ -0x65742d62 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x65742d62 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-7-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-7-arm.dat deleted file mode 100644 index ff425ef5284..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-7-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r2, [sp, #24]" -triple=arm-apple-ios -opcode=0xe59d2018 -before_state={ -memory={ -address=0x2fdffe70 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000000 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-7-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-7-thumb.dat deleted file mode 100644 index db8d58796ca..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-7-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r2, [r0]" -triple=thumb-apple-ios -opcode=0x6802 -before_state={ -memory={ -address=0x2fdffe58 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x2fdffe88 -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x00000000 -r3=0x2fdffe88 -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-8-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-8-arm.dat deleted file mode 100644 index c11dfc133e5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-8-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r3, [r11, #-8]" -triple=arm-apple-ios -opcode=0xe51b3008 -before_state={ -memory={ -address=0x2fdfff00 -data_encoding=uint32_t -data=[ -0x63387830 -] -} -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x63387830 -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-8-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-8-thumb.dat deleted file mode 100644 index 01d7013ceaa..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-8-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr r2, [sp, #24]" -triple=thumb-apple-ios -opcode=0x9a06 -before_state={ -memory={ -address=0x2fdffe68 -data_encoding=uint32_t -data=[ -0x2fdffe78 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe78 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-9-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-9-thumb.dat deleted file mode 100644 index cc3c4db2f4d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldr-9-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldr.w r3, [r11, #8]" -triple=thumb-apple-ios -opcode=0xf8db3008 -before_state={ -memory={ -address=0x2fdfff08 -data_encoding=uint32_t -data=[ -0x62343134 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x62343134 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-1-arm.dat deleted file mode 100644 index 970f8aa7c0a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-1-arm.dat +++ /dev/null @@ -1,119 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldrd r0, r1, [r12, #+4]" -triple=arm-apple-ios -opcode=0xe1cc00d4 -before_state={ -memory={ -address=0x2fdfff14 -data_encoding=uint32_t -data=[ -0x30313038 -0x31623039 -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x30313038 -r1=0x31623039 -r2=0x2fdffe70 -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-1-thumb.dat deleted file mode 100644 index 7ab41ce35db..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-1-thumb.dat +++ /dev/null @@ -1,119 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldrd r0, r1, [r12, #+4]" -triple=thumb-apple-ios -opcode=0xe9dc0101 -before_state={ -memory={ -address=0x2fdfff3c -data_encoding=uint32_t -data=[ -0x0 -0x0 -] -} -registers={ -r0=0x2fdffe78 -r1=0x2fdffe88 -r2=0x2fdffe98 -r3=0x2fdffea8 -r4=0x2fdffeb8 -r5=0x2fdffec8 -r6=0x2fdffed8 -r7=0x2fdffe78 -r8=0x2fdffef8 -r9=0x2fdfff08 -r10=0x2fdfff18 -r11=0x2fdfff28 -r12=0x2fdfff38 -r13=0x2fdffe78 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000000 -r2=0x2fdffe98 -r3=0x2fdffea8 -r4=0x2fdffeb8 -r5=0x2fdffec8 -r6=0x2fdffed8 -r7=0x2fdffe78 -r8=0x2fdffef8 -r9=0x2fdfff08 -r10=0x2fdfff18 -r11=0x2fdfff28 -r12=0x2fdfff38 -r13=0x2fdffe78 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-2-thumb.dat deleted file mode 100644 index 70fe6f5cfff..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrd-2-thumb.dat +++ /dev/null @@ -1,119 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldrd r4, r5, [pc, #-0]" -triple=thumb-apple-ios -opcode=0xe9df4500 -before_state={ -memory={ -address=0x2ffc -data_encoding=uint32_t -data=[ -0xa0e1defe -0x2fe01000 -] -} -registers={ -r0=0x2fdffe78 -r1=0x2fdffe88 -r2=0x2fdffe98 -r3=0x2fdffea8 -r4=0x2fdffeb8 -r5=0x2fdffec8 -r6=0x2fdffed8 -r7=0x2fdffe78 -r8=0x2fdffef8 -r9=0x2fdfff08 -r10=0x2fdfff18 -r11=0x2fdfff28 -r12=0x2fdfff38 -r13=0x2fdffe78 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe78 -r1=0x2fdffe88 -r2=0x2fdffe98 -r3=0x2fdffea8 -r4=0xa0e1defe -r5=0x2fe01000 -r6=0x2fdffed8 -r7=0x2fdffe78 -r8=0x2fdffef8 -r9=0x2fdfff08 -r10=0x2fdfff18 -r11=0x2fdfff28 -r12=0x2fdfff38 -r13=0x2fdffe78 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrh-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrh-1-thumb.dat deleted file mode 100644 index 2a47002fb65..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrh-1-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldrh r0, [r2, #16]" -triple=thumb-apple-ios -opcode=0x8a10 -before_state={ -memory={ -address=0x2fdffe78 -data_encoding=uint32_t -data=[ -0x762f -] -} -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x0000762f -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrsh-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrsh-1-arm.dat deleted file mode 100644 index cecf397f1d4..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrsh-1-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldrsh r0, [r2], #+15" -triple=arm-apple-ios -opcode=0xe0d200ff -before_state={ -memory={ -address=0x2fdffe70 -data_encoding=uint32_t -data=[ -0xfffffeeb -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0xfffffeeb -r1=0x2fdffe60 -r2=0x2fdffe7f -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrsh-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrsh-2-arm.dat deleted file mode 100644 index 660b3d3b5db..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-ldrsh-2-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="ldrsh r14, [r2], #+15" -triple=arm-apple-ios -opcode=0xe0d2e0ff -before_state={ -memory={ -address=0x2fdffe70 -data_encoding=uint32_t -data=[ -0xfffffeec -] -} -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe7f -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0xfffffeec -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-1-arm.dat deleted file mode 100644 index 232bc967fed..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r12, #256" -triple=arm-apple-ios -opcode=0xe3a0cc01 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x00000100 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-1-thumb.dat deleted file mode 100644 index 569510dbd3b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov ip, pc" -triple=thumb-apple-ios -opcode=0x46fc -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x00003000 -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-10-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-10-thumb.dat deleted file mode 100644 index 6bf9b0d7ef7..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-10-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r0, r15" -triple=thumb-apple-ios -opcode=0x4678 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00003000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-11-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-11-thumb.dat deleted file mode 100644 index 82043ef335b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-11-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r0, r7" -triple=thumb-apple-ios -opcode=0x4638 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-12-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-12-thumb.dat deleted file mode 100644 index 1fce18af917..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-12-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov.w r12, #256" -triple=thumb-apple-ios -opcode=0xf44f7c80 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x00000100 -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-13-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-13-thumb.dat deleted file mode 100644 index d1c1a4428c9..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-13-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r12, r13" -triple=thumb-apple-ios -opcode=0x46ec -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x2fdffe50 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-14-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-14-thumb.dat deleted file mode 100644 index dfd89c265fb..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-14-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r14, r2" -triple=thumb-apple-ios -opcode=0x4696 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00000002 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-15-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-15-thumb.dat deleted file mode 100644 index 0ff8e5d7dc5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-15-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r1, r14" -triple=thumb-apple-ios -opcode=0x4671 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00002f84 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-16-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-16-thumb.dat deleted file mode 100644 index 1baf42dfc56..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-16-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r2, ip" -triple=thumb-apple-ios -opcode=0x4662 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x0000000c -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-17-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-17-thumb.dat deleted file mode 100644 index 70cee03fb54..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-17-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r2, r13" -triple=thumb-apple-ios -opcode=0x466a -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x2fdffe50 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-18-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-18-thumb.dat deleted file mode 100644 index 1893e188b0d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-18-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r2, r9" -triple=thumb-apple-ios -opcode=0x464a -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000009 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-19-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-19-thumb.dat deleted file mode 100644 index 238e16b4aa4..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-19-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r3, r12" -triple=thumb-apple-ios -opcode=0x4663 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000000c -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-2-arm.dat deleted file mode 100644 index 6d6c0cbf80c..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-2-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r12, r13" -triple=arm-apple-ios -opcode=0xe1a0c00d -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x2fdffe58 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-2-thumb.dat deleted file mode 100644 index ad6854427fb..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov ip, r8" -triple=thumb-apple-ios -opcode=0x46c4 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x00000008 -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-20-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-20-thumb.dat deleted file mode 100644 index 15ecd2ebfa0..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-20-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r3, r13" -triple=thumb-apple-ios -opcode=0x466b -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x2fdffe50 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-21-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-21-thumb.dat deleted file mode 100644 index 6a38f1671b7..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-21-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r3, sp" -triple=thumb-apple-ios -opcode=0x466b -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x2fdffe58 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-22-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-22-thumb.dat deleted file mode 100644 index 242b5682419..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-22-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r4, r11" -triple=thumb-apple-ios -opcode=0x465c -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x0000000b -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-23-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-23-thumb.dat deleted file mode 100644 index 7f57440a842..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-23-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r5, r10" -triple=thumb-apple-ios -opcode=0x4655 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x0000000a -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-24-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-24-thumb.dat deleted file mode 100644 index 9a1756e8473..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-24-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r6, r9" -triple=thumb-apple-ios -opcode=0x464e -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000009 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-25-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-25-thumb.dat deleted file mode 100644 index c2fd6a73964..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-25-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r7, lr" -triple=thumb-apple-ios -opcode=0x4677 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x00002f84 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-26-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-26-thumb.dat deleted file mode 100644 index 2cc155d8071..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-26-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r7, r8" -triple=thumb-apple-ios -opcode=0x4647 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x00000008 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-27-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-27-thumb.dat deleted file mode 100644 index 0b35377b08e..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-27-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r9, pc" -triple=thumb-apple-ios -opcode=0x46f9 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00003000 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-28-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-28-thumb.dat deleted file mode 100644 index f7d7778a251..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-28-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov sp, ip" -triple=thumb-apple-ios -opcode=0x46e5 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x0000000c -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-29-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-29-thumb.dat deleted file mode 100644 index 5e9098f99d2..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-29-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov sp, pc" -triple=thumb-apple-ios -opcode=0x46fd -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x00003000 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-3-arm.dat deleted file mode 100644 index 1fe7155bd3a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-3-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r14, r2" -triple=arm-apple-ios -opcode=0xe1a0e002 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00000002 -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-3-thumb.dat deleted file mode 100644 index 8ce129682bf..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov ip, sp" -triple=thumb-apple-ios -opcode=0x46ec -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x2fdffe58 -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-30-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-30-thumb.dat deleted file mode 100644 index a0dddad6b5a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-30-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov sp, r7" -triple=thumb-apple-ios -opcode=0x46bd -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-31-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-31-thumb.dat deleted file mode 100644 index 20d8dc7c06f..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-31-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="movs r3, #1" -triple=thumb-apple-ios -opcode=0x2301 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000001 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x20000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-4-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-4-arm.dat deleted file mode 100644 index 8ef83b26805..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-4-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r2, r9" -triple=arm-apple-ios -opcode=0xe1a02009 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000009 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-4-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-4-thumb.dat deleted file mode 100644 index f854ba26641..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-4-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov lr, pc" -triple=thumb-apple-ios -opcode=0x46fe -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00003000 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-5-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-5-arm.dat deleted file mode 100644 index ee85779083f..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-5-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r3, #2147483648" -triple=arm-apple-ios -opcode=0xe3a03102 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x80000000 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-5-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-5-thumb.dat deleted file mode 100644 index d6140bdb92d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-5-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov lr, r2" -triple=thumb-apple-ios -opcode=0x4696 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00000002 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-6-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-6-arm.dat deleted file mode 100644 index 863a6d3e9bd..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-6-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov r3, r13" -triple=arm-apple-ios -opcode=0xe1a0300d -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x2fdffe60 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-6-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-6-thumb.dat deleted file mode 100644 index fac96bf5a5a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-6-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov pc, ip" -triple=thumb-apple-ios -opcode=0x46e7 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x0000000c -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-7-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-7-thumb.dat deleted file mode 100644 index c537d30cb24..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-7-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov pc, lr" -triple=thumb-apple-ios -opcode=0x46f7 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002f84 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-8-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-8-thumb.dat deleted file mode 100644 index b724c79a0d5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-8-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov pc, r4" -triple=thumb-apple-ios -opcode=0x46a7 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00000004 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-9-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-9-thumb.dat deleted file mode 100644 index ccf7ea6c342..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mov-9-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mov pc, sp" -triple=thumb-apple-ios -opcode=0x46ef -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x2fdffe58 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-moveq-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-moveq-1-arm.dat deleted file mode 100644 index f46b1bfd6e8..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-moveq-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="moveq r3, #1" -triple=arm-apple-ios -opcode=0x3a03001 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000001 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-movs-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-movs-1-arm.dat deleted file mode 100644 index 38292508d43..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-movs-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="movs r12, r13" -triple=arm-apple-ios -opcode=0xe1b0c00d -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x2fdffe58 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x20000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-1-arm.dat deleted file mode 100644 index 024dd9fa4bc..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvn r14, #1" -triple=arm-apple-ios -opcode=0xe3e0e001 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0xfffffffe -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-1-thumb.dat deleted file mode 100644 index c5c385c8522..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvn r0, #1" -triple=thumb-apple-ios -opcode=0xf06f0001 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe98 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe98 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0xfffffffe -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe98 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe98 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-2-arm.dat deleted file mode 100644 index 10df542fcad..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-2-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvn r0, #1" -triple=arm-apple-ios -opcode=0xe3e00001 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe68 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe68 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0xfffffffe -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe68 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe68 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-2-thumb.dat deleted file mode 100644 index 3c2f6f4da27..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvn r0, #31" -triple=thumb-apple-ios -opcode=0xf06f001f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe90 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0xffffffe0 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe90 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-3-arm.dat deleted file mode 100644 index 742708978b6..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-3-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvn r0, #31" -triple=arm-apple-ios -opcode=0xe3e0001f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0xffffffe0 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-3-thumb.dat deleted file mode 100644 index ff4ca7331a9..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvn r14, #1" -triple=thumb-apple-ios -opcode=0xf06f0e01 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe90 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe90 -r14=0xfffffffe -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-4-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-4-arm.dat deleted file mode 100644 index 4efc18cc5f2..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-4-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvn r3, r8" -triple=arm-apple-ios -opcode=0xe1e03008 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0xfffffff7 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-4-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-4-thumb.dat deleted file mode 100644 index f8b1569e906..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-mvn-4-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="mvns r3, r8" -triple=thumb-apple-ios -opcode=0xea7f0308 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe90 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0xfffffff7 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe90 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0xa0000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-1-arm.dat deleted file mode 100644 index 07163f80aeb..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-1-arm.dat +++ /dev/null @@ -1,121 +0,0 @@ -InstructionEmulationState={ -assembly_string="pop {r3, r4, r8, r10}" -triple=arm-apple-ios -opcode=0xe8bd0518 -before_state={ -memory={ -address=0x2fdffe50 -data_encoding=uint32_t -data=[ -0x0 -0x2e7c -0x1 -0x2fdffeac -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000000 -r4=0x00002e7c -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000001 -r9=0x00000009 -r10=0x2fdffeac -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-1-thumb.dat deleted file mode 100644 index fad6765be9a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-1-thumb.dat +++ /dev/null @@ -1,121 +0,0 @@ -InstructionEmulationState={ -assembly_string="pop.w {r3, r4, r8, r10}" -triple=thumb-apple-ios -opcode=0xe8bd0518 -before_state={ -memory={ -address=0x2fdffe38 -data_encoding=uint32_t -data=[ -0x0 -0x2f80 -0x1000 -0x1 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000000 -r4=0x00002f80 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00001000 -r9=0x00000009 -r10=0x00000001 -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-2-arm.dat deleted file mode 100644 index 4b6ae43ca28..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-2-arm.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="pop {r9}" -triple=arm-apple-ios -opcode=0xe8bd0200 -before_state={ -memory={ -address=0x2fdffe70 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe70 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe70 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe70 -r8=0x00000008 -r9=0x00000000 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe74 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-2-thumb.dat deleted file mode 100644 index 9f3efe57e9d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-2-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="pop {r3}" -triple=thumb-apple-ios -opcode=0xbc08 -before_state={ -memory={ -address=0x2fdffe60 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000000 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe64 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-3-thumb.dat deleted file mode 100644 index a2adc418c4a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-pop-3-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="pop {r6}" -triple=thumb-apple-ios -opcode=0xbc40 -before_state={ -memory={ -address=0x2fdffe60 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000000 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe64 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-1-arm.dat deleted file mode 100644 index b2f6e0965ab..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="push {r0, r1, r2, r3, r7, r14}" -triple=arm-apple-ios -opcode=0xe92d408f -before_state={ -registers={ -r0=0x2fdffe30 -r1=0x2fdffe40 -r2=0x2fdffe50 -r3=0x0000001f -r4=0x2fdffe70 -r5=0x2fdffe80 -r6=0x2fdffe90 -r7=0x2fdffe30 -r8=0x2fdffeb0 -r9=0x2fdffec0 -r10=0x2fdffed0 -r11=0x2fdffee0 -r12=0x2fdffef0 -r13=0x2fdffe30 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe30 -r1=0x2fdffe40 -r2=0x2fdffe50 -r3=0x0000001f -r4=0x2fdffe70 -r5=0x2fdffe80 -r6=0x2fdffe90 -r7=0x2fdffe30 -r8=0x2fdffeb0 -r9=0x2fdffec0 -r10=0x2fdffed0 -r11=0x2fdffee0 -r12=0x2fdffef0 -r13=0x2fdffe18 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-1-thumb.dat deleted file mode 100644 index 6f5b29ed199..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="push {r0, r1, r2, r3, r7, r14}" -triple=thumb-apple-ios -opcode=0xb58f -before_state={ -registers={ -r0=0x2fdffe28 -r1=0x2fdffe38 -r2=0x2fdffe48 -r3=0x2fdffe58 -r4=0x2fdffe68 -r5=0x2fdffe78 -r6=0x2fdffe88 -r7=0x2fdffe28 -r8=0x2fdffea8 -r9=0x2fdffeb8 -r10=0x2fdffec8 -r11=0x2fdffed8 -r12=0x2fdffee8 -r13=0x2fdffe28 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe28 -r1=0x2fdffe38 -r2=0x2fdffe48 -r3=0x2fdffe58 -r4=0x2fdffe68 -r5=0x2fdffe78 -r6=0x2fdffe88 -r7=0x2fdffe28 -r8=0x2fdffea8 -r9=0x2fdffeb8 -r10=0x2fdffec8 -r11=0x2fdffed8 -r12=0x2fdffee8 -r13=0x2fdffe10 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-2-arm.dat deleted file mode 100644 index 6f1f4389e80..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-2-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="push {r6}" -triple=arm-apple-ios -opcode=0xe92d0040 -before_state={ -registers={ -r0=0x2fdffe68 -r1=0x2fdffe78 -r2=0x2fdffe88 -r3=0x0000001f -r4=0x2fdffea8 -r5=0x2fdffeb8 -r6=0x2fdffec8 -r7=0x2fdffe68 -r8=0x2fdffee8 -r9=0x2fdffef8 -r10=0x2fdfff08 -r11=0x2fdfff18 -r12=0x2fdfff28 -r13=0x2fdffe68 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe68 -r1=0x2fdffe78 -r2=0x2fdffe88 -r3=0x0000001f -r4=0x2fdffea8 -r5=0x2fdffeb8 -r6=0x2fdffec8 -r7=0x2fdffe68 -r8=0x2fdffee8 -r9=0x2fdffef8 -r10=0x2fdfff08 -r11=0x2fdfff18 -r12=0x2fdfff28 -r13=0x2fdffe64 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-2-thumb.dat deleted file mode 100644 index 23e4df446bf..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="push {r6}" -triple=thumb-apple-ios -opcode=0xb440 -before_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x2fdffe88 -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x2fdffe88 -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe54 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-3-arm.dat deleted file mode 100644 index 06847a5ff3b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-3-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="push {r7, r14}" -triple=arm-apple-ios -opcode=0xe92d4080 -before_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-3-thumb.dat deleted file mode 100644 index e3330f537cb..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-push-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="push {r7, r14}" -triple=thumb-apple-ios -opcode=0xb580 -before_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-1-arm.dat deleted file mode 100644 index 70a5be3cb69..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r0, [r13]" -triple=arm-apple-ios -opcode=0xe58d0000 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-1-thumb.dat deleted file mode 100644 index 3559652ce6c..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r0, [r13]" -triple=thumb-apple-ios -opcode=0x9000 -before_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-2-arm.dat deleted file mode 100644 index 3d77724b4f9..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-2-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r1, [r0, #+4]" -triple=arm-apple-ios -opcode=0xe5801004 -before_state={ -registers={ -r0=0x2fdffe60 -r1=0x2fdffe70 -r2=0x2fdffe80 -r3=0x0000001f -r4=0x2fdffea0 -r5=0x2fdffeb0 -r6=0x2fdffec0 -r7=0x2fdffe60 -r8=0x2fdffee0 -r9=0x2fdffef0 -r10=0x2fdfff00 -r11=0x2fdfff10 -r12=0x2fdfff20 -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe60 -r1=0x2fdffe70 -r2=0x2fdffe80 -r3=0x0000001f -r4=0x2fdffea0 -r5=0x2fdffeb0 -r6=0x2fdffec0 -r7=0x2fdffe60 -r8=0x2fdffee0 -r9=0x2fdffef0 -r10=0x2fdfff00 -r11=0x2fdfff10 -r12=0x2fdfff20 -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-2-thumb.dat deleted file mode 100644 index 73e8cd3e548..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r0, [sp, #0]" -triple=thumb-apple-ios -opcode=0x9000 -before_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-3-arm.dat deleted file mode 100644 index 97c90a0050c..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-3-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r2, [r0]" -triple=arm-apple-ios -opcode=0xe5802000 -before_state={ -registers={ -r0=0x2fdffe60 -r1=0x2fdffe70 -r2=0x2fdffe80 -r3=0x0000001f -r4=0x2fdffea0 -r5=0x2fdffeb0 -r6=0x2fdffec0 -r7=0x2fdffe60 -r8=0x2fdffee0 -r9=0x2fdffef0 -r10=0x2fdfff00 -r11=0x2fdfff10 -r12=0x2fdfff20 -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe60 -r1=0x2fdffe70 -r2=0x2fdffe80 -r3=0x0000001f -r4=0x2fdffea0 -r5=0x2fdffeb0 -r6=0x2fdffec0 -r7=0x2fdffe60 -r8=0x2fdffee0 -r9=0x2fdffef0 -r10=0x2fdfff00 -r11=0x2fdfff10 -r12=0x2fdfff20 -r13=0x2fdffe60 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-3-thumb.dat deleted file mode 100644 index 8e891c04287..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r1, [sp, #32]" -triple=thumb-apple-ios -opcode=0x9108 -before_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x2fdffe80 -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-4-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-4-arm.dat deleted file mode 100644 index ed3b54eaf38..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-4-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r2, [r13, #+4]" -triple=arm-apple-ios -opcode=0xe58d2004 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-4-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-4-thumb.dat deleted file mode 100644 index ec9e2dc1e54..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-4-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str.w r7, [r13, #-12]!" -triple=thumb-apple-ios -opcode=0xf84d7d0c -before_state={ -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe48 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe48 -r1=0x2fdffe58 -r2=0x2fdffe68 -r3=0x2fdffe78 -r4=0x2fdffe88 -r5=0x2fdffe98 -r6=0x2fdffea8 -r7=0x2fdffe48 -r8=0x2fdffec8 -r9=0x2fdffed8 -r10=0x2fdffee8 -r11=0x2fdffef8 -r12=0x2fdfff08 -r13=0x2fdffe3c -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-5-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-5-arm.dat deleted file mode 100644 index 98b8dfb16b3..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-str-5-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="str r7, [r13, #-12]!" -triple=arm-apple-ios -opcode=0xe52d700c -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe4c -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strb-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strb-1-arm.dat deleted file mode 100644 index 2f7320d007a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strb-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="strb r0, [r2], #+15" -triple=arm-apple-ios -opcode=0xe4c2000f -before_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe87 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strb-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strb-2-arm.dat deleted file mode 100644 index 495c8e720a1..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strb-2-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="strb r3, [r0, #+8]" -triple=arm-apple-ios -opcode=0xe5c03008 -before_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strbt-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strbt-1-arm.dat deleted file mode 100644 index 494c49af952..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strbt-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="strbt r14, [r2], #+15" -triple=arm-apple-ios -opcode=0xe4e2e00f -before_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe70 -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x2fdffe60 -r2=0x2fdffe7f -r3=0x0000001f -r4=0x2fdffe90 -r5=0x2fdffea0 -r6=0x2fdffeb0 -r7=0x2fdffe50 -r8=0x2fdffed0 -r9=0x2fdffee0 -r10=0x2fdffef0 -r11=0x2fdfff00 -r12=0x2fdfff10 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strd-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strd-1-thumb.dat deleted file mode 100644 index 4876f8741b0..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strd-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="strd r10, r11, [r6, #+28]" -triple=thumb-apple-ios -opcode=0xe9c6ab07 -before_state={ -registers={ -r0=0x2fdffe70 -r1=0x2fdffe80 -r2=0x2fdffe90 -r3=0x2fdffea0 -r4=0x2fdffeb0 -r5=0x2fdffec0 -r6=0x2fdffed0 -r7=0x2fdffe70 -r8=0x2fdffef0 -r9=0x2fdfff00 -r10=0x2fdfff10 -r11=0x2fdfff20 -r12=0x2fdfff30 -r13=0x2fdffe70 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe70 -r1=0x2fdffe80 -r2=0x2fdffe90 -r3=0x2fdffea0 -r4=0x2fdffeb0 -r5=0x2fdffec0 -r6=0x2fdffed0 -r7=0x2fdffe70 -r8=0x2fdffef0 -r9=0x2fdfff00 -r10=0x2fdfff10 -r11=0x2fdfff20 -r12=0x2fdfff30 -r13=0x2fdffe70 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strt-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strt-1-arm.dat deleted file mode 100644 index 9fc311565ea..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-strt-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="strt r0, [r2], #+15" -triple=arm-apple-ios -opcode=0xe4a2000f -before_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe78 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe58 -r1=0x2fdffe68 -r2=0x2fdffe87 -r3=0x0000001f -r4=0x2fdffe98 -r5=0x2fdffea8 -r6=0x2fdffeb8 -r7=0x2fdffe58 -r8=0x2fdffed8 -r9=0x2fdffee8 -r10=0x2fdffef8 -r11=0x2fdfff08 -r12=0x2fdfff18 -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-1-arm.dat deleted file mode 100644 index 98c435d616a..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r0, sp, r8" -triple=arm-apple-ios -opcode=0xe04d0008 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x2fdffe50 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-1-thumb.dat deleted file mode 100644 index 482480d0cd4..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub.w r10, sp, #16" -triple=thumb-apple-ios -opcode=0xf1ad0a10 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe30 -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-10-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-10-arm.dat deleted file mode 100644 index 9f07a947f7d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-10-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r7, r12, #8" -triple=arm-apple-ios -opcode=0xe24c7008 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x00000004 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-2-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-2-arm.dat deleted file mode 100644 index 9a67268196e..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-2-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r10, r12, #31" -triple=arm-apple-ios -opcode=0xe24ca01f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0xffffffed -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-2-thumb.dat deleted file mode 100644 index 11d213803e2..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub.w r10, sp, #31" -triple=thumb-apple-ios -opcode=0xf1ad0a1f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe21 -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-3-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-3-arm.dat deleted file mode 100644 index 4dfe680ce47..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-3-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r12, r13, #12" -triple=arm-apple-ios -opcode=0xe24dc00c -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x2fdffe44 -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-3-thumb.dat deleted file mode 100644 index a017f528430..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub.w r12, sp, #31" -triple=thumb-apple-ios -opcode=0xf1ad0c1f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe40 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x2fdffe21 -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-4-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-4-arm.dat deleted file mode 100644 index 50d13c99475..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-4-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r13, r13, #24" -triple=arm-apple-ios -opcode=0xe24dd018 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-4-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-4-thumb.dat deleted file mode 100644 index 214808d6a42..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-4-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub.w r1, sp, r3, lsl #2" -triple=thumb-apple-ios -opcode=0xebad0183 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe30 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe30 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x2fdffe24 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe30 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe30 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-5-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-5-arm.dat deleted file mode 100644 index 58de27b5d4e..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-5-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r13, r13, #4" -triple=arm-apple-ios -opcode=0xe24dd004 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe54 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-5-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-5-thumb.dat deleted file mode 100644 index 12688286685..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-5-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub.w r7, sp, #1" -triple=thumb-apple-ios -opcode=0xf1ad0701 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe4f -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-6-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-6-arm.dat deleted file mode 100644 index be6891307db..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-6-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r1, r13, #4" -triple=arm-apple-ios -opcode=0xe24d1004 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x2fdffe54 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-6-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-6-thumb.dat deleted file mode 100644 index d48c42eb8d8..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-6-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub.w sp, sp, #4" -triple=thumb-apple-ios -opcode=0xf1ad0d04 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe4c -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-8-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-8-arm.dat deleted file mode 100644 index 21b17dfbcd8..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-8-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r2, r2, r3" -triple=arm-apple-ios -opcode=0xe0422003 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0xffffffe3 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-9-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-9-arm.dat deleted file mode 100644 index 06888ad3a4b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-sub-9-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="sub r4, r12, r7" -triple=arm-apple-ios -opcode=0xe04c4007 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0xd02001b4 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe58 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe58 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-1-arm.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-1-arm.dat deleted file mode 100644 index 856a55749b1..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-1-arm.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs r10, r13, #31" -triple=arm-apple-ios -opcode=0xe25da01f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ff8 -cpsr=0x60000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x0000001f -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe31 -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002e7c -r15=0x00002ffc -cpsr=0x20000010 -s0=0x00000000 -s1=0x00000001 -s2=0x00000002 -s3=0x00000003 -s4=0x00000004 -s5=0x00000005 -s6=0x00000006 -s7=0x00000007 -s8=0x00000008 -s9=0x00000009 -s10=0x0000000a -s11=0x0000000b -s12=0x0000000c -s13=0x0000000d -s14=0x0000000e -s15=0x0000000f -s16=0x00000010 -s17=0x00000011 -s18=0x00000012 -s19=0x00000013 -s20=0x00000014 -s21=0x00000015 -s22=0x00000016 -s23=0x00000017 -s24=0x00000018 -s25=0x00000019 -s26=0x0000001a -s27=0x0000001b -s28=0x0000001c -s29=0x0000001d -s30=0x0000001e -s31=0x0000001f -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-1-thumb.dat deleted file mode 100644 index 63aa7b8ed13..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs r0, r6, #0" -triple=thumb-apple-ios -opcode=0x1e30 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000006 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x20000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-10-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-10-thumb.dat deleted file mode 100644 index 75938b4e1d5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-10-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs.w r1, sp, #4" -triple=thumb-apple-ios -opcode=0xf1bd0104 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x2fdffe44 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x20000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-2-thumb.dat deleted file mode 100644 index 74bddcea97c..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs r0, r7, r5" -triple=thumb-apple-ios -opcode=0x1b78 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x2fdffe43 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x20000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-3-thumb.dat deleted file mode 100644 index 965ebf37017..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs.w r10, r13, #31" -triple=thumb-apple-ios -opcode=0xf1bd0a1f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe19 -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x20000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-4-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-4-thumb.dat deleted file mode 100644 index 068724170d5..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-4-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs r1, r3, #4" -triple=thumb-apple-ios -opcode=0x1f19 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0xffffffff -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x80000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-5-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-5-thumb.dat deleted file mode 100644 index 72ed2ef25c0..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-5-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs r4, r2, r6" -triple=thumb-apple-ios -opcode=0x1b94 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0xfffffffc -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe48 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe48 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x80000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-6-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-6-thumb.dat deleted file mode 100644 index 67133b2832e..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-6-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs r7, r5, #7" -triple=thumb-apple-ios -opcode=0x1fef -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe50 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0xfffffffe -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f84 -r15=0x00002ffe -cpsr=0x80000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-8-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-8-thumb.dat deleted file mode 100644 index 965ebf37017..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-8-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs.w r10, r13, #31" -triple=thumb-apple-ios -opcode=0xf1bd0a1f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe19 -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x20000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-9-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-9-thumb.dat deleted file mode 100644 index ea159774316..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-subs-9-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="subs.w r10, sp, #31" -triple=thumb-apple-ios -opcode=0xf1bd0a1f -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe38 -r8=0x00000008 -r9=0x00000009 -r10=0x2fdffe19 -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe38 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x20000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-1-thumb.dat deleted file mode 100644 index 22dd9d88b4b..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-1-thumb.dat +++ /dev/null @@ -1,125 +0,0 @@ -InstructionEmulationState={ -assembly_string="vpop {d11, d12, d13, d14}" -triple=thumb-apple-ios -opcode=0xecbdbb08 -before_state={ -memory={ -address=0x2fdffe60 -data_encoding=uint32_t -data=[ -0x0 -0x2f80 -0x1000 -0x1 -0x2fdffebc -0x0 -0x0 -0x2fdffe8c -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe80 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00002f80 -s24=0x00001000 -s25=0x00000001 -s26=0x2fdffebc -s27=0x00000000 -s28=0x00000000 -s29=0x2fdffe8c -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-2-thumb.dat deleted file mode 100644 index e69cd9eef2d..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-2-thumb.dat +++ /dev/null @@ -1,118 +0,0 @@ -InstructionEmulationState={ -assembly_string="vpop {s0}" -triple=thumb-apple-ios -opcode=0xecbd0a01 -before_state={ -memory={ -address=0x2fdffe98 -data_encoding=uint32_t -data=[ -0x0 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe98 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe98 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe98 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe9c -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-3-thumb.dat deleted file mode 100644 index 375a92eaaab..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpop-3-thumb.dat +++ /dev/null @@ -1,121 +0,0 @@ -InstructionEmulationState={ -assembly_string="vpop {s11, s12, s13, s14}" -triple=thumb-apple-ios -opcode=0xecfd5a04 -before_state={ -memory={ -address=0x2fdffe60 -data_encoding=uint32_t -data=[ -0x0 -0x2f80 -0x1000 -0x1 -] -} -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe70 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00002f80 -s13=0x00001000 -s14=0x00000001 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-1-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-1-thumb.dat deleted file mode 100644 index ac4ef56be66..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-1-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="vpush {d11, d12, d13, d14}" -triple=thumb-apple-ios -opcode=0xed2dbb08 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe40 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-2-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-2-thumb.dat deleted file mode 100644 index 58055d6539c..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-2-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="vpush {s0}" -triple=thumb-apple-ios -opcode=0xed2d0a01 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe90 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe90 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe8c -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-3-thumb.dat b/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-3-thumb.dat deleted file mode 100644 index 2658b43bc88..00000000000 --- a/gnu/llvm/tools/lldb/packages/Python/lldbsuite/test/arm_emulation/new-test-files/test-vpush-3-thumb.dat +++ /dev/null @@ -1,111 +0,0 @@ -InstructionEmulationState={ -assembly_string="vpush {s11, s12, s13, s14}" -triple=thumb-apple-ios -opcode=0xed6d5a04 -before_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe60 -r14=0x00002f80 -r15=0x00002ff8 -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -after_state={ -registers={ -r0=0x00000000 -r1=0x00000001 -r2=0x00000002 -r3=0x00000003 -r4=0x00000004 -r5=0x00000005 -r6=0x00000006 -r7=0x2fdffe60 -r8=0x00000008 -r9=0x00000009 -r10=0x0000000a -r11=0x0000000b -r12=0x0000000c -r13=0x2fdffe50 -r14=0x00002f80 -r15=0x00002ffc -cpsr=0x60000030 -s0=0x00000000 -s1=0x00000000 -s2=0x00000000 -s3=0x00000000 -s4=0x00000000 -s5=0x00000000 -s6=0x00000000 -s7=0x00000000 -s8=0x00000000 -s9=0x00000000 -s10=0x00000000 -s11=0x00000000 -s12=0x00000000 -s13=0x00000000 -s14=0x00000000 -s15=0x00000000 -s16=0x00000000 -s17=0x00000000 -s18=0x00000000 -s19=0x00000000 -s20=0x00000000 -s21=0x00000000 -s22=0x00000000 -s23=0x00000000 -s24=0x00000000 -s25=0x00000000 -s26=0x00000000 -s27=0x00000000 -s28=0x00000000 -s29=0x00000000 -s30=0x00000000 -s31=0x00000000 -} -} -} diff --git a/gnu/llvm/tools/lldb/source/Core/ArchSpec.cpp b/gnu/llvm/tools/lldb/source/Core/ArchSpec.cpp deleted file mode 100644 index bfe9750f70f..00000000000 --- a/gnu/llvm/tools/lldb/source/Core/ArchSpec.cpp +++ /dev/null @@ -1,1672 +0,0 @@ -//===-- ArchSpec.cpp --------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Core/ArchSpec.h" - -#include "lldb/Host/HostInfo.h" -#include "lldb/Target/Platform.h" -#include "lldb/Target/RegisterContext.h" -#include "lldb/Target/Thread.h" -#include "lldb/Utility/NameMatches.h" -#include "lldb/Utility/Stream.h" // for Stream -#include "lldb/Utility/StringList.h" -#include "lldb/lldb-defines.h" // for LLDB_INVALID_C... -#include "lldb/lldb-forward.h" // for RegisterContextSP - -#include "Plugins/Process/Utility/ARMDefines.h" -#include "Plugins/Process/Utility/InstructionUtils.h" - -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/Twine.h" // for Twine -#include "llvm/BinaryFormat/COFF.h" -#include "llvm/BinaryFormat/ELF.h" -#include "llvm/BinaryFormat/MachO.h" // for CPUType::CPU_T... -#include "llvm/Support/Compiler.h" // for LLVM_FALLTHROUGH -#include "llvm/Support/Host.h" - -#include <memory> // for shared_ptr -#include <string> -#include <tuple> // for tie, tuple - -using namespace lldb; -using namespace lldb_private; - -static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2, - bool try_inverse, bool enforce_exact_match); - -namespace lldb_private { - -struct CoreDefinition { - ByteOrder default_byte_order; - uint32_t addr_byte_size; - uint32_t min_opcode_byte_size; - uint32_t max_opcode_byte_size; - llvm::Triple::ArchType machine; - ArchSpec::Core core; - const char *const name; -}; - -} // namespace lldb_private - -// This core information can be looked using the ArchSpec::Core as the index -static const CoreDefinition g_core_definitions[] = { - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_generic, - "arm"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv4, - "armv4"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv4t, - "armv4t"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv5, - "armv5"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv5e, - "armv5e"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv5t, - "armv5t"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv6, - "armv6"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv6m, - "armv6m"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7, - "armv7"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7f, - "armv7f"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7s, - "armv7s"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7k, - "armv7k"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7m, - "armv7m"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7em, - "armv7em"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_xscale, - "xscale"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumb, - "thumb"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv4t, - "thumbv4t"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv5, - "thumbv5"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv5e, - "thumbv5e"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv6, - "thumbv6"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv6m, - "thumbv6m"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv7, - "thumbv7"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv7f, - "thumbv7f"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv7s, - "thumbv7s"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv7k, - "thumbv7k"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv7m, - "thumbv7m"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb, ArchSpec::eCore_thumbv7em, - "thumbv7em"}, - {eByteOrderLittle, 8, 4, 4, llvm::Triple::aarch64, - ArchSpec::eCore_arm_arm64, "arm64"}, - {eByteOrderLittle, 8, 4, 4, llvm::Triple::aarch64, - ArchSpec::eCore_arm_armv8, "armv8"}, - {eByteOrderLittle, 8, 4, 4, llvm::Triple::aarch64, - ArchSpec::eCore_arm_aarch64, "aarch64"}, - - // mips32, mips32r2, mips32r3, mips32r5, mips32r6 - {eByteOrderBig, 4, 2, 4, llvm::Triple::mips, ArchSpec::eCore_mips32, - "mips"}, - {eByteOrderBig, 4, 2, 4, llvm::Triple::mips, ArchSpec::eCore_mips32r2, - "mipsr2"}, - {eByteOrderBig, 4, 2, 4, llvm::Triple::mips, ArchSpec::eCore_mips32r3, - "mipsr3"}, - {eByteOrderBig, 4, 2, 4, llvm::Triple::mips, ArchSpec::eCore_mips32r5, - "mipsr5"}, - {eByteOrderBig, 4, 2, 4, llvm::Triple::mips, ArchSpec::eCore_mips32r6, - "mipsr6"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::mipsel, ArchSpec::eCore_mips32el, - "mipsel"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::mipsel, - ArchSpec::eCore_mips32r2el, "mipsr2el"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::mipsel, - ArchSpec::eCore_mips32r3el, "mipsr3el"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::mipsel, - ArchSpec::eCore_mips32r5el, "mipsr5el"}, - {eByteOrderLittle, 4, 2, 4, llvm::Triple::mipsel, - ArchSpec::eCore_mips32r6el, "mipsr6el"}, - - // mips64, mips64r2, mips64r3, mips64r5, mips64r6 - {eByteOrderBig, 8, 2, 4, llvm::Triple::mips64, ArchSpec::eCore_mips64, - "mips64"}, - {eByteOrderBig, 8, 2, 4, llvm::Triple::mips64, ArchSpec::eCore_mips64r2, - "mips64r2"}, - {eByteOrderBig, 8, 2, 4, llvm::Triple::mips64, ArchSpec::eCore_mips64r3, - "mips64r3"}, - {eByteOrderBig, 8, 2, 4, llvm::Triple::mips64, ArchSpec::eCore_mips64r5, - "mips64r5"}, - {eByteOrderBig, 8, 2, 4, llvm::Triple::mips64, ArchSpec::eCore_mips64r6, - "mips64r6"}, - {eByteOrderLittle, 8, 2, 4, llvm::Triple::mips64el, - ArchSpec::eCore_mips64el, "mips64el"}, - {eByteOrderLittle, 8, 2, 4, llvm::Triple::mips64el, - ArchSpec::eCore_mips64r2el, "mips64r2el"}, - {eByteOrderLittle, 8, 2, 4, llvm::Triple::mips64el, - ArchSpec::eCore_mips64r3el, "mips64r3el"}, - {eByteOrderLittle, 8, 2, 4, llvm::Triple::mips64el, - ArchSpec::eCore_mips64r5el, "mips64r5el"}, - {eByteOrderLittle, 8, 2, 4, llvm::Triple::mips64el, - ArchSpec::eCore_mips64r6el, "mips64r6el"}, - - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_generic, - "powerpc"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc601, - "ppc601"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc602, - "ppc602"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc603, - "ppc603"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc603e, - "ppc603e"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc603ev, - "ppc603ev"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc604, - "ppc604"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc604e, - "ppc604e"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc620, - "ppc620"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc750, - "ppc750"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc7400, - "ppc7400"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc7450, - "ppc7450"}, - {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc970, - "ppc970"}, - - {eByteOrderBig, 8, 4, 4, llvm::Triple::ppc64, ArchSpec::eCore_ppc64_generic, - "powerpc64"}, - {eByteOrderBig, 8, 4, 4, llvm::Triple::ppc64, - ArchSpec::eCore_ppc64_ppc970_64, "ppc970-64"}, - - {eByteOrderBig, 8, 2, 6, llvm::Triple::systemz, - ArchSpec::eCore_s390x_generic, "s390x"}, - - {eByteOrderLittle, 4, 4, 4, llvm::Triple::sparc, - ArchSpec::eCore_sparc_generic, "sparc"}, - {eByteOrderLittle, 8, 4, 4, llvm::Triple::sparcv9, - ArchSpec::eCore_sparc9_generic, "sparcv9"}, - - {eByteOrderLittle, 4, 1, 15, llvm::Triple::x86, ArchSpec::eCore_x86_32_i386, - "i386"}, - {eByteOrderLittle, 4, 1, 15, llvm::Triple::x86, ArchSpec::eCore_x86_32_i486, - "i486"}, - {eByteOrderLittle, 4, 1, 15, llvm::Triple::x86, - ArchSpec::eCore_x86_32_i486sx, "i486sx"}, - {eByteOrderLittle, 4, 1, 15, llvm::Triple::x86, ArchSpec::eCore_x86_32_i686, - "i686"}, - - {eByteOrderLittle, 8, 1, 15, llvm::Triple::x86_64, - ArchSpec::eCore_x86_64_x86_64, "x86_64"}, - {eByteOrderLittle, 8, 1, 15, llvm::Triple::x86_64, - ArchSpec::eCore_x86_64_x86_64h, "x86_64h"}, - {eByteOrderLittle, 4, 4, 4, llvm::Triple::hexagon, - ArchSpec::eCore_hexagon_generic, "hexagon"}, - {eByteOrderLittle, 4, 4, 4, llvm::Triple::hexagon, - ArchSpec::eCore_hexagon_hexagonv4, "hexagonv4"}, - {eByteOrderLittle, 4, 4, 4, llvm::Triple::hexagon, - ArchSpec::eCore_hexagon_hexagonv5, "hexagonv5"}, - - {eByteOrderLittle, 4, 4, 4, llvm::Triple::UnknownArch, - ArchSpec::eCore_uknownMach32, "unknown-mach-32"}, - {eByteOrderLittle, 8, 4, 4, llvm::Triple::UnknownArch, - ArchSpec::eCore_uknownMach64, "unknown-mach-64"}, - - {eByteOrderBig, 4, 1, 1, llvm::Triple::kalimba, ArchSpec::eCore_kalimba3, - "kalimba3"}, - {eByteOrderLittle, 4, 1, 1, llvm::Triple::kalimba, ArchSpec::eCore_kalimba4, - "kalimba4"}, - {eByteOrderLittle, 4, 1, 1, llvm::Triple::kalimba, ArchSpec::eCore_kalimba5, - "kalimba5"}}; - -// Ensure that we have an entry in the g_core_definitions for each core. If you -// comment out an entry above, -// you will need to comment out the corresponding ArchSpec::Core enumeration. -static_assert(sizeof(g_core_definitions) / sizeof(CoreDefinition) == - ArchSpec::kNumCores, - "make sure we have one core definition for each core"); - -struct ArchDefinitionEntry { - ArchSpec::Core core; - uint32_t cpu; - uint32_t sub; - uint32_t cpu_mask; - uint32_t sub_mask; -}; - -struct ArchDefinition { - ArchitectureType type; - size_t num_entries; - const ArchDefinitionEntry *entries; - const char *name; -}; - -size_t ArchSpec::AutoComplete(llvm::StringRef name, StringList &matches) { - if (!name.empty()) { - for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) { - if (NameMatches(g_core_definitions[i].name, NameMatch::StartsWith, name)) - matches.AppendString(g_core_definitions[i].name); - } - } else { - for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) - matches.AppendString(g_core_definitions[i].name); - } - return matches.GetSize(); -} - -#define CPU_ANY (UINT32_MAX) - -//===----------------------------------------------------------------------===// -// A table that gets searched linearly for matches. This table is used to -// convert cpu type and subtypes to architecture names, and to convert -// architecture names to cpu types and subtypes. The ordering is important and -// allows the precedence to be set when the table is built. -#define SUBTYPE_MASK 0x00FFFFFFu - -static const ArchDefinitionEntry g_macho_arch_entries[] = { - {ArchSpec::eCore_arm_generic, llvm::MachO::CPU_TYPE_ARM, CPU_ANY, - UINT32_MAX, UINT32_MAX}, - {ArchSpec::eCore_arm_generic, llvm::MachO::CPU_TYPE_ARM, 0, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv4, llvm::MachO::CPU_TYPE_ARM, 5, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv4t, llvm::MachO::CPU_TYPE_ARM, 5, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv6, llvm::MachO::CPU_TYPE_ARM, 6, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv6m, llvm::MachO::CPU_TYPE_ARM, 14, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv5, llvm::MachO::CPU_TYPE_ARM, 7, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv5e, llvm::MachO::CPU_TYPE_ARM, 7, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv5t, llvm::MachO::CPU_TYPE_ARM, 7, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_xscale, llvm::MachO::CPU_TYPE_ARM, 8, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv7, llvm::MachO::CPU_TYPE_ARM, 9, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv7f, llvm::MachO::CPU_TYPE_ARM, 10, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv7s, llvm::MachO::CPU_TYPE_ARM, 11, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv7k, llvm::MachO::CPU_TYPE_ARM, 12, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv7m, llvm::MachO::CPU_TYPE_ARM, 15, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_armv7em, llvm::MachO::CPU_TYPE_ARM, 16, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, 1, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, 0, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, 13, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, CPU_ANY, - UINT32_MAX, SUBTYPE_MASK}, - {ArchSpec::eCore_thumb, llvm::MachO::CPU_TYPE_ARM, 0, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv4t, llvm::MachO::CPU_TYPE_ARM, 5, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv5, llvm::MachO::CPU_TYPE_ARM, 7, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv5e, llvm::MachO::CPU_TYPE_ARM, 7, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv6, llvm::MachO::CPU_TYPE_ARM, 6, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv6m, llvm::MachO::CPU_TYPE_ARM, 14, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv7, llvm::MachO::CPU_TYPE_ARM, 9, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv7f, llvm::MachO::CPU_TYPE_ARM, 10, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv7s, llvm::MachO::CPU_TYPE_ARM, 11, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv7k, llvm::MachO::CPU_TYPE_ARM, 12, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv7m, llvm::MachO::CPU_TYPE_ARM, 15, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_thumbv7em, llvm::MachO::CPU_TYPE_ARM, 16, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_generic, llvm::MachO::CPU_TYPE_POWERPC, CPU_ANY, - UINT32_MAX, UINT32_MAX}, - {ArchSpec::eCore_ppc_generic, llvm::MachO::CPU_TYPE_POWERPC, 0, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc601, llvm::MachO::CPU_TYPE_POWERPC, 1, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc602, llvm::MachO::CPU_TYPE_POWERPC, 2, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc603, llvm::MachO::CPU_TYPE_POWERPC, 3, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc603e, llvm::MachO::CPU_TYPE_POWERPC, 4, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc603ev, llvm::MachO::CPU_TYPE_POWERPC, 5, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc604, llvm::MachO::CPU_TYPE_POWERPC, 6, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc604e, llvm::MachO::CPU_TYPE_POWERPC, 7, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc620, llvm::MachO::CPU_TYPE_POWERPC, 8, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc750, llvm::MachO::CPU_TYPE_POWERPC, 9, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc7400, llvm::MachO::CPU_TYPE_POWERPC, 10, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc7450, llvm::MachO::CPU_TYPE_POWERPC, 11, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc_ppc970, llvm::MachO::CPU_TYPE_POWERPC, 100, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_ppc64_generic, llvm::MachO::CPU_TYPE_POWERPC64, 0, - UINT32_MAX, SUBTYPE_MASK}, - {ArchSpec::eCore_ppc64_ppc970_64, llvm::MachO::CPU_TYPE_POWERPC64, 100, - UINT32_MAX, SUBTYPE_MASK}, - {ArchSpec::eCore_x86_32_i386, llvm::MachO::CPU_TYPE_I386, 3, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_x86_32_i486, llvm::MachO::CPU_TYPE_I386, 4, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_x86_32_i486sx, llvm::MachO::CPU_TYPE_I386, 0x84, - UINT32_MAX, SUBTYPE_MASK}, - {ArchSpec::eCore_x86_32_i386, llvm::MachO::CPU_TYPE_I386, CPU_ANY, - UINT32_MAX, UINT32_MAX}, - {ArchSpec::eCore_x86_64_x86_64, llvm::MachO::CPU_TYPE_X86_64, 3, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_x86_64_x86_64, llvm::MachO::CPU_TYPE_X86_64, 4, UINT32_MAX, - SUBTYPE_MASK}, - {ArchSpec::eCore_x86_64_x86_64h, llvm::MachO::CPU_TYPE_X86_64, 8, - UINT32_MAX, SUBTYPE_MASK}, - {ArchSpec::eCore_x86_64_x86_64, llvm::MachO::CPU_TYPE_X86_64, CPU_ANY, - UINT32_MAX, UINT32_MAX}, - // Catch any unknown mach architectures so we can always use the object and - // symbol mach-o files - {ArchSpec::eCore_uknownMach32, 0, 0, 0xFF000000u, 0x00000000u}, - {ArchSpec::eCore_uknownMach64, llvm::MachO::CPU_ARCH_ABI64, 0, 0xFF000000u, - 0x00000000u}}; - -static const ArchDefinition g_macho_arch_def = { - eArchTypeMachO, llvm::array_lengthof(g_macho_arch_entries), - g_macho_arch_entries, "mach-o"}; - -//===----------------------------------------------------------------------===// -// A table that gets searched linearly for matches. This table is used to -// convert cpu type and subtypes to architecture names, and to convert -// architecture names to cpu types and subtypes. The ordering is important and -// allows the precedence to be set when the table is built. -static const ArchDefinitionEntry g_elf_arch_entries[] = { - {ArchSpec::eCore_sparc_generic, llvm::ELF::EM_SPARC, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // Sparc - {ArchSpec::eCore_x86_32_i386, llvm::ELF::EM_386, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // Intel 80386 - {ArchSpec::eCore_x86_32_i486, llvm::ELF::EM_IAMCU, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // Intel MCU // FIXME: is this correct? - {ArchSpec::eCore_ppc_generic, llvm::ELF::EM_PPC, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC - {ArchSpec::eCore_ppc64_generic, llvm::ELF::EM_PPC64, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC64 - {ArchSpec::eCore_arm_generic, llvm::ELF::EM_ARM, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARM - {ArchSpec::eCore_arm_aarch64, llvm::ELF::EM_AARCH64, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARM64 - {ArchSpec::eCore_s390x_generic, llvm::ELF::EM_S390, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // SystemZ - {ArchSpec::eCore_sparc9_generic, llvm::ELF::EM_SPARCV9, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // SPARC V9 - {ArchSpec::eCore_x86_64_x86_64, llvm::ELF::EM_X86_64, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // AMD64 - {ArchSpec::eCore_mips32, llvm::ELF::EM_MIPS, ArchSpec::eMIPSSubType_mips32, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips32 - {ArchSpec::eCore_mips32r2, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips32r2, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips32r2 - {ArchSpec::eCore_mips32r6, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips32r6, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips32r6 - {ArchSpec::eCore_mips32el, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips32el, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips32el - {ArchSpec::eCore_mips32r2el, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips32r2el, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips32r2el - {ArchSpec::eCore_mips32r6el, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips32r6el, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips32r6el - {ArchSpec::eCore_mips64, llvm::ELF::EM_MIPS, ArchSpec::eMIPSSubType_mips64, - 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips64 - {ArchSpec::eCore_mips64r2, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips64r2, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips64r2 - {ArchSpec::eCore_mips64r6, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips64r6, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips64r6 - {ArchSpec::eCore_mips64el, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips64el, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips64el - {ArchSpec::eCore_mips64r2el, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips64r2el, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips64r2el - {ArchSpec::eCore_mips64r6el, llvm::ELF::EM_MIPS, - ArchSpec::eMIPSSubType_mips64r6el, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips64r6el - {ArchSpec::eCore_hexagon_generic, llvm::ELF::EM_HEXAGON, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // HEXAGON - {ArchSpec::eCore_kalimba3, llvm::ELF::EM_CSR_KALIMBA, - llvm::Triple::KalimbaSubArch_v3, 0xFFFFFFFFu, 0xFFFFFFFFu}, // KALIMBA - {ArchSpec::eCore_kalimba4, llvm::ELF::EM_CSR_KALIMBA, - llvm::Triple::KalimbaSubArch_v4, 0xFFFFFFFFu, 0xFFFFFFFFu}, // KALIMBA - {ArchSpec::eCore_kalimba5, llvm::ELF::EM_CSR_KALIMBA, - llvm::Triple::KalimbaSubArch_v5, 0xFFFFFFFFu, 0xFFFFFFFFu} // KALIMBA -}; - -static const ArchDefinition g_elf_arch_def = { - eArchTypeELF, llvm::array_lengthof(g_elf_arch_entries), g_elf_arch_entries, - "elf", -}; - -static const ArchDefinitionEntry g_coff_arch_entries[] = { - {ArchSpec::eCore_x86_32_i386, llvm::COFF::IMAGE_FILE_MACHINE_I386, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // Intel 80x86 - {ArchSpec::eCore_ppc_generic, llvm::COFF::IMAGE_FILE_MACHINE_POWERPC, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC - {ArchSpec::eCore_ppc_generic, llvm::COFF::IMAGE_FILE_MACHINE_POWERPCFP, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC (with FPU) - {ArchSpec::eCore_arm_generic, llvm::COFF::IMAGE_FILE_MACHINE_ARM, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARM - {ArchSpec::eCore_arm_armv7, llvm::COFF::IMAGE_FILE_MACHINE_ARMNT, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARMv7 - {ArchSpec::eCore_thumb, llvm::COFF::IMAGE_FILE_MACHINE_THUMB, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARMv7 - {ArchSpec::eCore_x86_64_x86_64, llvm::COFF::IMAGE_FILE_MACHINE_AMD64, - LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu} // AMD64 -}; - -static const ArchDefinition g_coff_arch_def = { - eArchTypeCOFF, llvm::array_lengthof(g_coff_arch_entries), - g_coff_arch_entries, "pe-coff", -}; - -//===----------------------------------------------------------------------===// -// Table of all ArchDefinitions -static const ArchDefinition *g_arch_definitions[] = { - &g_macho_arch_def, &g_elf_arch_def, &g_coff_arch_def}; - -static const size_t k_num_arch_definitions = - llvm::array_lengthof(g_arch_definitions); - -//===----------------------------------------------------------------------===// -// Static helper functions. - -// Get the architecture definition for a given object type. -static const ArchDefinition *FindArchDefinition(ArchitectureType arch_type) { - for (unsigned int i = 0; i < k_num_arch_definitions; ++i) { - const ArchDefinition *def = g_arch_definitions[i]; - if (def->type == arch_type) - return def; - } - return nullptr; -} - -// Get an architecture definition by name. -static const CoreDefinition *FindCoreDefinition(llvm::StringRef name) { - for (unsigned int i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) { - if (name.equals_lower(g_core_definitions[i].name)) - return &g_core_definitions[i]; - } - return nullptr; -} - -static inline const CoreDefinition *FindCoreDefinition(ArchSpec::Core core) { - if (core >= 0 && core < llvm::array_lengthof(g_core_definitions)) - return &g_core_definitions[core]; - return nullptr; -} - -// Get a definition entry by cpu type and subtype. -static const ArchDefinitionEntry * -FindArchDefinitionEntry(const ArchDefinition *def, uint32_t cpu, uint32_t sub) { - if (def == nullptr) - return nullptr; - - const ArchDefinitionEntry *entries = def->entries; - for (size_t i = 0; i < def->num_entries; ++i) { - if (entries[i].cpu == (cpu & entries[i].cpu_mask)) - if (entries[i].sub == (sub & entries[i].sub_mask)) - return &entries[i]; - } - return nullptr; -} - -static const ArchDefinitionEntry * -FindArchDefinitionEntry(const ArchDefinition *def, ArchSpec::Core core) { - if (def == nullptr) - return nullptr; - - const ArchDefinitionEntry *entries = def->entries; - for (size_t i = 0; i < def->num_entries; ++i) { - if (entries[i].core == core) - return &entries[i]; - } - return nullptr; -} - -//===----------------------------------------------------------------------===// -// Constructors and destructors. - -ArchSpec::ArchSpec() {} - -ArchSpec::ArchSpec(const char *triple_cstr, Platform *platform) { - if (triple_cstr) - SetTriple(triple_cstr, platform); -} - -ArchSpec::ArchSpec(llvm::StringRef triple_str, Platform *platform) { - SetTriple(triple_str, platform); -} - -ArchSpec::ArchSpec(const char *triple_cstr) { - if (triple_cstr) - SetTriple(triple_cstr); -} - -ArchSpec::ArchSpec(llvm::StringRef triple_str) { SetTriple(triple_str); } - -ArchSpec::ArchSpec(const llvm::Triple &triple) { SetTriple(triple); } - -ArchSpec::ArchSpec(ArchitectureType arch_type, uint32_t cpu, uint32_t subtype) { - SetArchitecture(arch_type, cpu, subtype); -} - -ArchSpec::~ArchSpec() = default; - -//===----------------------------------------------------------------------===// -// Assignment and initialization. - -const ArchSpec &ArchSpec::operator=(const ArchSpec &rhs) { - if (this != &rhs) { - m_triple = rhs.m_triple; - m_core = rhs.m_core; - m_byte_order = rhs.m_byte_order; - m_distribution_id = rhs.m_distribution_id; - m_flags = rhs.m_flags; - } - return *this; -} - -void ArchSpec::Clear() { - m_triple = llvm::Triple(); - m_core = kCore_invalid; - m_byte_order = eByteOrderInvalid; - m_distribution_id.Clear(); - m_flags = 0; -} - -//===----------------------------------------------------------------------===// -// Predicates. - -const char *ArchSpec::GetArchitectureName() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) - return core_def->name; - return "unknown"; -} - -bool ArchSpec::IsMIPS() const { - const llvm::Triple::ArchType machine = GetMachine(); - if (machine == llvm::Triple::mips || machine == llvm::Triple::mipsel || - machine == llvm::Triple::mips64 || machine == llvm::Triple::mips64el) - return true; - return false; -} - -std::string ArchSpec::GetTargetABI() const { - - std::string abi; - - if (IsMIPS()) { - switch (GetFlags() & ArchSpec::eMIPSABI_mask) { - case ArchSpec::eMIPSABI_N64: - abi = "n64"; - return abi; - case ArchSpec::eMIPSABI_N32: - abi = "n32"; - return abi; - case ArchSpec::eMIPSABI_O32: - abi = "o32"; - return abi; - default: - return abi; - } - } - return abi; -} - -void ArchSpec::SetFlags(std::string elf_abi) { - - uint32_t flag = GetFlags(); - if (IsMIPS()) { - if (elf_abi == "n64") - flag |= ArchSpec::eMIPSABI_N64; - else if (elf_abi == "n32") - flag |= ArchSpec::eMIPSABI_N32; - else if (elf_abi == "o32") - flag |= ArchSpec::eMIPSABI_O32; - } - SetFlags(flag); -} - -std::string ArchSpec::GetClangTargetCPU() const { - std::string cpu; - const llvm::Triple::ArchType machine = GetMachine(); - - if (machine == llvm::Triple::mips || machine == llvm::Triple::mipsel || - machine == llvm::Triple::mips64 || machine == llvm::Triple::mips64el) { - switch (m_core) { - case ArchSpec::eCore_mips32: - case ArchSpec::eCore_mips32el: - cpu = "mips32"; - break; - case ArchSpec::eCore_mips32r2: - case ArchSpec::eCore_mips32r2el: - cpu = "mips32r2"; - break; - case ArchSpec::eCore_mips32r3: - case ArchSpec::eCore_mips32r3el: - cpu = "mips32r3"; - break; - case ArchSpec::eCore_mips32r5: - case ArchSpec::eCore_mips32r5el: - cpu = "mips32r5"; - break; - case ArchSpec::eCore_mips32r6: - case ArchSpec::eCore_mips32r6el: - cpu = "mips32r6"; - break; - case ArchSpec::eCore_mips64: - case ArchSpec::eCore_mips64el: - cpu = "mips64"; - break; - case ArchSpec::eCore_mips64r2: - case ArchSpec::eCore_mips64r2el: - cpu = "mips64r2"; - break; - case ArchSpec::eCore_mips64r3: - case ArchSpec::eCore_mips64r3el: - cpu = "mips64r3"; - break; - case ArchSpec::eCore_mips64r5: - case ArchSpec::eCore_mips64r5el: - cpu = "mips64r5"; - break; - case ArchSpec::eCore_mips64r6: - case ArchSpec::eCore_mips64r6el: - cpu = "mips64r6"; - break; - default: - break; - } - } - return cpu; -} - -uint32_t ArchSpec::GetMachOCPUType() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) { - const ArchDefinitionEntry *arch_def = - FindArchDefinitionEntry(&g_macho_arch_def, core_def->core); - if (arch_def) { - return arch_def->cpu; - } - } - return LLDB_INVALID_CPUTYPE; -} - -uint32_t ArchSpec::GetMachOCPUSubType() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) { - const ArchDefinitionEntry *arch_def = - FindArchDefinitionEntry(&g_macho_arch_def, core_def->core); - if (arch_def) { - return arch_def->sub; - } - } - return LLDB_INVALID_CPUTYPE; -} - -uint32_t ArchSpec::GetDataByteSize() const { - switch (m_core) { - case eCore_kalimba3: - return 4; - case eCore_kalimba4: - return 1; - case eCore_kalimba5: - return 4; - default: - return 1; - } - return 1; -} - -uint32_t ArchSpec::GetCodeByteSize() const { - switch (m_core) { - case eCore_kalimba3: - return 4; - case eCore_kalimba4: - return 1; - case eCore_kalimba5: - return 1; - default: - return 1; - } - return 1; -} - -llvm::Triple::ArchType ArchSpec::GetMachine() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) - return core_def->machine; - - return llvm::Triple::UnknownArch; -} - -const ConstString &ArchSpec::GetDistributionId() const { - return m_distribution_id; -} - -void ArchSpec::SetDistributionId(const char *distribution_id) { - m_distribution_id.SetCString(distribution_id); -} - -uint32_t ArchSpec::GetAddressByteSize() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) { - if (core_def->machine == llvm::Triple::mips64 || - core_def->machine == llvm::Triple::mips64el) { - // For N32/O32 applications Address size is 4 bytes. - if (m_flags & (eMIPSABI_N32 | eMIPSABI_O32)) - return 4; - } - return core_def->addr_byte_size; - } - return 0; -} - -ByteOrder ArchSpec::GetDefaultEndian() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) - return core_def->default_byte_order; - return eByteOrderInvalid; -} - -bool ArchSpec::CharIsSignedByDefault() const { - switch (m_triple.getArch()) { - default: - return true; - - case llvm::Triple::aarch64: - case llvm::Triple::aarch64_be: - case llvm::Triple::arm: - case llvm::Triple::armeb: - case llvm::Triple::thumb: - case llvm::Triple::thumbeb: - return m_triple.isOSDarwin() || m_triple.isOSWindows(); - - case llvm::Triple::ppc: - case llvm::Triple::ppc64: - return m_triple.isOSDarwin(); - - case llvm::Triple::ppc64le: - case llvm::Triple::systemz: - case llvm::Triple::xcore: - return false; - } -} - -lldb::ByteOrder ArchSpec::GetByteOrder() const { - if (m_byte_order == eByteOrderInvalid) - return GetDefaultEndian(); - return m_byte_order; -} - -//===----------------------------------------------------------------------===// -// Mutators. - -bool ArchSpec::SetTriple(const llvm::Triple &triple) { - m_triple = triple; - UpdateCore(); - return IsValid(); -} - -bool lldb_private::ParseMachCPUDashSubtypeTriple(llvm::StringRef triple_str, - ArchSpec &arch) { - // Accept "12-10" or "12.10" as cpu type/subtype - if (triple_str.empty()) - return false; - - size_t pos = triple_str.find_first_of("-."); - if (pos == llvm::StringRef::npos) - return false; - - llvm::StringRef cpu_str = triple_str.substr(0, pos); - llvm::StringRef remainder = triple_str.substr(pos + 1); - if (cpu_str.empty() || remainder.empty()) - return false; - - llvm::StringRef sub_str; - llvm::StringRef vendor; - llvm::StringRef os; - std::tie(sub_str, remainder) = remainder.split('-'); - std::tie(vendor, os) = remainder.split('-'); - - uint32_t cpu = 0; - uint32_t sub = 0; - if (cpu_str.getAsInteger(10, cpu) || sub_str.getAsInteger(10, sub)) - return false; - - if (!arch.SetArchitecture(eArchTypeMachO, cpu, sub)) - return false; - if (!vendor.empty() && !os.empty()) { - arch.GetTriple().setVendorName(vendor); - arch.GetTriple().setOSName(os); - } - - return true; -} - -bool ArchSpec::SetTriple(const char *triple_cstr) { - llvm::StringRef str(triple_cstr ? triple_cstr : ""); - return SetTriple(str); -} - -bool ArchSpec::SetTriple(const char *triple_cstr, Platform *platform) { - llvm::StringRef str(triple_cstr ? triple_cstr : ""); - return SetTriple(str, platform); -} - -bool ArchSpec::SetTriple(llvm::StringRef triple) { - if (triple.empty()) { - Clear(); - return false; - } - - if (ParseMachCPUDashSubtypeTriple(triple, *this)) - return true; - - if (triple.startswith(LLDB_ARCH_DEFAULT)) { - // Special case for the current host default architectures... - if (triple.equals(LLDB_ARCH_DEFAULT_32BIT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKind32); - else if (triple.equals(LLDB_ARCH_DEFAULT_64BIT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKind64); - else if (triple.equals(LLDB_ARCH_DEFAULT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKindDefault); - } else { - SetTriple(llvm::Triple(llvm::Triple::normalize(triple))); - } - return IsValid(); -} - -bool ArchSpec::SetTriple(llvm::StringRef triple, Platform *platform) { - if (triple.empty()) { - Clear(); - return false; - } - if (ParseMachCPUDashSubtypeTriple(triple, *this)) - return true; - - if (triple.startswith(LLDB_ARCH_DEFAULT)) { - // Special case for the current host default architectures... - if (triple.equals(LLDB_ARCH_DEFAULT_32BIT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKind32); - else if (triple.equals(LLDB_ARCH_DEFAULT_64BIT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKind64); - else if (triple.equals(LLDB_ARCH_DEFAULT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKindDefault); - return IsValid(); - } - - ArchSpec raw_arch(triple); - - llvm::Triple normalized_triple(llvm::Triple::normalize(triple)); - - const bool os_specified = !normalized_triple.getOSName().empty(); - const bool vendor_specified = !normalized_triple.getVendorName().empty(); - const bool env_specified = !normalized_triple.getEnvironmentName().empty(); - - if (os_specified || vendor_specified || env_specified) { - SetTriple(normalized_triple); - return IsValid(); - } - - // We got an arch only. If there is no platform, fallback to the host system - // for defaults. - if (!platform) { - llvm::Triple host_triple(llvm::sys::getDefaultTargetTriple()); - if (!vendor_specified) - normalized_triple.setVendor(host_triple.getVendor()); - if (!vendor_specified) - normalized_triple.setOS(host_triple.getOS()); - if (!env_specified && host_triple.getEnvironmentName().size()) - normalized_triple.setEnvironment(host_triple.getEnvironment()); - SetTriple(normalized_triple); - return IsValid(); - } - - // If we were given a platform, use the platform's system architecture. If - // this is not available (might not be connected) use the first supported - // architecture. - ArchSpec compatible_arch; - if (!platform->IsCompatibleArchitecture(raw_arch, false, &compatible_arch)) { - *this = raw_arch; - return IsValid(); - } - - if (compatible_arch.IsValid()) { - const llvm::Triple &compatible_triple = compatible_arch.GetTriple(); - if (!vendor_specified) - normalized_triple.setVendor(compatible_triple.getVendor()); - if (!os_specified) - normalized_triple.setOS(compatible_triple.getOS()); - if (!env_specified && compatible_triple.hasEnvironment()) - normalized_triple.setEnvironment(compatible_triple.getEnvironment()); - } - - SetTriple(normalized_triple); - return IsValid(); -} - -void ArchSpec::MergeFrom(const ArchSpec &other) { - if (TripleVendorIsUnspecifiedUnknown() && - !other.TripleVendorIsUnspecifiedUnknown()) - GetTriple().setVendor(other.GetTriple().getVendor()); - if (TripleOSIsUnspecifiedUnknown() && !other.TripleOSIsUnspecifiedUnknown()) - GetTriple().setOS(other.GetTriple().getOS()); - if (GetTriple().getArch() == llvm::Triple::UnknownArch) { - GetTriple().setArch(other.GetTriple().getArch()); - UpdateCore(); - } - if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment && - !TripleVendorWasSpecified()) { - if (other.TripleVendorWasSpecified()) - GetTriple().setEnvironment(other.GetTriple().getEnvironment()); - } - // If this and other are both arm ArchSpecs and this ArchSpec is a generic - // "some kind of arm" - // spec but the other ArchSpec is a specific arm core, adopt the specific arm - // core. - if (GetTriple().getArch() == llvm::Triple::arm && - other.GetTriple().getArch() == llvm::Triple::arm && - IsCompatibleMatch(other) && GetCore() == ArchSpec::eCore_arm_generic && - other.GetCore() != ArchSpec::eCore_arm_generic) { - m_core = other.GetCore(); - CoreUpdated(true); - } -} - -bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu, - uint32_t sub, uint32_t os) { - m_core = kCore_invalid; - bool update_triple = true; - const ArchDefinition *arch_def = FindArchDefinition(arch_type); - if (arch_def) { - const ArchDefinitionEntry *arch_def_entry = - FindArchDefinitionEntry(arch_def, cpu, sub); - if (arch_def_entry) { - const CoreDefinition *core_def = FindCoreDefinition(arch_def_entry->core); - if (core_def) { - m_core = core_def->core; - update_triple = false; - // Always use the architecture name because it might be more descriptive - // than the architecture enum ("armv7" -> llvm::Triple::arm). - m_triple.setArchName(llvm::StringRef(core_def->name)); - if (arch_type == eArchTypeMachO) { - m_triple.setVendor(llvm::Triple::Apple); - - // Don't set the OS. It could be simulator, macosx, ios, watchos, - // tvos. We could - // get close with the cpu type - but we can't get it right all of the - // time. Better - // to leave this unset so other sections of code will set it when they - // have more - // information. - // NB: don't call m_triple.setOS (llvm::Triple::UnknownOS). That sets - // the OSName to - // "unknown" and the ArchSpec::TripleVendorWasSpecified() method says - // that any - // OSName setting means it was specified. - } else if (arch_type == eArchTypeELF) { - switch (os) { - case llvm::ELF::ELFOSABI_AIX: - m_triple.setOS(llvm::Triple::OSType::AIX); - break; - case llvm::ELF::ELFOSABI_FREEBSD: - m_triple.setOS(llvm::Triple::OSType::FreeBSD); - break; - case llvm::ELF::ELFOSABI_GNU: - m_triple.setOS(llvm::Triple::OSType::Linux); - break; - case llvm::ELF::ELFOSABI_NETBSD: - m_triple.setOS(llvm::Triple::OSType::NetBSD); - break; - case llvm::ELF::ELFOSABI_OPENBSD: - m_triple.setOS(llvm::Triple::OSType::OpenBSD); - break; - case llvm::ELF::ELFOSABI_SOLARIS: - m_triple.setOS(llvm::Triple::OSType::Solaris); - break; - } - } else if (arch_type == eArchTypeCOFF && os == llvm::Triple::Win32) { - m_triple.setVendor(llvm::Triple::PC); - m_triple.setOS(llvm::Triple::Win32); - } else { - m_triple.setVendor(llvm::Triple::UnknownVendor); - m_triple.setOS(llvm::Triple::UnknownOS); - } - // Fall back onto setting the machine type if the arch by name failed... - if (m_triple.getArch() == llvm::Triple::UnknownArch) - m_triple.setArch(core_def->machine); - } - } - } - CoreUpdated(update_triple); - return IsValid(); -} - -uint32_t ArchSpec::GetMinimumOpcodeByteSize() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) - return core_def->min_opcode_byte_size; - return 0; -} - -uint32_t ArchSpec::GetMaximumOpcodeByteSize() const { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) - return core_def->max_opcode_byte_size; - return 0; -} - -bool ArchSpec::IsExactMatch(const ArchSpec &rhs) const { - return IsEqualTo(rhs, true); -} - -bool ArchSpec::IsCompatibleMatch(const ArchSpec &rhs) const { - return IsEqualTo(rhs, false); -} - -static bool isCompatibleEnvironment(llvm::Triple::EnvironmentType lhs, - llvm::Triple::EnvironmentType rhs) { - if (lhs == rhs) - return true; - - // If any of the environment is unknown then they are compatible - if (lhs == llvm::Triple::UnknownEnvironment || - rhs == llvm::Triple::UnknownEnvironment) - return true; - - // If one of the environment is Android and the other one is EABI then they - // are considered to - // be compatible. This is required as a workaround for shared libraries - // compiled for Android - // without the NOTE section indicating that they are using the Android ABI. - if ((lhs == llvm::Triple::Android && rhs == llvm::Triple::EABI) || - (rhs == llvm::Triple::Android && lhs == llvm::Triple::EABI) || - (lhs == llvm::Triple::GNUEABI && rhs == llvm::Triple::EABI) || - (rhs == llvm::Triple::GNUEABI && lhs == llvm::Triple::EABI) || - (lhs == llvm::Triple::GNUEABIHF && rhs == llvm::Triple::EABIHF) || - (rhs == llvm::Triple::GNUEABIHF && lhs == llvm::Triple::EABIHF)) - return true; - - return false; -} - -bool ArchSpec::IsEqualTo(const ArchSpec &rhs, bool exact_match) const { - // explicitly ignoring m_distribution_id in this method. - - if (GetByteOrder() != rhs.GetByteOrder()) - return false; - - const ArchSpec::Core lhs_core = GetCore(); - const ArchSpec::Core rhs_core = rhs.GetCore(); - - const bool core_match = cores_match(lhs_core, rhs_core, true, exact_match); - - if (core_match) { - const llvm::Triple &lhs_triple = GetTriple(); - const llvm::Triple &rhs_triple = rhs.GetTriple(); - - const llvm::Triple::VendorType lhs_triple_vendor = lhs_triple.getVendor(); - const llvm::Triple::VendorType rhs_triple_vendor = rhs_triple.getVendor(); - if (lhs_triple_vendor != rhs_triple_vendor) { - const bool rhs_vendor_specified = rhs.TripleVendorWasSpecified(); - const bool lhs_vendor_specified = TripleVendorWasSpecified(); - // Both architectures had the vendor specified, so if they aren't - // equal then we return false - if (rhs_vendor_specified && lhs_vendor_specified) - return false; - - // Only fail if both vendor types are not unknown - if (lhs_triple_vendor != llvm::Triple::UnknownVendor && - rhs_triple_vendor != llvm::Triple::UnknownVendor) - return false; - } - - const llvm::Triple::OSType lhs_triple_os = lhs_triple.getOS(); - const llvm::Triple::OSType rhs_triple_os = rhs_triple.getOS(); - if (lhs_triple_os != rhs_triple_os) { - const bool rhs_os_specified = rhs.TripleOSWasSpecified(); - const bool lhs_os_specified = TripleOSWasSpecified(); - // Both architectures had the OS specified, so if they aren't - // equal then we return false - if (rhs_os_specified && lhs_os_specified) - return false; - - // Only fail if both os types are not unknown - if (lhs_triple_os != llvm::Triple::UnknownOS && - rhs_triple_os != llvm::Triple::UnknownOS) - return false; - } - - const llvm::Triple::EnvironmentType lhs_triple_env = - lhs_triple.getEnvironment(); - const llvm::Triple::EnvironmentType rhs_triple_env = - rhs_triple.getEnvironment(); - - if (!isCompatibleEnvironment(lhs_triple_env, rhs_triple_env)) - return false; - return true; - } - return false; -} - -void ArchSpec::UpdateCore() { - llvm::StringRef arch_name(m_triple.getArchName()); - const CoreDefinition *core_def = FindCoreDefinition(arch_name); - if (core_def) { - m_core = core_def->core; - // Set the byte order to the default byte order for an architecture. - // This can be modified if needed for cases when cores handle both - // big and little endian - m_byte_order = core_def->default_byte_order; - } else { - Clear(); - } -} - -//===----------------------------------------------------------------------===// -// Helper methods. - -void ArchSpec::CoreUpdated(bool update_triple) { - const CoreDefinition *core_def = FindCoreDefinition(m_core); - if (core_def) { - if (update_triple) - m_triple = llvm::Triple(core_def->name, "unknown", "unknown"); - m_byte_order = core_def->default_byte_order; - } else { - if (update_triple) - m_triple = llvm::Triple(); - m_byte_order = eByteOrderInvalid; - } -} - -//===----------------------------------------------------------------------===// -// Operators. - -static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2, - bool try_inverse, bool enforce_exact_match) { - if (core1 == core2) - return true; - - switch (core1) { - case ArchSpec::kCore_any: - return true; - - case ArchSpec::eCore_arm_generic: - if (enforce_exact_match) - break; - LLVM_FALLTHROUGH; - case ArchSpec::kCore_arm_any: - if (core2 >= ArchSpec::kCore_arm_first && core2 <= ArchSpec::kCore_arm_last) - return true; - if (core2 >= ArchSpec::kCore_thumb_first && - core2 <= ArchSpec::kCore_thumb_last) - return true; - if (core2 == ArchSpec::kCore_arm_any) - return true; - break; - - case ArchSpec::kCore_x86_32_any: - if ((core2 >= ArchSpec::kCore_x86_32_first && - core2 <= ArchSpec::kCore_x86_32_last) || - (core2 == ArchSpec::kCore_x86_32_any)) - return true; - break; - - case ArchSpec::kCore_x86_64_any: - if ((core2 >= ArchSpec::kCore_x86_64_first && - core2 <= ArchSpec::kCore_x86_64_last) || - (core2 == ArchSpec::kCore_x86_64_any)) - return true; - break; - - case ArchSpec::kCore_ppc_any: - if ((core2 >= ArchSpec::kCore_ppc_first && - core2 <= ArchSpec::kCore_ppc_last) || - (core2 == ArchSpec::kCore_ppc_any)) - return true; - break; - - case ArchSpec::kCore_ppc64_any: - if ((core2 >= ArchSpec::kCore_ppc64_first && - core2 <= ArchSpec::kCore_ppc64_last) || - (core2 == ArchSpec::kCore_ppc64_any)) - return true; - break; - - case ArchSpec::eCore_arm_armv6m: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_arm_generic) - return true; - try_inverse = false; - if (core2 == ArchSpec::eCore_arm_armv7) - return true; - if (core2 == ArchSpec::eCore_arm_armv6m) - return true; - } - break; - - case ArchSpec::kCore_hexagon_any: - if ((core2 >= ArchSpec::kCore_hexagon_first && - core2 <= ArchSpec::kCore_hexagon_last) || - (core2 == ArchSpec::kCore_hexagon_any)) - return true; - break; - - // v. https://en.wikipedia.org/wiki/ARM_Cortex-M#Silicon_customization - // Cortex-M0 - ARMv6-M - armv6m - // Cortex-M3 - ARMv7-M - armv7m - // Cortex-M4 - ARMv7E-M - armv7em - case ArchSpec::eCore_arm_armv7em: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_arm_generic) - return true; - if (core2 == ArchSpec::eCore_arm_armv7m) - return true; - if (core2 == ArchSpec::eCore_arm_armv6m) - return true; - if (core2 == ArchSpec::eCore_arm_armv7) - return true; - try_inverse = true; - } - break; - - // v. https://en.wikipedia.org/wiki/ARM_Cortex-M#Silicon_customization - // Cortex-M0 - ARMv6-M - armv6m - // Cortex-M3 - ARMv7-M - armv7m - // Cortex-M4 - ARMv7E-M - armv7em - case ArchSpec::eCore_arm_armv7m: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_arm_generic) - return true; - if (core2 == ArchSpec::eCore_arm_armv6m) - return true; - if (core2 == ArchSpec::eCore_arm_armv7) - return true; - if (core2 == ArchSpec::eCore_arm_armv7em) - return true; - try_inverse = true; - } - break; - - case ArchSpec::eCore_arm_armv7f: - case ArchSpec::eCore_arm_armv7k: - case ArchSpec::eCore_arm_armv7s: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_arm_generic) - return true; - if (core2 == ArchSpec::eCore_arm_armv7) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_x86_64_x86_64h: - if (!enforce_exact_match) { - try_inverse = false; - if (core2 == ArchSpec::eCore_x86_64_x86_64) - return true; - } - break; - - case ArchSpec::eCore_arm_armv8: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_arm_arm64) - return true; - if (core2 == ArchSpec::eCore_arm_aarch64) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_arm_aarch64: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_arm_arm64) - return true; - if (core2 == ArchSpec::eCore_arm_armv8) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_arm_arm64: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_arm_aarch64) - return true; - if (core2 == ArchSpec::eCore_arm_armv8) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_mips32: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32_first && - core2 <= ArchSpec::kCore_mips32_last) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_mips32el: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32el_first && - core2 <= ArchSpec::kCore_mips32el_last) - return true; - try_inverse = true; - } - break; - - case ArchSpec::eCore_mips64: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32_first && - core2 <= ArchSpec::kCore_mips32_last) - return true; - if (core2 >= ArchSpec::kCore_mips64_first && - core2 <= ArchSpec::kCore_mips64_last) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_mips64el: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32el_first && - core2 <= ArchSpec::kCore_mips32el_last) - return true; - if (core2 >= ArchSpec::kCore_mips64el_first && - core2 <= ArchSpec::kCore_mips64el_last) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_mips64r2: - case ArchSpec::eCore_mips64r3: - case ArchSpec::eCore_mips64r5: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32_first && core2 <= (core1 - 10)) - return true; - if (core2 >= ArchSpec::kCore_mips64_first && core2 <= (core1 - 1)) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_mips64r2el: - case ArchSpec::eCore_mips64r3el: - case ArchSpec::eCore_mips64r5el: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= (core1 - 10)) - return true; - if (core2 >= ArchSpec::kCore_mips64el_first && core2 <= (core1 - 1)) - return true; - try_inverse = false; - } - break; - - case ArchSpec::eCore_mips32r2: - case ArchSpec::eCore_mips32r3: - case ArchSpec::eCore_mips32r5: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32_first && core2 <= core1) - return true; - } - break; - - case ArchSpec::eCore_mips32r2el: - case ArchSpec::eCore_mips32r3el: - case ArchSpec::eCore_mips32r5el: - if (!enforce_exact_match) { - if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= core1) - return true; - } - break; - - case ArchSpec::eCore_mips32r6: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_mips32 || core2 == ArchSpec::eCore_mips32r6) - return true; - } - break; - - case ArchSpec::eCore_mips32r6el: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_mips32el || - core2 == ArchSpec::eCore_mips32r6el) - return true; - } - break; - - case ArchSpec::eCore_mips64r6: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_mips32 || core2 == ArchSpec::eCore_mips32r6) - return true; - if (core2 == ArchSpec::eCore_mips64 || core2 == ArchSpec::eCore_mips64r6) - return true; - } - break; - - case ArchSpec::eCore_mips64r6el: - if (!enforce_exact_match) { - if (core2 == ArchSpec::eCore_mips32el || - core2 == ArchSpec::eCore_mips32r6el) - return true; - if (core2 == ArchSpec::eCore_mips64el || - core2 == ArchSpec::eCore_mips64r6el) - return true; - } - break; - - default: - break; - } - if (try_inverse) - return cores_match(core2, core1, false, enforce_exact_match); - return false; -} - -bool lldb_private::operator<(const ArchSpec &lhs, const ArchSpec &rhs) { - const ArchSpec::Core lhs_core = lhs.GetCore(); - const ArchSpec::Core rhs_core = rhs.GetCore(); - return lhs_core < rhs_core; -} - -static void StopInfoOverrideCallbackTypeARM(lldb_private::Thread &thread) { - // We need to check if we are stopped in Thumb mode in a IT instruction - // and detect if the condition doesn't pass. If this is the case it means - // we won't actually execute this instruction. If this happens we need to - // clear the stop reason to no thread plans think we are stopped for a - // reason and the plans should keep going. - // - // We do this because when single stepping many ARM processes, debuggers - // often use the BVR/BCR registers that says "stop when the PC is not - // equal to its current value". This method of stepping means we can end - // up stopping on instructions inside an if/then block that wouldn't get - // executed. By fixing this we can stop the debugger from seeming like - // you stepped through both the "if" _and_ the "else" clause when source - // level stepping because the debugger stops regardless due to the BVR/BCR - // triggering a stop. - // - // It also means we can set breakpoints on instructions inside an an - // if/then block and correctly skip them if we use the BKPT instruction. - // The ARM and Thumb BKPT instructions are unconditional even when executed - // in a Thumb IT block. - // - // If your debugger inserts software traps in ARM/Thumb code, it will - // need to use 16 and 32 bit instruction for 16 and 32 bit thumb - // instructions respectively. If your debugger inserts a 16 bit thumb - // trap on top of a 32 bit thumb instruction for an opcode that is inside - // an if/then, it will change the it/then to conditionally execute your - // 16 bit trap and then cause your program to crash if it executes the - // trailing 16 bits (the second half of the 32 bit thumb instruction you - // partially overwrote). - - RegisterContextSP reg_ctx_sp(thread.GetRegisterContext()); - if (reg_ctx_sp) { - const uint32_t cpsr = reg_ctx_sp->GetFlags(0); - if (cpsr != 0) { - // Read the J and T bits to get the ISETSTATE - const uint32_t J = Bit32(cpsr, 24); - const uint32_t T = Bit32(cpsr, 5); - const uint32_t ISETSTATE = J << 1 | T; - if (ISETSTATE == 0) { -// NOTE: I am pretty sure we want to enable the code below -// that detects when we stop on an instruction in ARM mode -// that is conditional and the condition doesn't pass. This -// can happen if you set a breakpoint on an instruction that -// is conditional. We currently will _always_ stop on the -// instruction which is bad. You can also run into this while -// single stepping and you could appear to run code in the "if" -// and in the "else" clause because it would stop at all of the -// conditional instructions in both. -// In such cases, we really don't want to stop at this location. -// I will check with the lldb-dev list first before I enable this. -#if 0 - // ARM mode: check for condition on intsruction - const addr_t pc = reg_ctx_sp->GetPC(); - Status error; - // If we fail to read the opcode we will get UINT64_MAX as the - // result in "opcode" which we can use to detect if we read a - // valid opcode. - const uint64_t opcode = thread.GetProcess()->ReadUnsignedIntegerFromMemory(pc, 4, UINT64_MAX, error); - if (opcode <= UINT32_MAX) - { - const uint32_t condition = Bits32((uint32_t)opcode, 31, 28); - if (!ARMConditionPassed(condition, cpsr)) - { - // We ARE stopped on an ARM instruction whose condition doesn't - // pass so this instruction won't get executed. - // Regardless of why it stopped, we need to clear the stop info - thread.SetStopInfo (StopInfoSP()); - } - } -#endif - } else if (ISETSTATE == 1) { - // Thumb mode - const uint32_t ITSTATE = - Bits32(cpsr, 15, 10) << 2 | Bits32(cpsr, 26, 25); - if (ITSTATE != 0) { - const uint32_t condition = Bits32(ITSTATE, 7, 4); - if (!ARMConditionPassed(condition, cpsr)) { - // We ARE stopped in a Thumb IT instruction on an instruction whose - // condition doesn't pass so this instruction won't get executed. - // Regardless of why it stopped, we need to clear the stop info - thread.SetStopInfo(StopInfoSP()); - } - } - } - } - } -} - -ArchSpec::StopInfoOverrideCallbackType -ArchSpec::GetStopInfoOverrideCallback() const { - const llvm::Triple::ArchType machine = GetMachine(); - if (machine == llvm::Triple::arm) - return StopInfoOverrideCallbackTypeARM; - return nullptr; -} - -bool ArchSpec::IsFullySpecifiedTriple() const { - const auto &user_specified_triple = GetTriple(); - - bool user_triple_fully_specified = false; - - if ((user_specified_triple.getOS() != llvm::Triple::UnknownOS) || - TripleOSWasSpecified()) { - if ((user_specified_triple.getVendor() != llvm::Triple::UnknownVendor) || - TripleVendorWasSpecified()) { - const unsigned unspecified = 0; - if (user_specified_triple.getOSMajorVersion() != unspecified) { - user_triple_fully_specified = true; - } - } - } - - return user_triple_fully_specified; -} - -void ArchSpec::PiecewiseTripleCompare( - const ArchSpec &other, bool &arch_different, bool &vendor_different, - bool &os_different, bool &os_version_different, bool &env_different) { - const llvm::Triple &me(GetTriple()); - const llvm::Triple &them(other.GetTriple()); - - arch_different = (me.getArch() != them.getArch()); - - vendor_different = (me.getVendor() != them.getVendor()); - - os_different = (me.getOS() != them.getOS()); - - os_version_different = (me.getOSMajorVersion() != them.getOSMajorVersion()); - - env_different = (me.getEnvironment() != them.getEnvironment()); -} - -bool ArchSpec::IsAlwaysThumbInstructions() const { - std::string Status; - if (GetTriple().getArch() == llvm::Triple::arm || - GetTriple().getArch() == llvm::Triple::thumb) { - // v. https://en.wikipedia.org/wiki/ARM_Cortex-M - // - // Cortex-M0 through Cortex-M7 are ARM processor cores which can only - // execute thumb instructions. We map the cores to arch names like this: - // - // Cortex-M0, Cortex-M0+, Cortex-M1: armv6m - // Cortex-M3: armv7m - // Cortex-M4, Cortex-M7: armv7em - - if (GetCore() == ArchSpec::Core::eCore_arm_armv7m || - GetCore() == ArchSpec::Core::eCore_arm_armv7em || - GetCore() == ArchSpec::Core::eCore_arm_armv6m) { - return true; - } - } - return false; -} - -void ArchSpec::DumpTriple(Stream &s) const { - const llvm::Triple &triple = GetTriple(); - llvm::StringRef arch_str = triple.getArchName(); - llvm::StringRef vendor_str = triple.getVendorName(); - llvm::StringRef os_str = triple.getOSName(); - llvm::StringRef environ_str = triple.getEnvironmentName(); - - s.Printf("%s-%s-%s", arch_str.empty() ? "*" : arch_str.str().c_str(), - vendor_str.empty() ? "*" : vendor_str.str().c_str(), - os_str.empty() ? "*" : os_str.str().c_str()); - - if (!environ_str.empty()) - s.Printf("-%s", environ_str.str().c_str()); -} diff --git a/gnu/llvm/tools/lldb/source/Utility/TaskPool.cpp b/gnu/llvm/tools/lldb/source/Utility/TaskPool.cpp deleted file mode 100644 index d33f23cd861..00000000000 --- a/gnu/llvm/tools/lldb/source/Utility/TaskPool.cpp +++ /dev/null @@ -1,98 +0,0 @@ -//===--------------------- TaskPool.cpp -------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Utility/TaskPool.h" - -#include <cstdint> // for uint32_t -#include <queue> // for queue -#include <thread> // for thread - -namespace { -class TaskPoolImpl { -public: - static TaskPoolImpl &GetInstance(); - - void AddTask(std::function<void()> &&task_fn); - -private: - TaskPoolImpl(); - - static void Worker(TaskPoolImpl *pool); - - std::queue<std::function<void()>> m_tasks; - std::mutex m_tasks_mutex; - uint32_t m_thread_count; -}; - -} // end of anonymous namespace - -TaskPoolImpl &TaskPoolImpl::GetInstance() { - static TaskPoolImpl g_task_pool_impl; - return g_task_pool_impl; -} - -void TaskPool::AddTaskImpl(std::function<void()> &&task_fn) { - TaskPoolImpl::GetInstance().AddTask(std::move(task_fn)); -} - -TaskPoolImpl::TaskPoolImpl() : m_thread_count(0) {} - -void TaskPoolImpl::AddTask(std::function<void()> &&task_fn) { - static const uint32_t max_threads = std::thread::hardware_concurrency(); - - std::unique_lock<std::mutex> lock(m_tasks_mutex); - m_tasks.emplace(std::move(task_fn)); - if (m_thread_count < max_threads) { - m_thread_count++; - // Note that this detach call needs to happen with the m_tasks_mutex held. - // This prevents the thread - // from exiting prematurely and triggering a linux libc bug - // (https://sourceware.org/bugzilla/show_bug.cgi?id=19951). - std::thread(Worker, this).detach(); - } -} - -void TaskPoolImpl::Worker(TaskPoolImpl *pool) { - while (true) { - std::unique_lock<std::mutex> lock(pool->m_tasks_mutex); - if (pool->m_tasks.empty()) { - pool->m_thread_count--; - break; - } - - std::function<void()> f = pool->m_tasks.front(); - pool->m_tasks.pop(); - lock.unlock(); - - f(); - } -} - -void TaskMapOverInt(size_t begin, size_t end, - const llvm::function_ref<void(size_t)> &func) { - std::atomic<size_t> idx{begin}; - size_t num_workers = - std::min<size_t>(end, std::thread::hardware_concurrency()); - - auto wrapper = [&idx, end, &func]() { - while (true) { - size_t i = idx.fetch_add(1); - if (i >= end) - break; - func(i); - } - }; - - std::vector<std::future<void>> futures; - futures.reserve(num_workers); - for (size_t i = 0; i < num_workers; i++) - futures.push_back(TaskPool::AddTask(wrapper)); - for (size_t i = 0; i < num_workers; i++) - futures[i].wait(); -} diff --git a/gnu/llvm/tools/lldb/tools/intel-mpx/CMakeLists.txt b/gnu/llvm/tools/lldb/tools/intel-mpx/CMakeLists.txt deleted file mode 100644 index 29ba9a1cace..00000000000 --- a/gnu/llvm/tools/lldb/tools/intel-mpx/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -if (NOT CMAKE_SYSTEM_NAME MATCHES "Linux") - return () -endif () - -include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake) - -add_library(lldb-intel-mpxtable SHARED - IntelMPXTablePlugin.cpp - ) - -target_link_libraries(lldb-intel-mpxtable - PUBLIC liblldb LLVMSupport) - -install(TARGETS lldb-intel-mpxtable - LIBRARY DESTINATION bin) diff --git a/gnu/llvm/tools/lldb/tools/intel-mpx/IntelMPXTablePlugin.cpp b/gnu/llvm/tools/lldb/tools/intel-mpx/IntelMPXTablePlugin.cpp deleted file mode 100644 index 0f86ce661de..00000000000 --- a/gnu/llvm/tools/lldb/tools/intel-mpx/IntelMPXTablePlugin.cpp +++ /dev/null @@ -1,427 +0,0 @@ -//===-- IntelMPXTablePlugin.cpp----------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// C++ includes -#include <cerrno> -#include <string> - -// Project includes -#include "lldb/API/SBCommandInterpreter.h" -#include "lldb/API/SBCommandReturnObject.h" -#include "lldb/API/SBMemoryRegionInfo.h" -#include "lldb/API/SBProcess.h" -#include "lldb/API/SBTarget.h" -#include "lldb/API/SBThread.h" - -#include "llvm/ADT/Triple.h" - -namespace lldb { -bool PluginInitialize(lldb::SBDebugger debugger); -} - -static bool GetPtr(char *cptr, uint64_t &ptr, lldb::SBFrame &frame, - lldb::SBCommandReturnObject &result) { - if (!cptr) { - result.SetError("Bad argument."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - lldb::SBValue ptr_addr = frame.GetValueForVariablePath(cptr); - if (!ptr_addr.IsValid()) { - result.SetError("Invalid pointer."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - ptr = ptr_addr.GetLoadAddress(); - return true; -} - -enum { - mpx_base_mask_64 = ~(uint64_t)0xFFFULL, - mpx_bd_mask_64 = 0xFFFFFFF00000ULL, - bd_r_shift_64 = 20, - bd_l_shift_64 = 3, - bt_r_shift_64 = 3, - bt_l_shift_64 = 5, - bt_mask_64 = 0x0000000FFFF8ULL, - - mpx_base_mask_32 = 0xFFFFFFFFFFFFF000ULL, - mpx_bd_mask_32 = 0xFFFFF000ULL, - bd_r_shift_32 = 12, - bd_l_shift_32 = 2, - bt_r_shift_32 = 2, - bt_l_shift_32 = 4, - bt_mask_32 = 0x00000FFCULL, -}; - -static void PrintBTEntry(lldb::addr_t lbound, lldb::addr_t ubound, - uint64_t value, uint64_t meta, - lldb::SBCommandReturnObject &result) { - const lldb::addr_t one_cmpl64 = ~((lldb::addr_t)0); - const lldb::addr_t one_cmpl32 = ~((uint32_t)0); - - if ((lbound == one_cmpl64 || one_cmpl32) && ubound == 0) { - result.Printf("Null bounds on map: pointer value = 0x%lx\n", value); - } else { - result.Printf(" lbound = 0x%lx,", lbound); - result.Printf(" ubound = 0x%lx", ubound); - result.Printf(" (pointer value = 0x%lx,", value); - result.Printf(" metadata = 0x%lx)\n", meta); - } -} - -static bool GetBTEntryAddr(uint64_t bndcfgu, uint64_t ptr, - lldb::SBTarget &target, llvm::Triple::ArchType arch, - size_t &size, lldb::addr_t &bt_entry_addr, - lldb::SBCommandReturnObject &result, - lldb::SBError &error) { - lldb::addr_t mpx_base_mask; - lldb::addr_t mpx_bd_mask; - lldb::addr_t bd_r_shift; - lldb::addr_t bd_l_shift; - lldb::addr_t bt_r_shift; - lldb::addr_t bt_l_shift; - lldb::addr_t bt_mask; - - if (arch == llvm::Triple::ArchType::x86_64) { - mpx_base_mask = mpx_base_mask_64; - mpx_bd_mask = mpx_bd_mask_64; - bd_r_shift = bd_r_shift_64; - bd_l_shift = bd_l_shift_64; - bt_r_shift = bt_r_shift_64; - bt_l_shift = bt_l_shift_64; - bt_mask = bt_mask_64; - } else if (arch == llvm::Triple::ArchType::x86) { - mpx_base_mask = mpx_base_mask_32; - mpx_bd_mask = mpx_bd_mask_32; - bd_r_shift = bd_r_shift_32; - bd_l_shift = bd_l_shift_32; - bt_r_shift = bt_r_shift_32; - bt_l_shift = bt_l_shift_32; - bt_mask = bt_mask_32; - } else { - result.SetError("Invalid arch."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - size = target.GetAddressByteSize(); - lldb::addr_t mpx_bd_base = bndcfgu & mpx_base_mask; - lldb::addr_t bd_entry_offset = ((ptr & mpx_bd_mask) >> bd_r_shift) - << bd_l_shift; - lldb::addr_t bd_entry_addr = mpx_bd_base + bd_entry_offset; - - std::vector<uint8_t> bd_entry_v(size); - size_t ret = target.GetProcess().ReadMemory( - bd_entry_addr, static_cast<void *>(bd_entry_v.data()), size, error); - if (ret != size || !error.Success()) { - result.SetError("Failed access to BD entry."); - return false; - } - - lldb::SBData data; - data.SetData(error, bd_entry_v.data(), bd_entry_v.size(), - target.GetByteOrder(), size); - lldb::addr_t bd_entry = data.GetAddress(error, 0); - - if (!error.Success()) { - result.SetError("Failed access to BD entry."); - return false; - } - - if ((bd_entry & 0x01) == 0) { - result.SetError("Invalid bound directory."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - // Clear status bit. - // - bd_entry--; - - lldb::addr_t bt_addr = bd_entry & ~bt_r_shift; - lldb::addr_t bt_entry_offset = ((ptr & bt_mask) >> bt_r_shift) << bt_l_shift; - bt_entry_addr = bt_addr + bt_entry_offset; - - return true; -} - -static bool GetBTEntry(uint64_t bndcfgu, uint64_t ptr, lldb::SBTarget &target, - llvm::Triple::ArchType arch, - lldb::SBCommandReturnObject &result, - lldb::SBError &error) { - lldb::addr_t bt_entry_addr; - size_t size; - if (!GetBTEntryAddr(bndcfgu, ptr, target, arch, size, bt_entry_addr, result, - error)) - return false; - - // bt_entry_v must have space to store the 4 elements of the BT entry (lower - // boundary, - // upper boundary, pointer value and meta data), which all have the same size - // 'size'. - // - std::vector<uint8_t> bt_entry_v(size * 4); - size_t ret = target.GetProcess().ReadMemory( - bt_entry_addr, static_cast<void *>(bt_entry_v.data()), size * 4, error); - - if ((ret != (size * 4)) || !error.Success()) { - result.SetError("Unsuccessful. Failed access to BT entry."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - lldb::addr_t lbound; - lldb::addr_t ubound; - uint64_t value; - uint64_t meta; - lldb::SBData data; - data.SetData(error, bt_entry_v.data(), bt_entry_v.size(), - target.GetByteOrder(), size); - lbound = data.GetAddress(error, size * 0); - ubound = data.GetAddress(error, size * 1); - value = data.GetAddress(error, size * 2); - meta = data.GetAddress(error, size * 3); - // ubound is stored as one's complement. - if (arch == llvm::Triple::ArchType::x86) { - ubound = (~ubound) & 0x00000000FFFFFFFF; - } else { - ubound = ~ubound; - } - - if (!error.Success()) { - result.SetError("Failed access to BT entry."); - return false; - } - - PrintBTEntry(lbound, ubound, value, meta, result); - - result.SetStatus(lldb::eReturnStatusSuccessFinishResult); - return true; -} - -static std::vector<uint8_t> uIntToU8(uint64_t input, size_t size) { - std::vector<uint8_t> output; - for (size_t i = 0; i < size; i++) - output.push_back( - static_cast<uint8_t>((input & (0xFFULL << (i * 8))) >> (i * 8))); - - return output; -} - -static bool SetBTEntry(uint64_t bndcfgu, uint64_t ptr, lldb::addr_t lbound, - lldb::addr_t ubound, lldb::SBTarget &target, - llvm::Triple::ArchType arch, - lldb::SBCommandReturnObject &result, - lldb::SBError &error) { - lldb::addr_t bt_entry_addr; - size_t size; - - if (!GetBTEntryAddr(bndcfgu, ptr, target, arch, size, bt_entry_addr, result, - error)) - return false; - - // bt_entry_v must have space to store only 2 elements of the BT Entry, the - // lower boundary and the upper boundary, which both have size 'size'. - // - std::vector<uint8_t> bt_entry_v(size * 2); - - std::vector<uint8_t> lbound_v = uIntToU8(lbound, size); - bt_entry_v.insert(bt_entry_v.begin(), lbound_v.begin(), lbound_v.end()); - std::vector<uint8_t> ubound_v = uIntToU8(~ubound, size); - bt_entry_v.insert(bt_entry_v.begin() + size, ubound_v.begin(), - ubound_v.end()); - - size_t ret = target.GetProcess().WriteMemory( - bt_entry_addr, (void *)(bt_entry_v.data()), size * 2, error); - if ((ret != (size * 2)) || !error.Success()) { - result.SetError("Failed access to BT entry."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - result.SetStatus(lldb::eReturnStatusSuccessFinishResult); - return true; -} - -static bool GetInitInfo(lldb::SBDebugger debugger, lldb::SBTarget &target, - llvm::Triple::ArchType &arch, uint64_t &bndcfgu, - char *arg, uint64_t &ptr, - lldb::SBCommandReturnObject &result, - lldb::SBError &error) { - target = debugger.GetSelectedTarget(); - if (!target.IsValid()) { - result.SetError("Invalid target."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - const std::string triple_s(target.GetTriple()); - const llvm::Triple triple(triple_s); - - arch = triple.getArch(); - - if ((arch != llvm::Triple::ArchType::x86) && - (arch != llvm::Triple::ArchType::x86_64)) { - result.SetError("Platform not supported."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - lldb::SBFrame frame = - target.GetProcess().GetSelectedThread().GetSelectedFrame(); - if (!frame.IsValid()) { - result.SetError("No valid process, thread or frame."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - lldb::SBValue bndcfgu_val = frame.FindRegister("bndcfgu"); - if (!bndcfgu_val.IsValid()) { - result.SetError( - "Cannot access register BNDCFGU. Does the target support MPX?"); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - lldb::SBData bndcfgu_data = bndcfgu_val.GetData(); - bndcfgu = bndcfgu_data.GetUnsignedInt64(error, 0); - if (!error.Success()) { - result.SetError(error, "Invalid read of register BNDCFGU."); - return false; - } - - if (!GetPtr(arg, ptr, frame, result)) - return false; - - return true; -} - -class MPXTableShow : public lldb::SBCommandPluginInterface { -public: - virtual bool DoExecute(lldb::SBDebugger debugger, char **command, - lldb::SBCommandReturnObject &result) { - - if (command) { - int arg_c = 0; - char *arg; - - while (*command) { - if (arg_c >= 1) { - result.SetError("Too many arguments. See help."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - arg_c++; - arg = *command; - command++; - } - - if (!debugger.IsValid()) { - result.SetError("Invalid debugger."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } - - lldb::SBTarget target; - llvm::Triple::ArchType arch; - lldb::SBError error; - uint64_t bndcfgu; - uint64_t ptr; - - if (!GetInitInfo(debugger, target, arch, bndcfgu, arg, ptr, result, - error)) - return false; - - return GetBTEntry(bndcfgu, ptr, target, arch, result, error); - } - - result.SetError("Too few arguments. See help."); - result.SetStatus(lldb::eReturnStatusFailed); - return false; - } -}; - -class MPXTableSet : public lldb::SBCommandPluginInterface { -public: - virtual bool DoExecute(lldb::SBDebugger debugger, char **command, - lldb::SBCommandReturnObject &result) { - - if (command) { - int arg_c = 0; - char *arg[3]; - - while (*command) { - arg[arg_c] = *command; - command++; - arg_c++; - } - - if (arg_c != 3) { - result.SetError("Wrong arguments. See help."); - return false; - } - - if (!debugger.IsValid()) { - result.SetError("Invalid debugger."); - return false; - } - - lldb::SBTarget target; - llvm::Triple::ArchType arch; - lldb::SBError error; - uint64_t bndcfgu; - uint64_t ptr; - - if (!GetInitInfo(debugger, target, arch, bndcfgu, arg[0], ptr, result, - error)) - return false; - - char *endptr; - errno = 0; - uint64_t lbound = std::strtoul(arg[1], &endptr, 16); - if (endptr == arg[1] || errno == ERANGE) { - result.SetError("Lower Bound: bad argument format."); - errno = 0; - return false; - } - - uint64_t ubound = std::strtoul(arg[2], &endptr, 16); - if (endptr == arg[1] || errno == ERANGE) { - result.SetError("Upper Bound: bad argument format."); - errno = 0; - return false; - } - - return SetBTEntry(bndcfgu, ptr, lbound, ubound, target, arch, result, - error); - } - - result.SetError("Too few arguments. See help."); - return false; - } -}; - -bool lldb::PluginInitialize(lldb::SBDebugger debugger) { - lldb::SBCommandInterpreter interpreter = debugger.GetCommandInterpreter(); - lldb::SBCommand mpxTable = interpreter.AddMultiwordCommand( - "mpx-table", "A utility to access the MPX table entries."); - - const char *mpx_show_help = "Show the MPX table entry of a pointer.\n" - "mpx-table show <pointer>"; - mpxTable.AddCommand("show", new MPXTableShow(), mpx_show_help); - - const char *mpx_set_help = - "Set the MPX table entry of a pointer.\n" - "mpx-table set <pointer> <lower bound> <upper bound>"; - mpxTable.AddCommand("set", new MPXTableSet(), mpx_set_help); - - return true; -} diff --git a/gnu/llvm/tools/lldb/tools/intel-mpx/test/Makefile b/gnu/llvm/tools/lldb/tools/intel-mpx/test/Makefile deleted file mode 100644 index b18044407a7..00000000000 --- a/gnu/llvm/tools/lldb/tools/intel-mpx/test/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -LEVEL = ../../../../make - -CXX_SOURCES := main.cpp - -CFLAGS_EXTRAS += -mmpx -fcheck-pointer-bounds -lmpxwrappers -lmpx -fuse-ld=bfd - -include $(LEVEL)/Makefile.rules diff --git a/gnu/llvm/tools/lldb/tools/intel-mpx/test/README.txt b/gnu/llvm/tools/lldb/tools/intel-mpx/test/README.txt deleted file mode 100644 index 314e78d3e0e..00000000000 --- a/gnu/llvm/tools/lldb/tools/intel-mpx/test/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -In order to run this test, create the following directory: - - packages/Python/lldbsuite/test/functionalities/plugins/commands/mpxtablecmd - -and copy into it the contents of this direcotry. - diff --git a/gnu/llvm/tools/lldb/tools/intel-mpx/test/TestMPXTable.py b/gnu/llvm/tools/lldb/tools/intel-mpx/test/TestMPXTable.py deleted file mode 100644 index f2468abd59a..00000000000 --- a/gnu/llvm/tools/lldb/tools/intel-mpx/test/TestMPXTable.py +++ /dev/null @@ -1,168 +0,0 @@ -""" -Test mpx-table command. -""" - -from __future__ import print_function - - -import os -import time -import re -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class TestMPXTable(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - def setUp(self): - TestBase.setUp(self) - - @skipIf(compiler="clang") - @skipIf(oslist=no_match(['linux'])) - @skipIf(archs=no_match(['i386', 'x86_64'])) - @skipIf(compiler="gcc", compiler_version=["<", "5"]) #GCC version >= 5 supports Intel(R) MPX. - def test_show_command(self): - """Test 'mpx-table show' command""" - self.build() - - lldb_exec_dir = os.environ["LLDB_IMPLIB_DIR"] - lldb_lib_dir = os.path.join(lldb_exec_dir, os.pardir, "lib") - plugin_file = os.path.join(lldb_lib_dir, "liblldb-intel-mpxtable.so") - if not os.path.isfile(plugin_file): - self.skipTest("Intel(R) mpx-table plugin missing.") - plugin_command = " " - seq = ("plugin", "load", plugin_file) - plugin_command = plugin_command.join(seq) - self.runCmd(plugin_command) - - exe = os.path.join(os.getcwd(), "a.out") - self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) - - self.b1 = line_number('main.cpp', '// Break 1.') - self.b2 = line_number('main.cpp', '// Break 2.') - self.b3 = line_number('main.cpp', '// Break 3.') - self.b4 = line_number('main.cpp', '// Break 4.') - lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.b1, num_expected_locations=1) - lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.b2, num_expected_locations=1) - lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.b3, num_expected_locations=1) - lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.b4, num_expected_locations=1) - self.runCmd("run", RUN_SUCCEEDED) - - target = self.dbg.GetSelectedTarget() - process = target.GetProcess() - - if (process.GetState() == lldb.eStateExited): - self.skipTest("Intel(R) MPX is not supported.") - else: - self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT, - substrs = ["stop reason = breakpoint 1."]) - - self.expect("mpx-table show a", - substrs = ['lbound = 0x', - ', ubound = 0x', - '(pointer value = 0x', - ', metadata = 0x', - ')'], - error = False) - - self.expect("continue", STOPPED_DUE_TO_BREAKPOINT, - substrs = ["stop reason = breakpoint 2."]) - - # Check that out of scope pointer cannot be reached. - # - self.expect("mpx-table show a", - substrs = ['Invalid pointer.'], - error = True) - - self.expect("mpx-table show tmp", - substrs = ['lbound = 0x', - ', ubound = 0x', - '(pointer value = 0x', - ', metadata = 0x', - ')'], - error = False) - - self.expect("continue", STOPPED_DUE_TO_BREAKPOINT, - substrs = ["stop reason = breakpoint 3."]) - - # Check that the pointer value is correctly updated. - # - self.expect("mpx-table show tmp", - substrs = ['lbound = 0x', - ', ubound = 0x', - '(pointer value = 0x2', - ', metadata = 0x', - ')'], - error = False) - - self.expect("continue", STOPPED_DUE_TO_BREAKPOINT, - substrs = ["stop reason = breakpoint 4."]) - - # After going back to main(), check that out of scope pointer cannot be - # reached. - # - self.expect("mpx-table show tmp", - substrs = ['Invalid pointer.'], - error = True) - - self.expect("mpx-table show a", - substrs = ['lbound = 0x', - ', ubound = 0x', - '(pointer value = 0x', - ', metadata = 0x', - ')'], - error = False) - - def test_set_command(self): - """Test 'mpx-table set' command""" - self.build() - - lldb_exec_dir = os.environ["LLDB_IMPLIB_DIR"] - lldb_lib_dir = os.path.join(lldb_exec_dir, os.pardir, "lib") - plugin_file = os.path.join(lldb_lib_dir, "liblldb-intel-mpxtable.so") - if not os.path.isfile(plugin_file): - self.skipTest("Intel(R) mpx-table plugin missing.") - plugin_command = " " - seq = ("plugin", "load", plugin_file) - plugin_command = plugin_command.join(seq) - self.runCmd(plugin_command) - - exe = os.path.join(os.getcwd(), "a.out") - self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) - - self.b1 = line_number('main.cpp', '// Break 1.') - lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.b1, num_expected_locations=1) - self.runCmd("run", RUN_SUCCEEDED) - - target = self.dbg.GetSelectedTarget() - process = target.GetProcess() - - if (process.GetState() == lldb.eStateExited): - self.skipTest("Intel(R) MPX is not supported.") - else: - self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT, - substrs = ["stop reason = breakpoint 1."]) - - # Check that the BT Entry doesn't already contain the test values. - # - self.expect("mpx-table show a", matching=False, - substrs = ['lbound = 0xcafecafe', - ', ubound = 0xbeefbeef']) - - # Set the test values. - # - self.expect("mpx-table set a 0xcafecafe 0xbeefbeef", error = False) - - # Verify that the test values have been correctly written in the BT - # entry. - # - self.expect("mpx-table show a", - substrs = ['lbound = 0xcafecafe', - ', ubound = 0xbeefbeef'], - error = False) - - diff --git a/gnu/llvm/tools/lldb/tools/intel-mpx/test/main.cpp b/gnu/llvm/tools/lldb/tools/intel-mpx/test/main.cpp deleted file mode 100644 index 214332338d8..00000000000 --- a/gnu/llvm/tools/lldb/tools/intel-mpx/test/main.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//===-- main.cpp ------------------------------------------------*- C++ -*-===// -//// -//// The LLVM Compiler Infrastructure -//// -//// This file is distributed under the University of Illinois Open Source -//// License. See LICENSE.TXT for details. -//// -////===----------------------------------------------------------------------===// -// - -const int size = 5; - -#include <cstddef> -#include <cstdlib> -#include <sys/prctl.h> - -void func(int *ptr) { - int *tmp; - -#if defined __GNUC__ && !defined __INTEL_COMPILER - __builtin___bnd_store_ptr_bounds ((void**)&ptr, ptr); -#endif - tmp = ptr + size - 1; -#if defined __GNUC__ && !defined __INTEL_COMPILER - __builtin___bnd_store_ptr_bounds ((void**)&tmp, tmp); -#endif - tmp = (int*)0x2; // Break 2. - - return; // Break 3. -} - -int -main(int argc, char const *argv[]) -{ - // This call returns 0 only if the CPU and the kernel support Intel(R) MPX. - if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0) - return -1; - - int* a = (int *) calloc(size, sizeof(int)); -#if defined __GNUC__ && !defined __INTEL_COMPILER - __builtin___bnd_store_ptr_bounds ((void**)&a, a); -#endif - func(a); // Break 1. - - free(a); // Break 4. - - return 0; -} diff --git a/gnu/llvm/tools/lldb/unittests/Core/ArchSpecTest.cpp b/gnu/llvm/tools/lldb/unittests/Core/ArchSpecTest.cpp deleted file mode 100644 index 98b77e1826b..00000000000 --- a/gnu/llvm/tools/lldb/unittests/Core/ArchSpecTest.cpp +++ /dev/null @@ -1,155 +0,0 @@ -//===-- ArchSpecTest.cpp ----------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "gtest/gtest.h" - -#include "lldb/Core/ArchSpec.h" - -#include "llvm/BinaryFormat/MachO.h" - -using namespace lldb; -using namespace lldb_private; - -TEST(ArchSpecTest, TestParseMachCPUDashSubtypeTripleSimple) { - - // Success conditions. Valid cpu/subtype combinations using both - and . - ArchSpec AS; - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("12-10", AS)); - EXPECT_EQ(12u, AS.GetMachOCPUType()); - EXPECT_EQ(10u, AS.GetMachOCPUSubType()); - - AS = ArchSpec(); - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("12-15", AS)); - EXPECT_EQ(12u, AS.GetMachOCPUType()); - EXPECT_EQ(15u, AS.GetMachOCPUSubType()); - - AS = ArchSpec(); - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("12.15", AS)); - EXPECT_EQ(12u, AS.GetMachOCPUType()); - EXPECT_EQ(15u, AS.GetMachOCPUSubType()); - - // Failure conditions. - - // Valid string, unknown cpu/subtype. - AS = ArchSpec(); - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("13.11", AS)); - EXPECT_EQ(0u, AS.GetMachOCPUType()); - EXPECT_EQ(0u, AS.GetMachOCPUSubType()); - - // Missing / invalid cpu or subtype - AS = ArchSpec(); - EXPECT_FALSE(ParseMachCPUDashSubtypeTriple("13", AS)); - - AS = ArchSpec(); - EXPECT_FALSE(ParseMachCPUDashSubtypeTriple("13.A", AS)); - - AS = ArchSpec(); - EXPECT_FALSE(ParseMachCPUDashSubtypeTriple("A.13", AS)); - - // Empty string. - AS = ArchSpec(); - EXPECT_FALSE(ParseMachCPUDashSubtypeTriple("", AS)); -} - -TEST(ArchSpecTest, TestParseMachCPUDashSubtypeTripleExtra) { - ArchSpec AS; - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("12-15-vendor-os", AS)); - EXPECT_EQ(12u, AS.GetMachOCPUType()); - EXPECT_EQ(15u, AS.GetMachOCPUSubType()); - EXPECT_EQ("vendor", AS.GetTriple().getVendorName()); - EXPECT_EQ("os", AS.GetTriple().getOSName()); - - AS = ArchSpec(); - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("12-10-vendor-os-name", AS)); - EXPECT_EQ(12u, AS.GetMachOCPUType()); - EXPECT_EQ(10u, AS.GetMachOCPUSubType()); - EXPECT_EQ("vendor", AS.GetTriple().getVendorName()); - EXPECT_EQ("os", AS.GetTriple().getOSName()); - - AS = ArchSpec(); - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("12-15-vendor.os-name", AS)); - EXPECT_EQ(12u, AS.GetMachOCPUType()); - EXPECT_EQ(15u, AS.GetMachOCPUSubType()); - EXPECT_EQ("vendor.os", AS.GetTriple().getVendorName()); - EXPECT_EQ("name", AS.GetTriple().getOSName()); - - // These there should parse correctly, but the vendor / OS should be defaulted - // since they are unrecognized. - AS = ArchSpec(); - EXPECT_TRUE(ParseMachCPUDashSubtypeTriple("12-10-vendor", AS)); - EXPECT_EQ(12u, AS.GetMachOCPUType()); - EXPECT_EQ(10u, AS.GetMachOCPUSubType()); - EXPECT_EQ("apple", AS.GetTriple().getVendorName()); - EXPECT_EQ("", AS.GetTriple().getOSName()); - - AS = ArchSpec(); - EXPECT_FALSE(ParseMachCPUDashSubtypeTriple("12.10.10", AS)); - - AS = ArchSpec(); - EXPECT_FALSE(ParseMachCPUDashSubtypeTriple("12-10.10", AS)); -} - -TEST(ArchSpecTest, TestSetTriple) { - ArchSpec AS; - - // Various flavors of valid triples. - EXPECT_TRUE(AS.SetTriple("12-10-apple-darwin")); - EXPECT_EQ(uint32_t(llvm::MachO::CPU_TYPE_ARM), AS.GetMachOCPUType()); - EXPECT_EQ(10u, AS.GetMachOCPUSubType()); - EXPECT_TRUE(llvm::StringRef(AS.GetTriple().str()) - .consume_front("armv7f-apple-darwin")); - EXPECT_EQ(ArchSpec::eCore_arm_armv7f, AS.GetCore()); - - AS = ArchSpec(); - EXPECT_TRUE(AS.SetTriple("18.100-apple-darwin")); - EXPECT_EQ(uint32_t(llvm::MachO::CPU_TYPE_POWERPC), AS.GetMachOCPUType()); - EXPECT_EQ(100u, AS.GetMachOCPUSubType()); - EXPECT_TRUE(llvm::StringRef(AS.GetTriple().str()) - .consume_front("powerpc-apple-darwin")); - EXPECT_EQ(ArchSpec::eCore_ppc_ppc970, AS.GetCore()); - - AS = ArchSpec(); - EXPECT_TRUE(AS.SetTriple("i686-pc-windows")); - EXPECT_EQ(llvm::Triple::x86, AS.GetTriple().getArch()); - EXPECT_EQ(llvm::Triple::PC, AS.GetTriple().getVendor()); - EXPECT_EQ(llvm::Triple::Win32, AS.GetTriple().getOS()); - EXPECT_TRUE( - llvm::StringRef(AS.GetTriple().str()).consume_front("i686-pc-windows")); - EXPECT_STREQ("i686", AS.GetArchitectureName()); - EXPECT_EQ(ArchSpec::eCore_x86_32_i686, AS.GetCore()); - - // Various flavors of invalid triples. - AS = ArchSpec(); - EXPECT_FALSE(AS.SetTriple("unknown-unknown-unknown")); - - AS = ArchSpec(); - EXPECT_FALSE(AS.SetTriple("unknown")); - - AS = ArchSpec(); - EXPECT_FALSE(AS.SetTriple("")); -} - -TEST(ArchSpecTest, MergeFrom) { - ArchSpec A; - ArchSpec B("x86_64-pc-linux"); - - EXPECT_FALSE(A.IsValid()); - ASSERT_TRUE(B.IsValid()); - EXPECT_EQ(llvm::Triple::ArchType::x86_64, B.GetTriple().getArch()); - EXPECT_EQ(llvm::Triple::VendorType::PC, B.GetTriple().getVendor()); - EXPECT_EQ(llvm::Triple::OSType::Linux, B.GetTriple().getOS()); - EXPECT_EQ(ArchSpec::eCore_x86_64_x86_64, B.GetCore()); - - A.MergeFrom(B); - ASSERT_TRUE(A.IsValid()); - EXPECT_EQ(llvm::Triple::ArchType::x86_64, A.GetTriple().getArch()); - EXPECT_EQ(llvm::Triple::VendorType::PC, A.GetTriple().getVendor()); - EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS()); - EXPECT_EQ(ArchSpec::eCore_x86_64_x86_64, A.GetCore()); -} diff --git a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/CMakeLists.txt b/gnu/llvm/tools/lldb/unittests/Utility/Helpers/CMakeLists.txt deleted file mode 100644 index 36c774cb682..00000000000 --- a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(EXCLUDE_FROM_ALL ON) -add_lldb_library(lldbUtilityHelpers - MockTildeExpressionResolver.cpp - TestUtilities.cpp - - LINK_LIBS - lldbUtility - - LINK_COMPONENTS - Support - ) diff --git a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/MockTildeExpressionResolver.cpp b/gnu/llvm/tools/lldb/unittests/Utility/Helpers/MockTildeExpressionResolver.cpp deleted file mode 100644 index 832836682b5..00000000000 --- a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/MockTildeExpressionResolver.cpp +++ /dev/null @@ -1,80 +0,0 @@ -//===----------------- MockTildeExpressionResolver.cpp ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "MockTildeExpressionResolver.h" -#include "llvm/Support/Path.h" - -using namespace lldb_private; -using namespace llvm; - -MockTildeExpressionResolver::MockTildeExpressionResolver(StringRef CurrentUser, - StringRef HomeDir) - : CurrentUser(CurrentUser) { - UserDirectories.insert(std::make_pair(CurrentUser, HomeDir)); -} - -void MockTildeExpressionResolver::AddKnownUser(StringRef User, - StringRef HomeDir) { - assert(UserDirectories.find(User) == UserDirectories.end()); - UserDirectories.insert(std::make_pair(User, HomeDir)); -} - -void MockTildeExpressionResolver::Clear() { - CurrentUser = StringRef(); - UserDirectories.clear(); -} - -void MockTildeExpressionResolver::SetCurrentUser(StringRef User) { - assert(UserDirectories.find(User) != UserDirectories.end()); - CurrentUser = User; -} - -bool MockTildeExpressionResolver::ResolveExact(StringRef Expr, - SmallVectorImpl<char> &Output) { - Output.clear(); - - assert(!llvm::any_of( - Expr, [](char c) { return llvm::sys::path::is_separator(c); })); - assert(Expr.empty() || Expr[0] == '~'); - Expr = Expr.drop_front(); - if (Expr.empty()) { - auto Dir = UserDirectories[CurrentUser]; - Output.append(Dir.begin(), Dir.end()); - return true; - } - - for (const auto &User : UserDirectories) { - if (User.getKey() != Expr) - continue; - Output.append(User.getValue().begin(), User.getValue().end()); - return true; - } - return false; -} - -bool MockTildeExpressionResolver::ResolvePartial(StringRef Expr, - StringSet<> &Output) { - Output.clear(); - - assert(!llvm::any_of( - Expr, [](char c) { return llvm::sys::path::is_separator(c); })); - assert(Expr.empty() || Expr[0] == '~'); - Expr = Expr.drop_front(); - - SmallString<16> QualifiedName("~"); - for (const auto &User : UserDirectories) { - if (!User.getKey().startswith(Expr)) - continue; - QualifiedName.resize(1); - QualifiedName.append(User.getKey().begin(), User.getKey().end()); - Output.insert(QualifiedName); - } - - return !Output.empty(); -} diff --git a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/MockTildeExpressionResolver.h b/gnu/llvm/tools/lldb/unittests/Utility/Helpers/MockTildeExpressionResolver.h deleted file mode 100644 index 18be1102e1f..00000000000 --- a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/MockTildeExpressionResolver.h +++ /dev/null @@ -1,37 +0,0 @@ -//===--------------------- TildeExpressionResolver.h ------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLDB_UNITTESTS_UTILITY_MOCKS_MOCK_TILDE_EXPRESSION_RESOLVER_H -#define LLDB_UNITTESTS_UTILITY_MOCKS_MOCK_TILDE_EXPRESSION_RESOLVER_H - -#include "lldb/Utility/TildeExpressionResolver.h" - -#include "llvm/ADT/SmallString.h" -#include "llvm/ADT/StringMap.h" - -namespace lldb_private { -class MockTildeExpressionResolver : public TildeExpressionResolver { - llvm::StringRef CurrentUser; - llvm::StringMap<llvm::StringRef> UserDirectories; - -public: - MockTildeExpressionResolver(llvm::StringRef CurrentUser, - llvm::StringRef HomeDir); - - void AddKnownUser(llvm::StringRef User, llvm::StringRef HomeDir); - void Clear(); - void SetCurrentUser(llvm::StringRef User); - - bool ResolveExact(llvm::StringRef Expr, - llvm::SmallVectorImpl<char> &Output) override; - bool ResolvePartial(llvm::StringRef Expr, llvm::StringSet<> &Output) override; -}; -} // namespace lldb_private - -#endif diff --git a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/TestUtilities.cpp b/gnu/llvm/tools/lldb/unittests/Utility/Helpers/TestUtilities.cpp deleted file mode 100644 index eacf8766142..00000000000 --- a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/TestUtilities.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===- TestUtilities.cpp ----------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "TestUtilities.h" -#include "llvm/ADT/SmallString.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/Path.h" - -extern const char *TestMainArgv0; - -std::string lldb_private::GetInputFilePath(const llvm::Twine &name) { - llvm::SmallString<128> result = llvm::sys::path::parent_path(TestMainArgv0); - llvm::sys::fs::make_absolute(result); - llvm::sys::path::append(result, "Inputs", name); - return result.str(); -} diff --git a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/TestUtilities.h b/gnu/llvm/tools/lldb/unittests/Utility/Helpers/TestUtilities.h deleted file mode 100644 index 8d848797b7b..00000000000 --- a/gnu/llvm/tools/lldb/unittests/Utility/Helpers/TestUtilities.h +++ /dev/null @@ -1,20 +0,0 @@ -//===- TestUtilities.h ------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLDB_UNITTESTS_UTILITY_HELPERS_TESTUTILITIES_H -#define LLDB_UNITTESTS_UTILITY_HELPERS_TESTUTILITIES_H - -#include "llvm/ADT/Twine.h" -#include <string> - -namespace lldb_private { -std::string GetInputFilePath(const llvm::Twine &name); -} - -#endif diff --git a/gnu/llvm/tools/lldb/unittests/Utility/TaskPoolTest.cpp b/gnu/llvm/tools/lldb/unittests/Utility/TaskPoolTest.cpp deleted file mode 100644 index e340a81b27d..00000000000 --- a/gnu/llvm/tools/lldb/unittests/Utility/TaskPoolTest.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "gtest/gtest.h" - -#include "lldb/Utility/TaskPool.h" - -TEST(TaskPoolTest, AddTask) { - auto fn = [](int x) { return x * x + 1; }; - - auto f1 = TaskPool::AddTask(fn, 1); - auto f2 = TaskPool::AddTask(fn, 2); - auto f3 = TaskPool::AddTask(fn, 3); - auto f4 = TaskPool::AddTask(fn, 4); - - ASSERT_EQ(10, f3.get()); - ASSERT_EQ(2, f1.get()); - ASSERT_EQ(17, f4.get()); - ASSERT_EQ(5, f2.get()); -} - -TEST(TaskPoolTest, RunTasks) { - std::vector<int> r(4); - - auto fn = [](int x, int &y) { y = x * x + 1; }; - - TaskPool::RunTasks([fn, &r]() { fn(1, r[0]); }, [fn, &r]() { fn(2, r[1]); }, - [fn, &r]() { fn(3, r[2]); }, [fn, &r]() { fn(4, r[3]); }); - - ASSERT_EQ(2, r[0]); - ASSERT_EQ(5, r[1]); - ASSERT_EQ(10, r[2]); - ASSERT_EQ(17, r[3]); -} - -TEST(TaskPoolTest, TaskMap) { - int data[4]; - auto fn = [&data](int x) { data[x] = x * x; }; - - TaskMapOverInt(0, 4, fn); - - ASSERT_EQ(data[0], 0); - ASSERT_EQ(data[1], 1); - ASSERT_EQ(data[2], 4); - ASSERT_EQ(data[3], 9); -} diff --git a/gnu/llvm/tools/llvm-pdbutil/fuzzer/CMakeLists.txt b/gnu/llvm/tools/llvm-pdbutil/fuzzer/CMakeLists.txt deleted file mode 100644 index 6af00476577..00000000000 --- a/gnu/llvm/tools/llvm-pdbutil/fuzzer/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(LLVM_LINK_COMPONENTS - DebugInfoCodeView - DebugInfoPDB - Object - Support - ) - -add_llvm_executable(llvm-pdbutil-fuzzer - EXCLUDE_FROM_ALL - llvm-pdbutil-fuzzer.cpp - ) - -target_link_libraries(llvm-pdbutil-fuzzer - LLVMFuzzer - ) diff --git a/gnu/llvm/tools/llvm-pdbutil/fuzzer/llvm-pdbutil-fuzzer.cpp b/gnu/llvm/tools/llvm-pdbutil/fuzzer/llvm-pdbutil-fuzzer.cpp deleted file mode 100644 index 4edb53e261f..00000000000 --- a/gnu/llvm/tools/llvm-pdbutil/fuzzer/llvm-pdbutil-fuzzer.cpp +++ /dev/null @@ -1,105 +0,0 @@ -//===-- llvm-pdbutil-fuzzer.cpp - Fuzz the llvm-pdbutil tool --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief This file implements a function that runs llvm-pdbutil -/// on a single input. This function is then linked into the Fuzzer library. -/// -//===----------------------------------------------------------------------===// -#include "llvm/ADT/STLExtras.h" -#include "llvm/DebugInfo/CodeView/BinaryByteStream.h" -#include "llvm/DebugInfo/CodeView/SymbolDumper.h" -#include "llvm/DebugInfo/CodeView/TypeDumper.h" -#include "llvm/DebugInfo/PDB/Raw/DbiStream.h" -#include "llvm/DebugInfo/PDB/Raw/IPDBStreamData.h" -#include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h" -#include "llvm/DebugInfo/PDB/Raw/ModuleDebugStream.h" -#include "llvm/DebugInfo/PDB/Raw/PDBFile.h" -#include "llvm/DebugInfo/PDB/Raw/RawSession.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/ScopedPrinter.h" - -using namespace llvm; - -namespace { -// We need a class which behaves like an immutable BinaryByteStream, but whose -// data -// is backed by an llvm::MemoryBuffer. It also needs to own the underlying -// MemoryBuffer, so this simple adapter is a good way to achieve that. -class InputByteStream : public codeview::BinaryByteStream<false> { -public: - explicit InputByteStream(std::unique_ptr<MemoryBuffer> Buffer) - : BinaryByteStream(ArrayRef<uint8_t>(Buffer->getBuffer().bytes_begin(), - Buffer->getBuffer().bytes_end())), - MemBuffer(std::move(Buffer)) {} - - std::unique_ptr<MemoryBuffer> MemBuffer; -}; -} - -extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { - std::unique_ptr<MemoryBuffer> Buff = MemoryBuffer::getMemBuffer( - StringRef((const char *)data, size), "", false); - - ScopedPrinter P(nulls()); - codeview::CVTypeDumper TD(&P, false); - - auto InputStream = llvm::make_unique<InputByteStream>(std::move(Buff)); - std::unique_ptr<pdb::PDBFile> File(new pdb::PDBFile(std::move(InputStream))); - if (auto E = File->parseFileHeaders()) { - consumeError(std::move(E)); - return 0; - } - if (auto E = File->parseStreamData()) { - consumeError(std::move(E)); - return 0; - } - - auto DbiS = File->getPDBDbiStream(); - if (auto E = DbiS.takeError()) { - consumeError(std::move(E)); - return 0; - } - auto TpiS = File->getPDBTpiStream(); - if (auto E = TpiS.takeError()) { - consumeError(std::move(E)); - return 0; - } - auto IpiS = File->getPDBIpiStream(); - if (auto E = IpiS.takeError()) { - consumeError(std::move(E)); - return 0; - } - auto InfoS = File->getPDBInfoStream(); - if (auto E = InfoS.takeError()) { - consumeError(std::move(E)); - return 0; - } - pdb::DbiStream &DS = DbiS.get(); - - for (auto &Modi : DS.modules()) { - auto ModStreamData = pdb::MappedBlockStream::createIndexedStream( - Modi.Info.getModuleStreamIndex(), *File, File->getAllocator()); - if (!ModStreamData) { - consumeError(ModStreamData.takeError()); - return 0; - } - pdb::ModuleDebugStreamRef ModS(Modi.Info, std::move(*ModStreamData)); - if (auto E = ModS.reload()) { - consumeError(std::move(E)); - return 0; - } - codeview::CVSymbolDumper SD(P, TD, nullptr, false); - bool HadError = false; - for (auto &S : ModS.symbols(&HadError)) { - SD.dump(S); - } - } - return 0; -} diff --git a/gnu/llvm/tools/llvm-xray/xray-record-yaml.h b/gnu/llvm/tools/llvm-xray/xray-record-yaml.h deleted file mode 100644 index abce8ff60a9..00000000000 --- a/gnu/llvm/tools/llvm-xray/xray-record-yaml.h +++ /dev/null @@ -1,102 +0,0 @@ -//===- xray-record-yaml.h - XRay Record YAML Support Definitions ----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Types and traits specialisations for YAML I/O of XRay log entries. -// -//===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_XRAY_XRAY_RECORD_YAML_H -#define LLVM_TOOLS_LLVM_XRAY_XRAY_RECORD_YAML_H - -#include <type_traits> - -#include "xray-record.h" -#include "llvm/Support/YAMLTraits.h" - -namespace llvm { -namespace xray { - -struct YAMLXRayFileHeader { - uint16_t Version; - uint16_t Type; - bool ConstantTSC; - bool NonstopTSC; - uint64_t CycleFrequency; -}; - -struct YAMLXRayRecord { - uint16_t RecordType; - uint8_t CPU; - RecordTypes Type; - int32_t FuncId; - std::string Function; - uint64_t TSC; - uint32_t TId; -}; - -struct YAMLXRayTrace { - YAMLXRayFileHeader Header; - std::vector<YAMLXRayRecord> Records; -}; - -using XRayRecordStorage = - std::aligned_storage<sizeof(XRayRecord), alignof(XRayRecord)>::type; - -} // namespace xray - -namespace yaml { - -// YAML Traits -// ----------- -template <> struct ScalarEnumerationTraits<xray::RecordTypes> { - static void enumeration(IO &IO, xray::RecordTypes &Type) { - IO.enumCase(Type, "function-enter", xray::RecordTypes::ENTER); - IO.enumCase(Type, "function-exit", xray::RecordTypes::EXIT); - } -}; - -template <> struct MappingTraits<xray::YAMLXRayFileHeader> { - static void mapping(IO &IO, xray::YAMLXRayFileHeader &Header) { - IO.mapRequired("version", Header.Version); - IO.mapRequired("type", Header.Type); - IO.mapRequired("constant-tsc", Header.ConstantTSC); - IO.mapRequired("nonstop-tsc", Header.NonstopTSC); - IO.mapRequired("cycle-frequency", Header.CycleFrequency); - } -}; - -template <> struct MappingTraits<xray::YAMLXRayRecord> { - static void mapping(IO &IO, xray::YAMLXRayRecord &Record) { - // FIXME: Make this type actually be descriptive - IO.mapRequired("type", Record.RecordType); - IO.mapRequired("func-id", Record.FuncId); - IO.mapOptional("function", Record.Function); - IO.mapRequired("cpu", Record.CPU); - IO.mapRequired("thread", Record.TId); - IO.mapRequired("kind", Record.Type); - IO.mapRequired("tsc", Record.TSC); - } - - static constexpr bool flow = true; -}; - -template <> struct MappingTraits<xray::YAMLXRayTrace> { - static void mapping(IO &IO, xray::YAMLXRayTrace &Trace) { - // A trace file contains two parts, the header and the list of all the - // trace records. - IO.mapRequired("header", Trace.Header); - IO.mapRequired("records", Trace.Records); - } -}; - -} // namespace yaml -} // namespace llvm - -LLVM_YAML_IS_SEQUENCE_VECTOR(xray::YAMLXRayRecord) - -#endif // LLVM_TOOLS_LLVM_XRAY_XRAY_RECORD_YAML_H diff --git a/gnu/llvm/unittests/ADT/ReverseIterationTest.cpp b/gnu/llvm/unittests/ADT/ReverseIterationTest.cpp deleted file mode 100644 index a1fd3b26d4e..00000000000 --- a/gnu/llvm/unittests/ADT/ReverseIterationTest.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//===- llvm/unittest/ADT/ReverseIterationTest.cpp ------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// ReverseIteration unit tests. -// -//===----------------------------------------------------------------------===// - -#include "gtest/gtest.h" -#include "llvm/ADT/SmallPtrSet.h" - -#if LLVM_ENABLE_ABI_BREAKING_CHECKS -using namespace llvm; - -TEST(ReverseIterationTest, SmallPtrSetTest) { - - SmallPtrSet<void*, 4> Set; - void *Ptrs[] = { (void*)0x1, (void*)0x2, (void*)0x3, (void*)0x4 }; - void *ReversePtrs[] = { (void*)0x4, (void*)0x3, (void*)0x2, (void*)0x1 }; - - for (auto *Ptr: Ptrs) - Set.insert(Ptr); - - // Check forward iteration. - ReverseIterate<bool>::value = false; - for (const auto &Tuple : zip(Set, Ptrs)) - ASSERT_EQ(std::get<0>(Tuple), std::get<1>(Tuple)); - - // Check operator++ (post-increment) in forward iteration. - int i = 0; - for (auto begin = Set.begin(), end = Set.end(); - begin != end; i++) - ASSERT_EQ(*begin++, Ptrs[i]); - - // Check reverse iteration. - ReverseIterate<bool>::value = true; - for (const auto &Tuple : zip(Set, ReversePtrs)) - ASSERT_EQ(std::get<0>(Tuple), std::get<1>(Tuple)); - - // Check operator++ (post-increment) in reverse iteration. - i = 0; - for (auto begin = Set.begin(), end = Set.end(); - begin != end; i++) - ASSERT_EQ(*begin++, ReversePtrs[i]); - -} -#endif diff --git a/gnu/llvm/unittests/DebugInfo/PDB/MSFBuilderTest.cpp b/gnu/llvm/unittests/DebugInfo/PDB/MSFBuilderTest.cpp deleted file mode 100644 index 5f2f0c271e9..00000000000 --- a/gnu/llvm/unittests/DebugInfo/PDB/MSFBuilderTest.cpp +++ /dev/null @@ -1,360 +0,0 @@ -//===- MSFBuilderTest.cpp Tests manipulation of MSF stream metadata ------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "ErrorChecking.h" - -#include "llvm/DebugInfo/MSF/MSFBuilder.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" - -#include "gtest/gtest.h" - -using namespace llvm; -using namespace llvm::msf; - -namespace { -class MSFBuilderTest : public testing::Test { -protected: - void initializeSimpleSuperBlock(msf::SuperBlock &SB) { - initializeSuperBlock(SB); - SB.NumBlocks = 1000; - SB.NumDirectoryBytes = 8192; - } - - void initializeSuperBlock(msf::SuperBlock &SB) { - ::memset(&SB, 0, sizeof(SB)); - - ::memcpy(SB.MagicBytes, msf::Magic, sizeof(msf::Magic)); - SB.FreeBlockMapBlock = 1; - SB.BlockMapAddr = 1; - SB.BlockSize = 4096; - SB.NumDirectoryBytes = 0; - SB.NumBlocks = 2; // one for the Super Block, one for the directory - } - - BumpPtrAllocator Allocator; -}; -} - -TEST_F(MSFBuilderTest, ValidateSuperBlockAccept) { - // Test that a known good super block passes validation. - SuperBlock SB; - initializeSuperBlock(SB); - - EXPECT_NO_ERROR(msf::validateSuperBlock(SB)); -} - -TEST_F(MSFBuilderTest, ValidateSuperBlockReject) { - // Test that various known problems cause a super block to be rejected. - SuperBlock SB; - initializeSimpleSuperBlock(SB); - - // Mismatched magic - SB.MagicBytes[0] = 8; - EXPECT_ERROR(msf::validateSuperBlock(SB)); - initializeSimpleSuperBlock(SB); - - // Block 0 is reserved for super block, can't be occupied by the block map - SB.BlockMapAddr = 0; - EXPECT_ERROR(msf::validateSuperBlock(SB)); - initializeSimpleSuperBlock(SB); - - // Block sizes have to be powers of 2. - SB.BlockSize = 3120; - EXPECT_ERROR(msf::validateSuperBlock(SB)); - initializeSimpleSuperBlock(SB); - - // The directory itself has a maximum size. - SB.NumDirectoryBytes = SB.BlockSize * SB.BlockSize / 4; - EXPECT_NO_ERROR(msf::validateSuperBlock(SB)); - SB.NumDirectoryBytes = SB.NumDirectoryBytes + 4; - EXPECT_ERROR(msf::validateSuperBlock(SB)); -} - -TEST_F(MSFBuilderTest, TestUsedBlocksMarkedAsUsed) { - // Test that when assigning a stream to a known list of blocks, the blocks - // are correctly marked as used after adding, but no other incorrect blocks - // are accidentally marked as used. - - std::vector<uint32_t> Blocks = {4, 5, 6, 7, 8, 9, 10, 11, 12}; - // Allocate some extra blocks at the end so we can verify that they're free - // after the initialization. - uint32_t NumBlocks = msf::getMinimumBlockCount() + Blocks.size() + 10; - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096, NumBlocks); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - EXPECT_EXPECTED(Msf.addStream(Blocks.size() * 4096, Blocks)); - - for (auto B : Blocks) { - EXPECT_FALSE(Msf.isBlockFree(B)); - } - - uint32_t FreeBlockStart = Blocks.back() + 1; - for (uint32_t I = FreeBlockStart; I < NumBlocks; ++I) { - EXPECT_TRUE(Msf.isBlockFree(I)); - } -} - -TEST_F(MSFBuilderTest, TestAddStreamNoDirectoryBlockIncrease) { - // Test that adding a new stream correctly updates the directory. This only - // tests the case where the directory *DOES NOT* grow large enough that it - // crosses a Block boundary. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - auto ExpectedL1 = Msf.build(); - EXPECT_EXPECTED(ExpectedL1); - MSFLayout &L1 = *ExpectedL1; - - auto OldDirBlocks = L1.DirectoryBlocks; - EXPECT_EQ(1U, OldDirBlocks.size()); - - auto ExpectedMsf2 = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf2); - auto &Msf2 = *ExpectedMsf2; - - EXPECT_EXPECTED(Msf2.addStream(4000)); - EXPECT_EQ(1U, Msf2.getNumStreams()); - EXPECT_EQ(4000U, Msf2.getStreamSize(0)); - auto Blocks = Msf2.getStreamBlocks(0); - EXPECT_EQ(1U, Blocks.size()); - - auto ExpectedL2 = Msf2.build(); - EXPECT_EXPECTED(ExpectedL2); - MSFLayout &L2 = *ExpectedL2; - auto NewDirBlocks = L2.DirectoryBlocks; - EXPECT_EQ(1U, NewDirBlocks.size()); -} - -TEST_F(MSFBuilderTest, TestAddStreamWithDirectoryBlockIncrease) { - // Test that adding a new stream correctly updates the directory. This only - // tests the case where the directory *DOES* grow large enough that it - // crosses a Block boundary. This is because the newly added stream occupies - // so many Blocks that need to be indexed in the directory that the directory - // crosses a Block boundary. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - EXPECT_EXPECTED(Msf.addStream(4096 * 4096 / sizeof(uint32_t))); - - auto ExpectedL1 = Msf.build(); - EXPECT_EXPECTED(ExpectedL1); - MSFLayout &L1 = *ExpectedL1; - auto DirBlocks = L1.DirectoryBlocks; - EXPECT_EQ(2U, DirBlocks.size()); -} - -TEST_F(MSFBuilderTest, TestGrowStreamNoBlockIncrease) { - // Test growing an existing stream by a value that does not affect the number - // of blocks it occupies. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - EXPECT_EXPECTED(Msf.addStream(1024)); - EXPECT_EQ(1024U, Msf.getStreamSize(0)); - auto OldStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(1U, OldStreamBlocks.size()); - - EXPECT_NO_ERROR(Msf.setStreamSize(0, 2048)); - EXPECT_EQ(2048U, Msf.getStreamSize(0)); - auto NewStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(1U, NewStreamBlocks.size()); - - EXPECT_EQ(OldStreamBlocks, NewStreamBlocks); -} - -TEST_F(MSFBuilderTest, TestGrowStreamWithBlockIncrease) { - // Test that growing an existing stream to a value large enough that it causes - // the need to allocate new Blocks to the stream correctly updates the - // stream's - // block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - EXPECT_EXPECTED(Msf.addStream(2048)); - EXPECT_EQ(2048U, Msf.getStreamSize(0)); - std::vector<uint32_t> OldStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(1U, OldStreamBlocks.size()); - - EXPECT_NO_ERROR(Msf.setStreamSize(0, 6144)); - EXPECT_EQ(6144U, Msf.getStreamSize(0)); - std::vector<uint32_t> NewStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(2U, NewStreamBlocks.size()); - - EXPECT_EQ(OldStreamBlocks[0], NewStreamBlocks[0]); - EXPECT_NE(NewStreamBlocks[0], NewStreamBlocks[1]); -} - -TEST_F(MSFBuilderTest, TestShrinkStreamNoBlockDecrease) { - // Test that shrinking an existing stream by a value that does not affect the - // number of Blocks it occupies makes no changes to stream's block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - EXPECT_EXPECTED(Msf.addStream(2048)); - EXPECT_EQ(2048U, Msf.getStreamSize(0)); - std::vector<uint32_t> OldStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(1U, OldStreamBlocks.size()); - - EXPECT_NO_ERROR(Msf.setStreamSize(0, 1024)); - EXPECT_EQ(1024U, Msf.getStreamSize(0)); - std::vector<uint32_t> NewStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(1U, NewStreamBlocks.size()); - - EXPECT_EQ(OldStreamBlocks, NewStreamBlocks); -} - -TEST_F(MSFBuilderTest, TestShrinkStreamWithBlockDecrease) { - // Test that shrinking an existing stream to a value large enough that it - // causes the need to deallocate new Blocks to the stream correctly updates - // the stream's block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - EXPECT_EXPECTED(Msf.addStream(6144)); - EXPECT_EQ(6144U, Msf.getStreamSize(0)); - std::vector<uint32_t> OldStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(2U, OldStreamBlocks.size()); - - EXPECT_NO_ERROR(Msf.setStreamSize(0, 2048)); - EXPECT_EQ(2048U, Msf.getStreamSize(0)); - std::vector<uint32_t> NewStreamBlocks = Msf.getStreamBlocks(0); - EXPECT_EQ(1U, NewStreamBlocks.size()); - - EXPECT_EQ(OldStreamBlocks[0], NewStreamBlocks[0]); -} - -TEST_F(MSFBuilderTest, TestRejectReusedStreamBlock) { - // Test that attempting to add a stream and assigning a block that is already - // in use by another stream fails. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - EXPECT_EXPECTED(Msf.addStream(6144)); - - std::vector<uint32_t> Blocks = {2, 3}; - EXPECT_UNEXPECTED(Msf.addStream(6144, Blocks)); -} - -TEST_F(MSFBuilderTest, TestBlockCountsWhenAddingStreams) { - // Test that when adding multiple streams, the number of used and free Blocks - // allocated to the MSF file are as expected. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - // one for the super block, one for the directory block map - uint32_t NumUsedBlocks = Msf.getNumUsedBlocks(); - EXPECT_EQ(msf::getMinimumBlockCount(), NumUsedBlocks); - EXPECT_EQ(0U, Msf.getNumFreeBlocks()); - - const uint32_t StreamSizes[] = {4000, 6193, 189723}; - for (int I = 0; I < 3; ++I) { - EXPECT_EXPECTED(Msf.addStream(StreamSizes[I])); - NumUsedBlocks += bytesToBlocks(StreamSizes[I], 4096); - EXPECT_EQ(NumUsedBlocks, Msf.getNumUsedBlocks()); - EXPECT_EQ(0U, Msf.getNumFreeBlocks()); - } -} - -TEST_F(MSFBuilderTest, BuildMsfLayout) { - // Test that we can generate an MSFLayout structure from a valid layout - // specification. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - const uint32_t StreamSizes[] = {4000, 6193, 189723}; - uint32_t ExpectedNumBlocks = msf::getMinimumBlockCount(); - for (int I = 0; I < 3; ++I) { - EXPECT_EXPECTED(Msf.addStream(StreamSizes[I])); - ExpectedNumBlocks += bytesToBlocks(StreamSizes[I], 4096); - } - ++ExpectedNumBlocks; // The directory itself should use 1 block - - auto ExpectedLayout = Msf.build(); - EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; - EXPECT_EQ(4096U, L.SB->BlockSize); - EXPECT_EQ(ExpectedNumBlocks, L.SB->NumBlocks); - - EXPECT_EQ(1U, L.DirectoryBlocks.size()); - - EXPECT_EQ(3U, L.StreamMap.size()); - EXPECT_EQ(3U, L.StreamSizes.size()); - for (int I = 0; I < 3; ++I) { - EXPECT_EQ(StreamSizes[I], L.StreamSizes[I]); - uint32_t ExpectedNumBlocks = bytesToBlocks(StreamSizes[I], 4096); - EXPECT_EQ(ExpectedNumBlocks, L.StreamMap[I].size()); - } -} - -TEST_F(MSFBuilderTest, UseDirectoryBlockHint) { - Expected<MSFBuilder> ExpectedMsf = MSFBuilder::create( - Allocator, 4096, msf::getMinimumBlockCount() + 1, false); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - uint32_t B = msf::getFirstUnreservedBlock(); - EXPECT_NO_ERROR(Msf.setDirectoryBlocksHint({B + 1})); - EXPECT_EXPECTED(Msf.addStream(2048, {B + 2})); - - auto ExpectedLayout = Msf.build(); - EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; - EXPECT_EQ(msf::getMinimumBlockCount() + 2, L.SB->NumBlocks); - EXPECT_EQ(1U, L.DirectoryBlocks.size()); - EXPECT_EQ(1U, L.StreamMap[0].size()); - - EXPECT_EQ(B + 1, L.DirectoryBlocks[0]); - EXPECT_EQ(B + 2, L.StreamMap[0].front()); -} - -TEST_F(MSFBuilderTest, DirectoryBlockHintInsufficient) { - Expected<MSFBuilder> ExpectedMsf = - MSFBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - uint32_t B = msf::getFirstUnreservedBlock(); - EXPECT_NO_ERROR(Msf.setDirectoryBlocksHint({B + 1})); - - uint32_t Size = 4096 * 4096 / 4; - EXPECT_EXPECTED(Msf.addStream(Size)); - - auto ExpectedLayout = Msf.build(); - EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; - EXPECT_EQ(2U, L.DirectoryBlocks.size()); - EXPECT_EQ(B + 1, L.DirectoryBlocks[0]); -} - -TEST_F(MSFBuilderTest, DirectoryBlockHintOverestimated) { - Expected<MSFBuilder> ExpectedMsf = - MSFBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); - EXPECT_EXPECTED(ExpectedMsf); - auto &Msf = *ExpectedMsf; - - uint32_t B = msf::getFirstUnreservedBlock(); - EXPECT_NO_ERROR(Msf.setDirectoryBlocksHint({B + 1, B + 2})); - - EXPECT_EXPECTED(Msf.addStream(2048)); - - auto ExpectedLayout = Msf.build(); - EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; - EXPECT_EQ(1U, L.DirectoryBlocks.size()); - EXPECT_EQ(B + 1, L.DirectoryBlocks[0]); -} diff --git a/gnu/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/gnu/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp deleted file mode 100644 index 6f9e86c4f26..00000000000 --- a/gnu/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp +++ /dev/null @@ -1,442 +0,0 @@ -//===- llvm/unittest/DebugInfo/PDB/MappedBlockStreamTest.cpp --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "ErrorChecking.h" - -#include "llvm/DebugInfo/CodeView/ByteStream.h" -#include "llvm/DebugInfo/CodeView/StreamReader.h" -#include "llvm/DebugInfo/CodeView/StreamRef.h" -#include "llvm/DebugInfo/CodeView/StreamWriter.h" -#include "llvm/DebugInfo/PDB/Raw/IPDBFile.h" -#include "llvm/DebugInfo/PDB/Raw/IPDBStreamData.h" -#include "llvm/DebugInfo/PDB/Raw/IndexedStreamData.h" -#include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h" -#include "gtest/gtest.h" - -#include <unordered_map> - -using namespace llvm; -using namespace llvm::codeview; -using namespace llvm::pdb; - -namespace { - -static const uint32_t BlocksAry[] = {0, 1, 2, 5, 4, 3, 6, 7, 8, 9}; -static uint8_t DataAry[] = {'A', 'B', 'C', 'F', 'E', 'D', 'G', 'H', 'I', 'J'}; - -class DiscontiguousFile : public IPDBFile { -public: - DiscontiguousFile(ArrayRef<uint32_t> Blocks, MutableArrayRef<uint8_t> Data) - : Blocks(Blocks.begin(), Blocks.end()), Data(Data.begin(), Data.end()) {} - - uint32_t getBlockSize() const override { return 1; } - uint32_t getBlockCount() const override { return Blocks.size(); } - uint32_t getNumStreams() const override { return 1; } - uint32_t getStreamByteSize(uint32_t StreamIndex) const override { - return getBlockCount() * getBlockSize(); - } - ArrayRef<support::ulittle32_t> - getStreamBlockList(uint32_t StreamIndex) const override { - if (StreamIndex != 0) - return ArrayRef<support::ulittle32_t>(); - return Blocks; - } - Expected<ArrayRef<uint8_t>> getBlockData(uint32_t BlockIndex, - uint32_t NumBytes) const override { - return ArrayRef<uint8_t>(&Data[BlockIndex], NumBytes); - } - - Error setBlockData(uint32_t BlockIndex, uint32_t Offset, - ArrayRef<uint8_t> SrcData) const override { - if (BlockIndex >= Blocks.size()) - return make_error<CodeViewError>(cv_error_code::insufficient_buffer); - if (Offset > getBlockSize() - SrcData.size()) - return make_error<CodeViewError>(cv_error_code::insufficient_buffer); - ::memcpy(&Data[BlockIndex] + Offset, SrcData.data(), SrcData.size()); - return Error::success(); - } - -private: - std::vector<support::ulittle32_t> Blocks; - MutableArrayRef<uint8_t> Data; -}; - -class MappedBlockStreamImpl : public MappedBlockStream { -public: - MappedBlockStreamImpl(std::unique_ptr<IPDBStreamData> Data, - const IPDBFile &File) - : MappedBlockStream(std::move(Data), File) {} -}; - -// Tests that a read which is entirely contained within a single block works -// and does not allocate. -TEST(MappedBlockStreamTest, ReadBeyondEndOfStreamRef) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StreamRef SR; - EXPECT_NO_ERROR(R.readStreamRef(SR, 0U)); - ArrayRef<uint8_t> Buffer; - EXPECT_ERROR(SR.readBytes(0U, 1U, Buffer)); - EXPECT_NO_ERROR(R.readStreamRef(SR, 1U)); - EXPECT_ERROR(SR.readBytes(1U, 1U, Buffer)); -} - -// Tests that a read which outputs into a full destination buffer works and -// does not fail due to the length of the output buffer. -TEST(MappedBlockStreamTest, ReadOntoNonEmptyBuffer) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str = "ZYXWVUTSRQPONMLKJIHGFEDCBA"; - EXPECT_NO_ERROR(R.readFixedString(Str, 1)); - EXPECT_EQ(Str, StringRef("A")); - EXPECT_EQ(0U, S.getNumBytesCopied()); -} - -// Tests that a read which crosses a block boundary, but where the subsequent -// blocks are still contiguous in memory to the previous block works and does -// not allocate memory. -TEST(MappedBlockStreamTest, ZeroCopyReadContiguousBreak) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str; - EXPECT_NO_ERROR(R.readFixedString(Str, 2)); - EXPECT_EQ(Str, StringRef("AB")); - EXPECT_EQ(0U, S.getNumBytesCopied()); - - R.setOffset(6); - EXPECT_NO_ERROR(R.readFixedString(Str, 4)); - EXPECT_EQ(Str, StringRef("GHIJ")); - EXPECT_EQ(0U, S.getNumBytesCopied()); -} - -// Tests that a read which crosses a block boundary and cannot be referenced -// contiguously works and allocates only the precise amount of bytes -// requested. -TEST(MappedBlockStreamTest, CopyReadNonContiguousBreak) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str; - EXPECT_NO_ERROR(R.readFixedString(Str, 10)); - EXPECT_EQ(Str, StringRef("ABCDEFGHIJ")); - EXPECT_EQ(10U, S.getNumBytesCopied()); -} - -// Test that an out of bounds read which doesn't cross a block boundary -// fails and allocates no memory. -TEST(MappedBlockStreamTest, InvalidReadSizeNoBreak) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str; - - R.setOffset(10); - EXPECT_ERROR(R.readFixedString(Str, 1)); - EXPECT_EQ(0U, S.getNumBytesCopied()); -} - -// Test that an out of bounds read which crosses a contiguous block boundary -// fails and allocates no memory. -TEST(MappedBlockStreamTest, InvalidReadSizeContiguousBreak) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str; - - R.setOffset(6); - EXPECT_ERROR(R.readFixedString(Str, 5)); - EXPECT_EQ(0U, S.getNumBytesCopied()); -} - -// Test that an out of bounds read which crosses a discontiguous block -// boundary fails and allocates no memory. -TEST(MappedBlockStreamTest, InvalidReadSizeNonContiguousBreak) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str; - - EXPECT_ERROR(R.readFixedString(Str, 11)); - EXPECT_EQ(0U, S.getNumBytesCopied()); -} - -// Tests that a read which is entirely contained within a single block but -// beyond the end of a StreamRef fails. -TEST(MappedBlockStreamTest, ZeroCopyReadNoBreak) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str; - EXPECT_NO_ERROR(R.readFixedString(Str, 1)); - EXPECT_EQ(Str, StringRef("A")); - EXPECT_EQ(0U, S.getNumBytesCopied()); -} - -// Tests that a read which is not aligned on the same boundary as a previous -// cached request, but which is known to overlap that request, shares the -// previous allocation. -TEST(MappedBlockStreamTest, UnalignedOverlappingRead) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str1; - StringRef Str2; - EXPECT_NO_ERROR(R.readFixedString(Str1, 7)); - EXPECT_EQ(Str1, StringRef("ABCDEFG")); - EXPECT_EQ(7U, S.getNumBytesCopied()); - - R.setOffset(2); - EXPECT_NO_ERROR(R.readFixedString(Str2, 3)); - EXPECT_EQ(Str2, StringRef("CDE")); - EXPECT_EQ(Str1.data() + 2, Str2.data()); - EXPECT_EQ(7U, S.getNumBytesCopied()); -} - -// Tests that a read which is not aligned on the same boundary as a previous -// cached request, but which only partially overlaps a previous cached request, -// still works correctly and allocates again from the shared pool. -TEST(MappedBlockStreamTest, UnalignedOverlappingReadFail) { - DiscontiguousFile F(BlocksAry, DataAry); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - StreamReader R(S); - StringRef Str1; - StringRef Str2; - EXPECT_NO_ERROR(R.readFixedString(Str1, 6)); - EXPECT_EQ(Str1, StringRef("ABCDEF")); - EXPECT_EQ(6U, S.getNumBytesCopied()); - - R.setOffset(4); - EXPECT_NO_ERROR(R.readFixedString(Str2, 4)); - EXPECT_EQ(Str2, StringRef("EFGH")); - EXPECT_EQ(10U, S.getNumBytesCopied()); -} - -TEST(MappedBlockStreamTest, WriteBeyondEndOfStream) { - static uint8_t Data[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'}; - static uint8_t LargeBuffer[] = {'0', '1', '2', '3', '4', '5', - '6', '7', '8', '9', 'A'}; - static uint8_t SmallBuffer[] = {'0', '1', '2'}; - static_assert(sizeof(LargeBuffer) > sizeof(Data), - "LargeBuffer is not big enough"); - - DiscontiguousFile F(BlocksAry, Data); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - ArrayRef<uint8_t> Buffer; - - EXPECT_ERROR(S.writeBytes(0, ArrayRef<uint8_t>(LargeBuffer))); - EXPECT_NO_ERROR(S.writeBytes(0, ArrayRef<uint8_t>(SmallBuffer))); - EXPECT_NO_ERROR(S.writeBytes(7, ArrayRef<uint8_t>(SmallBuffer))); - EXPECT_ERROR(S.writeBytes(8, ArrayRef<uint8_t>(SmallBuffer))); -} - -TEST(MappedBlockStreamTest, TestWriteBytesNoBreakBoundary) { - static uint8_t Data[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'}; - DiscontiguousFile F(BlocksAry, Data); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - ArrayRef<uint8_t> Buffer; - - EXPECT_NO_ERROR(S.readBytes(0, 1, Buffer)); - EXPECT_EQ(Buffer, ArrayRef<uint8_t>('A')); - EXPECT_NO_ERROR(S.readBytes(9, 1, Buffer)); - EXPECT_EQ(Buffer, ArrayRef<uint8_t>('J')); - - EXPECT_NO_ERROR(S.writeBytes(0, ArrayRef<uint8_t>('J'))); - EXPECT_NO_ERROR(S.writeBytes(9, ArrayRef<uint8_t>('A'))); - - EXPECT_NO_ERROR(S.readBytes(0, 1, Buffer)); - EXPECT_EQ(Buffer, ArrayRef<uint8_t>('J')); - EXPECT_NO_ERROR(S.readBytes(9, 1, Buffer)); - EXPECT_EQ(Buffer, ArrayRef<uint8_t>('A')); - - EXPECT_NO_ERROR(S.writeBytes(0, ArrayRef<uint8_t>('A'))); - EXPECT_NO_ERROR(S.writeBytes(9, ArrayRef<uint8_t>('J'))); - - EXPECT_NO_ERROR(S.readBytes(0, 1, Buffer)); - EXPECT_EQ(Buffer, ArrayRef<uint8_t>('A')); - EXPECT_NO_ERROR(S.readBytes(9, 1, Buffer)); - EXPECT_EQ(Buffer, ArrayRef<uint8_t>('J')); -} - -TEST(MappedBlockStreamTest, TestWriteBytesBreakBoundary) { - static uint8_t Data[] = {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0'}; - static uint8_t TestData[] = {'T', 'E', 'S', 'T', 'I', 'N', 'G', '.'}; - static uint8_t Expected[] = {'T', 'E', 'S', 'N', 'I', - 'T', 'G', '.', '0', '0'}; - - DiscontiguousFile F(BlocksAry, Data); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - ArrayRef<uint8_t> Buffer; - - EXPECT_NO_ERROR(S.writeBytes(0, TestData)); - // First just compare the memory, then compare the result of reading the - // string out. - EXPECT_EQ(ArrayRef<uint8_t>(Data), ArrayRef<uint8_t>(Expected)); - - EXPECT_NO_ERROR(S.readBytes(0, 8, Buffer)); - EXPECT_EQ(Buffer, ArrayRef<uint8_t>(TestData)); -} - -TEST(MappedBlockStreamTest, TestWriteThenRead) { - std::vector<uint8_t> DataBytes(10); - MutableArrayRef<uint8_t> Data(DataBytes); - const uint32_t Blocks[] = {2, 1, 0, 6, 3, 4, 5, 7, 9, 8}; - - DiscontiguousFile F(Blocks, Data); - MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); - - enum class MyEnum : uint32_t { Val1 = 2908234, Val2 = 120891234 }; - using support::ulittle32_t; - - uint16_t u16[] = {31468, 0}; - uint32_t u32[] = {890723408, 0}; - MyEnum Enum[] = {MyEnum::Val1, MyEnum::Val2}; - StringRef ZStr[] = {"Zero Str", ""}; - StringRef FStr[] = {"Fixed Str", ""}; - uint8_t byteArray0[] = {'1', '2'}; - uint8_t byteArray1[] = {'0', '0'}; - ArrayRef<uint8_t> byteArrayRef0(byteArray0); - ArrayRef<uint8_t> byteArrayRef1(byteArray1); - ArrayRef<uint8_t> byteArray[] = { byteArrayRef0, byteArrayRef1 }; - ArrayRef<uint32_t> intArray[] = {{890723408, 29082234}, {0, 0}}; - - StreamReader Reader(S); - StreamWriter Writer(S); - EXPECT_NO_ERROR(Writer.writeInteger(u16[0])); - EXPECT_NO_ERROR(Reader.readInteger(u16[1])); - EXPECT_EQ(u16[0], u16[1]); - EXPECT_EQ(std::vector<uint8_t>({0, 0x7A, 0xEC, 0, 0, 0, 0, 0, 0, 0}), - DataBytes); - - Reader.setOffset(0); - Writer.setOffset(0); - ::memset(DataBytes.data(), 0, 10); - EXPECT_NO_ERROR(Writer.writeInteger(u32[0])); - EXPECT_NO_ERROR(Reader.readInteger(u32[1])); - EXPECT_EQ(u32[0], u32[1]); - EXPECT_EQ(std::vector<uint8_t>({0x17, 0x5C, 0x50, 0, 0, 0, 0x35, 0, 0, 0}), - DataBytes); - - Reader.setOffset(0); - Writer.setOffset(0); - ::memset(DataBytes.data(), 0, 10); - EXPECT_NO_ERROR(Writer.writeEnum(Enum[0])); - EXPECT_NO_ERROR(Reader.readEnum(Enum[1])); - EXPECT_EQ(Enum[0], Enum[1]); - EXPECT_EQ(std::vector<uint8_t>({0x2C, 0x60, 0x4A, 0, 0, 0, 0, 0, 0, 0}), - DataBytes); - - Reader.setOffset(0); - Writer.setOffset(0); - ::memset(DataBytes.data(), 0, 10); - EXPECT_NO_ERROR(Writer.writeZeroString(ZStr[0])); - EXPECT_NO_ERROR(Reader.readZeroString(ZStr[1])); - EXPECT_EQ(ZStr[0], ZStr[1]); - EXPECT_EQ( - std::vector<uint8_t>({'r', 'e', 'Z', ' ', 'S', 't', 'o', 'r', 0, 0}), - DataBytes); - - Reader.setOffset(0); - Writer.setOffset(0); - ::memset(DataBytes.data(), 0, 10); - EXPECT_NO_ERROR(Writer.writeFixedString(FStr[0])); - EXPECT_NO_ERROR(Reader.readFixedString(FStr[1], FStr[0].size())); - EXPECT_EQ(FStr[0], FStr[1]); - EXPECT_EQ( - std::vector<uint8_t>({'x', 'i', 'F', 'd', ' ', 'S', 'e', 't', 0, 'r'}), - DataBytes); - - Reader.setOffset(0); - Writer.setOffset(0); - ::memset(DataBytes.data(), 0, 10); - EXPECT_NO_ERROR(Writer.writeArray(byteArray[0])); - EXPECT_NO_ERROR(Reader.readArray(byteArray[1], byteArray[0].size())); - EXPECT_EQ(byteArray[0], byteArray[1]); - EXPECT_EQ(std::vector<uint8_t>({0, 0x32, 0x31, 0, 0, 0, 0, 0, 0, 0}), - DataBytes); - - Reader.setOffset(0); - Writer.setOffset(0); - ::memset(DataBytes.data(), 0, 10); - EXPECT_NO_ERROR(Writer.writeArray(intArray[0])); - EXPECT_NO_ERROR(Reader.readArray(intArray[1], intArray[0].size())); - EXPECT_EQ(intArray[0], intArray[1]); -} - -TEST(MappedBlockStreamTest, TestWriteContiguousStreamRef) { - std::vector<uint8_t> DestDataBytes(10); - MutableArrayRef<uint8_t> DestData(DestDataBytes); - const uint32_t DestBlocks[] = {2, 1, 0, 6, 3, 4, 5, 7, 9, 8}; - - std::vector<uint8_t> SrcDataBytes(10); - MutableArrayRef<uint8_t> SrcData(SrcDataBytes); - - DiscontiguousFile F(DestBlocks, DestData); - MappedBlockStreamImpl DestStream(llvm::make_unique<IndexedStreamData>(0, F), - F); - - // First write "Test Str" into the source stream. - ByteStream<true> SourceStream(SrcData); - StreamWriter SourceWriter(SourceStream); - EXPECT_NO_ERROR(SourceWriter.writeZeroString("Test Str")); - EXPECT_EQ(SrcDataBytes, std::vector<uint8_t>( - {'T', 'e', 's', 't', ' ', 'S', 't', 'r', 0, 0})); - - // Then write the source stream into the dest stream. - StreamWriter DestWriter(DestStream); - EXPECT_NO_ERROR(DestWriter.writeStreamRef(SourceStream)); - EXPECT_EQ(DestDataBytes, std::vector<uint8_t>( - {'s', 'e', 'T', ' ', 'S', 't', 't', 'r', 0, 0})); - - // Then read the string back out of the dest stream. - StringRef Result; - StreamReader DestReader(DestStream); - EXPECT_NO_ERROR(DestReader.readZeroString(Result)); - EXPECT_EQ(Result, "Test Str"); -} - -TEST(MappedBlockStreamTest, TestWriteDiscontiguousStreamRef) { - std::vector<uint8_t> DestDataBytes(10); - MutableArrayRef<uint8_t> DestData(DestDataBytes); - const uint32_t DestBlocks[] = {2, 1, 0, 6, 3, 4, 5, 7, 9, 8}; - - std::vector<uint8_t> SrcDataBytes(10); - MutableArrayRef<uint8_t> SrcData(SrcDataBytes); - const uint32_t SrcBlocks[] = {1, 0, 6, 3, 4, 5, 2, 7, 8, 9}; - - DiscontiguousFile DestFile(DestBlocks, DestData); - DiscontiguousFile SrcFile(SrcBlocks, SrcData); - - MappedBlockStreamImpl DestStream( - llvm::make_unique<IndexedStreamData>(0, DestFile), DestFile); - MappedBlockStreamImpl SrcStream( - llvm::make_unique<IndexedStreamData>(0, SrcFile), SrcFile); - - // First write "Test Str" into the source stream. - StreamWriter SourceWriter(SrcStream); - EXPECT_NO_ERROR(SourceWriter.writeZeroString("Test Str")); - EXPECT_EQ(SrcDataBytes, std::vector<uint8_t>( - {'e', 'T', 't', 't', ' ', 'S', 's', 'r', 0, 0})); - - // Then write the source stream into the dest stream. - StreamWriter DestWriter(DestStream); - EXPECT_NO_ERROR(DestWriter.writeStreamRef(SrcStream)); - EXPECT_EQ(DestDataBytes, std::vector<uint8_t>( - {'s', 'e', 'T', ' ', 'S', 't', 't', 'r', 0, 0})); - - // Then read the string back out of the dest stream. - StringRef Result; - StreamReader DestReader(DestStream); - EXPECT_NO_ERROR(DestReader.readZeroString(Result)); - EXPECT_EQ(Result, "Test Str"); -} - -} // end anonymous namespace diff --git a/gnu/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest b/gnu/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest deleted file mode 100755 index dd49f025b1f..00000000000 --- a/gnu/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python - -import sys - -if len(sys.argv) != 2: - raise ValueError("unexpected number of args") - -if sys.argv[1] == "--gtest_list_tests": - print("""\ -FirstTest. - subTestA - subTestB -ParameterizedTest/0. - subTest -ParameterizedTest/1. - subTest""") - sys.exit(0) -elif not sys.argv[1].startswith("--gtest_filter="): - raise ValueError("unexpected argument: %r" % (sys.argv[1])) - -test_name = sys.argv[1].split('=',1)[1] -if test_name == 'FirstTest.subTestA': - print('I am subTest A, I PASS') - print('[ PASSED ] 1 test.') - sys.exit(0) -elif test_name == 'FirstTest.subTestB': - print('I am subTest B, I FAIL') - print('And I have two lines of output') - sys.exit(1) -elif test_name in ('ParameterizedTest/0.subTest', - 'ParameterizedTest/1.subTest'): - print('I am a parameterized test, I also PASS') - print('[ PASSED ] 1 test.') - sys.exit(0) -else: - raise SystemExit("error: invalid test name: %r" % (test_name,)) diff --git a/gnu/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest b/gnu/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest deleted file mode 100755 index f3a90ff4cd6..00000000000 --- a/gnu/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python - -import sys -import time - -if len(sys.argv) != 2: - raise ValueError("unexpected number of args") - -if sys.argv[1] == "--gtest_list_tests": - print("""\ -FirstTest. - subTestA - subTestB - subTestC -""") - sys.exit(0) -elif not sys.argv[1].startswith("--gtest_filter="): - raise ValueError("unexpected argument: %r" % (sys.argv[1])) - -test_name = sys.argv[1].split('=',1)[1] -if test_name == 'FirstTest.subTestA': - print('I am subTest A, I PASS') - print('[ PASSED ] 1 test.') - sys.exit(0) -elif test_name == 'FirstTest.subTestB': - print('I am subTest B, I am slow') - time.sleep(6) - print('[ PASSED ] 1 test.') - sys.exit(0) -elif test_name == 'FirstTest.subTestC': - print('I am subTest C, I will hang') - while True: - pass -else: - raise SystemExit("error: invalid test name: %r" % (test_name,)) diff --git a/gnu/llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest b/gnu/llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest deleted file mode 100755 index d7bc5968f26..00000000000 --- a/gnu/llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -import sys - -if len(sys.argv) != 2: - raise ValueError("unexpected number of args") - -if sys.argv[1] == "--gtest_list_tests": - print("""\ -Running main() from gtest_main.cc -FirstTest. - subTestA - subTestB -ParameterizedTest/0. - subTest -ParameterizedTest/1. - subTest""") - sys.exit(0) -elif not sys.argv[1].startswith("--gtest_filter="): - raise ValueError("unexpected argument: %r" % (sys.argv[1])) - -test_name = sys.argv[1].split('=',1)[1] -print('Running main() from gtest_main.cc') -if test_name == 'FirstTest.subTestA': - print('I am subTest A, I PASS') - print('[ PASSED ] 1 test.') - sys.exit(0) -elif test_name == 'FirstTest.subTestB': - print('I am subTest B, I FAIL') - print('And I have two lines of output') - sys.exit(1) -elif test_name in ('ParameterizedTest/0.subTest', - 'ParameterizedTest/1.subTest'): - print('I am a parameterized test, I also PASS') - print('[ PASSED ] 1 test.') - sys.exit(0) -else: - raise SystemExit("error: invalid test name: %r" % (test_name,)) diff --git a/gnu/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.sh b/gnu/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.sh deleted file mode 100755 index 6b622cb232e..00000000000 --- a/gnu/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo "a line with bad encoding: Â." diff --git a/gnu/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh b/gnu/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh deleted file mode 100755 index ead3fd3ce37..00000000000 --- a/gnu/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo "a line on stderr" 1>&2 diff --git a/gnu/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh b/gnu/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh deleted file mode 100755 index f20de5d9042..00000000000 --- a/gnu/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo "a line on stdout" -echo "a line on stderr" 1>&2 diff --git a/gnu/llvm/utils/test_debuginfo.pl b/gnu/llvm/utils/test_debuginfo.pl deleted file mode 100755 index aaf90d95468..00000000000 --- a/gnu/llvm/utils/test_debuginfo.pl +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl -# -# This script tests debugging information generated by a compiler. -# Input arguments -# - Input source program. Usually this source file is decorated using -# special comments to communicate debugger commands. -# - Executable file. This file is generated by the compiler. -# -# This perl script extracts debugger commands from input source program -# comments in a script. A debugger is used to load the executable file -# and run the script generated from source program comments. Finally, -# the debugger output is checked, using FileCheck, to validate -# debugging information. -# -# On Darwin the default is to use the llgdb.py wrapper script which -# translates gdb commands into their lldb equivalents. - -use File::Basename; -use Config; -use Cwd; - -my $testcase_file = $ARGV[0]; -my $executable_file = $ARGV[1]; - -my $input_filename = basename $testcase_file; -my $output_dir = dirname $executable_file; - -my $debugger_script_file = "$output_dir/$input_filename.debugger.script"; -my $output_file = "$output_dir/$input_filename.gdb.output"; - -my %cmd_map = (); -# Assume lldb to be the debugger on Darwin. -my $use_lldb = 0; -$use_lldb = 1 if ($Config{osname} eq "darwin"); - -# Extract debugger commands from testcase. They are marked with DEBUGGER: -# at the beginning of a comment line. -open(INPUT, $testcase_file); -open(OUTPUT, ">$debugger_script_file"); -while(<INPUT>) { - my($line) = $_; - $i = index($line, "DEBUGGER:"); - if ( $i >= 0) { - $l = length("DEBUGGER:"); - $s = substr($line, $i + $l); - print OUTPUT "$s"; - } -} -print OUTPUT "\n"; -print OUTPUT "quit\n"; -close(INPUT); -close(OUTPUT); - -# setup debugger and debugger options to run a script. -my $my_debugger = $ENV{'DEBUGGER'}; -if (!$my_debugger) { - if ($use_lldb) { - my $path = dirname(Cwd::abs_path($0)); - $my_debugger = "/usr/bin/env python $path/../tools/clang/test/debuginfo-tests/llgdb.py"; - } else { - $my_debugger = "gdb"; - } -} - -# quiet / exit after cmdline / no init file / execute script -my $debugger_options = "-q -batch -n -x"; - -# run debugger and capture output. -system("$my_debugger $debugger_options $debugger_script_file $executable_file > $output_file 2>&1"); - -# validate output. -system("FileCheck", "-input-file", "$output_file", "$testcase_file"); -if ($?>>8 == 1) { - print "Debugger output was:\n"; - system("cat", "$output_file"); - exit 1; -} -else { - exit 0; -} |