Class CallingConventionBuilder

java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.type.CallingConventionBuilder

public class CallingConventionBuilder extends Object
Builder of CallingConvention objects.
  • Constructor Details

    • CallingConventionBuilder

      public CallingConventionBuilder(String name)
      Create a builder.
      Parameters:
      name - calling convention name
    • CallingConventionBuilder

      public CallingConventionBuilder(String name, ProcessorType proctype)
      Create a builder.
      Parameters:
      name - calling convention name
      proctype - processor type
    • CallingConventionBuilder

      public CallingConventionBuilder(CallingConventionName name, ProcessorType proctype)
      Create a builder.
      Parameters:
      name - calling convention name
      proctype - processor type
  • Method Details

    • duplicate

      public CallingConventionBuilder duplicate()
      Duplicate this builder.
      Returns:
      duplicated builder
    • setNotes

      public void setNotes(String notes)
      Set implementation notes.
      Parameters:
      notes - notes
    • setFlags

      public CallingConventionBuilder setFlags(int flags)
      Set convention flags.
      Parameters:
      flags - flags
      Returns:
      this builder
    • addFlags

      public CallingConventionBuilder addFlags(int additionalFlags)
      Add convention flags.
      Parameters:
      additionalFlags - flags to add
      Returns:
      this builder
    • setName

      public CallingConventionBuilder setName(String name)
      Set the principal name.
      Parameters:
      name - calling convention name
      Returns:
      this builder
    • setName

      public CallingConventionBuilder setName(String name, boolean clearAlternateNames)
      Set the principal name.
      Parameters:
      name - calling convention name
      clearAlternateNames - if true, clear alternate names
      Returns:
      this builder
    • setAlternateNames

      public CallingConventionBuilder setAlternateNames(Collection<String> names)
      Set alternate names.
      Parameters:
      names - alternate names
      Returns:
      this builder
    • addAlternateName

      public CallingConventionBuilder addAlternateName(String name)
      Add an alternate name.
      Parameters:
      name - alternate name
      Returns:
      this builder
    • addAlternateNames

      public CallingConventionBuilder addAlternateNames(Collection<String> names)
      Add alternate names.
      Parameters:
      names - alternate names
      Returns:
      this builder
    • setProcessorTypes

      public CallingConventionBuilder setProcessorTypes(Collection<ProcessorType> processorTypes)
      Set processor types.
      Parameters:
      processorTypes - processor types
      Returns:
      this builder
    • addProcessorType

      public CallingConventionBuilder addProcessorType(ProcessorType proctype)
      Add a processor type.
      Parameters:
      proctype - processor type
      Returns:
      this builder
    • addSubsystemType

      public CallingConventionBuilder addSubsystemType(SubsystemType sstype)
      Add a subsystem type.
      Parameters:
      sstype - subsystem type
      Returns:
      this builder
    • addCompilerType

      public CallingConventionBuilder addCompilerType(CompilerType comptype)
      Add a compiler type.
      Parameters:
      comptype - compiler type
      Returns:
      this builder
    • addSpoiledRegister

      public CallingConventionBuilder addSpoiledRegister(long reg)
      Add a spoiled register.
      Parameters:
      reg - register id
      Returns:
      this builder
    • addSpoiledRegisters

      public CallingConventionBuilder addSpoiledRegisters(long... regs)
      Add spoiled registers.
      Parameters:
      regs - register ids
      Returns:
      this builder
    • addSpoiledRegisters

      public CallingConventionBuilder addSpoiledRegisters(Collection<StorageEntry> entries)
      Add spoiled registers from storage entries.
      Parameters:
      entries - storage entries
      Returns:
      this builder
    • setReturnAddressSlot

      public CallingConventionBuilder setReturnAddressSlot(StorageEntry entry)
      Set the return-address slot.
      Parameters:
      entry - storage entry
      Returns:
      this builder
    • addOutputSlot

      public CallingConventionBuilder addOutputSlot(StorageEntry entry)
      Add an output slot.
      Parameters:
      entry - storage entry
      Returns:
      this builder
    • addOutputSlots

      public CallingConventionBuilder addOutputSlots(Collection<StorageEntry> entries)
      Add output slots.
      Parameters:
      entries - storage entries
      Returns:
      this builder
    • addInputSlot

      public CallingConventionBuilder addInputSlot(StorageEntry entry)
      Add an input slot.
      Parameters:
      entry - storage entry
      Returns:
      this builder
    • addInputSlots

      public CallingConventionBuilder addInputSlots(Collection<StorageEntry> entries)
      Add input slots.
      Parameters:
      entries - storage entries
      Returns:
      this builder
    • addInputFpSlot

      public CallingConventionBuilder addInputFpSlot(StorageEntry entry)
      Add an input floating-point slot.
      Parameters:
      entry - storage entry
      Returns:
      this builder
    • addInputFpSlots

      public CallingConventionBuilder addInputFpSlots(Collection<StorageEntry> entries)
      Add input floating-point slots.
      Parameters:
      entries - storage entries
      Returns:
      this builder
    • addOutputRegisterPair

      public CallingConventionBuilder addOutputRegisterPair(StorageEntry registerPair)
      Add an output register pair.
      Parameters:
      registerPair - must be of REGISTER_PAIR type
      Returns:
      this builder
    • addOutputRegisterPairs

      public CallingConventionBuilder addOutputRegisterPairs(Collection<StorageEntry> registerPairs)
      Add output register pairs.
      Parameters:
      registerPairs - register-pair entries
      Returns:
      this builder
    • addInputRegisterPair

      public CallingConventionBuilder addInputRegisterPair(StorageEntry registerPair)
      Add an input register pair.
      Parameters:
      registerPair - must be of REGISTER_PAIR type
      Returns:
      this builder
    • addInputRegisterPairs

      public CallingConventionBuilder addInputRegisterPairs(Collection<StorageEntry> registerPairs)
      Add input register pairs.
      Parameters:
      registerPairs - register-pair entries
      Returns:
      this builder
    • setOutputFpSlot

      public CallingConventionBuilder setOutputFpSlot(StorageEntry outFpSlot)
      Set the output floating-point slot.
      Parameters:
      outFpSlot - output floating-point slot
      Returns:
      this builder
    • setIPRD

      public CallingConventionBuilder setIPRD(int slotcnt, StorageEntry inputPtrEntry, StorageEntry outputPtrEntry)
      Set information for Implicit Pointer to Return Data special conventions.
      Parameters:
      slotcnt - minimum slot count for which a composite return type must be treated via an IPRD
      inputPtrEntry - null if the implicit input entry can be discovered as a normal input entry
      outputPtrEntry - null if the output entry can be discovered as a normal output entry
      Returns:
      this builder
    • addAlignementRequirement

      public CallingConventionBuilder addAlignementRequirement(int reqSlotcount, int wantedSlotcountAlignment)
      Add a slot-count alignment requirement.
      Parameters:
      reqSlotcount - required slot count
      wantedSlotcountAlignment - wanted slot-count alignment
      Returns:
      this builder
    • build

      public ICallingConvention build()
      Build the calling convention.
      Returns:
      calling convention