Ignore:
Timestamp:
Jul 13, 2015, 2:11:13 PM (4 years ago)
Author:
cameron
Message:

Upgrade LLVM to 3.6.1

Location:
icGREP/icgrep-devel/llvm-3.6.1.src
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/llvm-3.6.1.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp

    r4574 r4664  
    178178
    179179template <typename Impl>
    180 void RuntimeDyldMachOCRTPBase<Impl>::finalizeLoad(const ObjectFile &ObjImg,
     180void RuntimeDyldMachOCRTPBase<Impl>::finalizeLoad(const ObjectFile &Obj,
    181181                                                  ObjSectionToIDMap &SectionMap) {
    182182  unsigned EHFrameSID = RTDYLD_INVALID_SECTION_ID;
    183183  unsigned TextSID = RTDYLD_INVALID_SECTION_ID;
    184184  unsigned ExceptTabSID = RTDYLD_INVALID_SECTION_ID;
    185   ObjSectionToIDMap::iterator i, e;
    186 
    187   for (i = SectionMap.begin(), e = SectionMap.end(); i != e; ++i) {
    188     const SectionRef &Section = i->first;
     185
     186  for (const auto &Section : Obj.sections()) {
    189187    StringRef Name;
    190188    Section.getName(Name);
    191     if (Name == "__eh_frame")
    192       EHFrameSID = i->second;
    193     else if (Name == "__text")
    194       TextSID = i->second;
     189
     190    // Force emission of the __text, __eh_frame, and __gcc_except_tab sections
     191    // if they're present. Otherwise call down to the impl to handle other
     192    // sections that have already been emitted.
     193    if (Name == "__text")
     194      TextSID = findOrEmitSection(Obj, Section, true, SectionMap);
     195    else if (Name == "__eh_frame")
     196      EHFrameSID = findOrEmitSection(Obj, Section, false, SectionMap);
    195197    else if (Name == "__gcc_except_tab")
    196       ExceptTabSID = i->second;
    197     else
    198       impl().finalizeSection(ObjImg, i->second, Section);
     198      ExceptTabSID = findOrEmitSection(Obj, Section, true, SectionMap);
     199    else {
     200      auto I = SectionMap.find(Section);
     201      if (I != SectionMap.end())
     202        impl().finalizeSection(Obj, I->second, Section);
     203    }
    199204  }
    200205  UnregisteredEHFrameSections.push_back(
     
    239244
    240245static int64_t computeDelta(SectionEntry *A, SectionEntry *B) {
    241   int64_t ObjDistance = A->ObjAddress - B->ObjAddress;
     246  int64_t ObjDistance =
     247    static_cast<int64_t>(A->ObjAddress) - static_cast<int64_t>(B->ObjAddress);
    242248  int64_t MemDistance = A->LoadAddress - B->LoadAddress;
    243249  return ObjDistance - MemDistance;
Note: See TracChangeset for help on using the changeset viewer.