Commit 686a8891 authored by Tom Stellard's avatar Tom Stellard
Browse files

Revert ABI/API changes from b288f7d6

This still fixes PR43479, but does it in a way that does not change
the libLLVM-9.so ABI.
parent 840845a1
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -787,9 +787,14 @@ public:
  ///
  /// This is allocated on the function's allocator and so lives the life of
  /// the function.
  MachineInstr::ExtraInfo *createMIExtraInfo(
      ArrayRef<MachineMemOperand *> MMOs, MCSymbol *PreInstrSymbol = nullptr,
      MCSymbol *PostInstrSymbol = nullptr, MDNode *HeapAllocMarker = nullptr);
  MachineInstr::ExtraInfo *
  createMIExtraInfo(ArrayRef<MachineMemOperand *> MMOs,
                    MCSymbol *PreInstrSymbol = nullptr,
                    MCSymbol *PostInstrSymbol = nullptr);

  MachineInstr::ExtraInfo *createMIExtraInfoWithMarker(
      ArrayRef<MachineMemOperand *> MMOs, MCSymbol *PreInstrSymbol,
      MCSymbol *PostInstrSymbol, MDNode *HeapAllocMarker);

  /// Allocate a string and populate it with the given external symbol name.
  const char *createExternalSymbolName(StringRef Name);
@@ -933,6 +938,14 @@ public:
    return CodeViewAnnotations;
  }

  /// Record heapallocsites
  void addCodeViewHeapAllocSite(MachineInstr *I, MDNode *MD);

  ArrayRef<std::tuple<MCSymbol*, MCSymbol*, DIType*>>
      getCodeViewHeapAllocSites() const {
    return CodeViewHeapAllocSites;
  }

  /// Return a reference to the C++ typeinfo for the current function.
  const std::vector<const GlobalValue *> &getTypeInfos() const {
    return TypeInfos;
+19 −1
Original line number Diff line number Diff line
@@ -446,7 +446,15 @@ MachineFunction::getMachineMemOperand(const MachineMemOperand *MMO,
      MMO->getOrdering(), MMO->getFailureOrdering());
}

MachineInstr::ExtraInfo *MachineFunction::createMIExtraInfo(
MachineInstr::ExtraInfo *
MachineFunction::createMIExtraInfo(ArrayRef<MachineMemOperand *> MMOs,
                                   MCSymbol *PreInstrSymbol,
                                   MCSymbol *PostInstrSymbol) {
  return MachineInstr::ExtraInfo::create(Allocator, MMOs, PreInstrSymbol,
                                         PostInstrSymbol, nullptr);
}

MachineInstr::ExtraInfo *MachineFunction::createMIExtraInfoWithMarker(
    ArrayRef<MachineMemOperand *> MMOs, MCSymbol *PreInstrSymbol,
    MCSymbol *PostInstrSymbol, MDNode *HeapAllocMarker) {
  return MachineInstr::ExtraInfo::create(Allocator, MMOs, PreInstrSymbol,
@@ -822,6 +830,16 @@ try_next:;
  return FilterID;
}

void MachineFunction::addCodeViewHeapAllocSite(MachineInstr *I, MDNode *MD) {
  MCSymbol *BeginLabel = Ctx.createTempSymbol("heapallocsite", true);
  MCSymbol *EndLabel = Ctx.createTempSymbol("heapallocsite", true);
  I->setPreInstrSymbol(*this, BeginLabel);
  I->setPostInstrSymbol(*this, EndLabel);

  DIType *DI = dyn_cast<DIType>(MD);
  CodeViewHeapAllocSites.push_back(std::make_tuple(BeginLabel, EndLabel, DI));
}

void MachineFunction::updateCallSiteInfo(const MachineInstr *Old,
                                         const MachineInstr *New) {
  if (!Target.Options.EnableDebugEntryValues || Old == New)
+1 −1
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ void MachineInstr::setExtraInfo(MachineFunction &MF,
  // 32-bit pointers.
  // FIXME: Maybe we should make the symbols in the extra info mutable?
  else if (NumPointers > 1 || HasHeapAllocMarker) {
    Info.set<EIIK_OutOfLine>(MF.createMIExtraInfo(
    Info.set<EIIK_OutOfLine>(MF.createMIExtraInfoWithMarker(
        MMOs, PreInstrSymbol, PostInstrSymbol, HeapAllocMarker));
    return;
  }