Commit 995abe34 authored by Tim Northover's avatar Tim Northover
Browse files

[mach-o] avoid overly clever std::find_if

The bots were complaining (possibly because of a lack of traits on the iterator
I was trying to use). No functional change.

llvm-svn: 219843
parent ae5804f3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -74,6 +74,9 @@ public:
  /// actually be used.
  virtual uint32_t dwarfCompactUnwindType() = 0;

  /// Reference from an __eh_frame FDE to the CIE it's based on.
  virtual Reference::KindValue unwindRefToCIEKind() = 0;

  /// Reference from an __eh_frame FDE atom to the function it's
  /// describing. Usually pointer-sized and PC-relative, but differs in whether
  /// it needs to be in relocatable objects.
+4 −0
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@ public:
    return invalid;
  }

  Reference::KindValue unwindRefToCIEKind() override {
    return invalid;
  }

  Reference::KindValue unwindRefToFunctionKind() override {
    return invalid;
  }
+4 −0
Original line number Diff line number Diff line
@@ -91,6 +91,10 @@ public:
    return invalid;
  }

  Reference::KindValue unwindRefToCIEKind() override {
    return invalid;
  }

  Reference::KindValue unwindRefToFunctionKind() override {
    return invalid;
  }
+4 −0
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@ public:
    return invalid;
  }

  Reference::KindValue unwindRefToCIEKind() override {
    return negDelta32;
  }

  Reference::KindValue unwindRefToFunctionKind() override{
    return delta32;
  }
+14 −1
Original line number Diff line number Diff line
@@ -84,6 +84,10 @@ public:
    return imageOffsetGot;
  }

  Reference::KindValue unwindRefToCIEKind() override {
    return negDelta32;
  }

  Reference::KindValue unwindRefToFunctionKind() override{
    return unwindFDEToFunction;
  }
@@ -167,6 +171,7 @@ private:
    delta32,               /// ex: .long _foo - .
    delta64Anon,           /// ex: .quad L1 - .
    delta32Anon,           /// ex: .long L1 - .
    negDelta32,            /// ex: .long . - _foo

    // Kinds introduced by Passes:
    ripRel32GotLoadNowLea, /// Target of GOT load is in linkage unit so 
@@ -218,6 +223,7 @@ const Registry::KindStrings ArchHandler_x86_64::_sKindStrings[] = {
  LLD_KIND_STRING_ENTRY(pointer64), LLD_KIND_STRING_ENTRY(pointer64Anon),
  LLD_KIND_STRING_ENTRY(delta32), LLD_KIND_STRING_ENTRY(delta64),
  LLD_KIND_STRING_ENTRY(delta32Anon), LLD_KIND_STRING_ENTRY(delta64Anon),
  LLD_KIND_STRING_ENTRY(negDelta32),
  LLD_KIND_STRING_ENTRY(imageOffset), LLD_KIND_STRING_ENTRY(imageOffsetGot),
  LLD_KIND_STRING_ENTRY(unwindFDEToFunction),
  LLD_KIND_STRING_ENTRY(unwindInfoToEhFrame),
@@ -507,6 +513,9 @@ void ArchHandler_x86_64::applyFixupFinal(
    location[-2] = 0x8D;
    write32(*loc32, _swap, (targetAddress - (fixupAddress + 4)) + ref.addend());
    return;
  case negDelta32:
    write32(*loc32, _swap, fixupAddress - targetAddress + ref.addend());
    return;
  case lazyPointer:
  case lazyImmediateLocation:
    // do nothing
@@ -574,6 +583,9 @@ void ArchHandler_x86_64::applyFixupRelocatable(const Reference &ref,
  case delta64Anon:
    write64(*loc64, _swap, (targetAddress - fixupAddress) + ref.addend());
    return;
  case negDelta32:
    write32(*loc32, _swap, fixupAddress - targetAddress + ref.addend());
    return;
  case ripRel32GotLoadNowLea:
    llvm_unreachable("ripRel32GotLoadNowLea implies GOT pass was run");
    return;
@@ -675,6 +687,7 @@ void ArchHandler_x86_64::appendSectionRelocations(
    return;
  case unwindFDEToFunction:
  case unwindInfoToEhFrame:
  case negDelta32:
    return;
  case ripRel32GotLoadNowLea:
    llvm_unreachable("ripRel32GotLoadNowLea implies GOT pass was run");
Loading