[Openmp-commits] [PATCH] D49418: Also support several images for elf

Phabricator via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jul 18 00:28:49 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL337355: [libomptarget] Also support several images for elf (authored by jprotze, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D49418?vs=155839&id=156020#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49418

Files:
  openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp


Index: openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
===================================================================
--- openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
+++ openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
@@ -66,7 +66,7 @@
 
 /// Class containing all the device information.
 class RTLDeviceInfoTy {
-  std::vector<FuncOrGblEntryTy> FuncGblEntries;
+  std::vector<std::list<FuncOrGblEntryTy>> FuncGblEntries;
 
 public:
   std::list<DynLibTy> DynLibs;
@@ -76,7 +76,8 @@
                           __tgt_offload_entry *end) {
     assert(device_id < (int32_t)FuncGblEntries.size() &&
            "Unexpected device id!");
-    FuncOrGblEntryTy &E = FuncGblEntries[device_id];
+    FuncGblEntries[device_id].emplace_back();
+    FuncOrGblEntryTy &E = FuncGblEntries[device_id].back();
 
     E.Table.EntriesBegin = begin;
     E.Table.EntriesEnd = end;
@@ -86,7 +87,7 @@
   bool findOffloadEntry(int32_t device_id, void *addr) {
     assert(device_id < (int32_t)FuncGblEntries.size() &&
            "Unexpected device id!");
-    FuncOrGblEntryTy &E = FuncGblEntries[device_id];
+    FuncOrGblEntryTy &E = FuncGblEntries[device_id].back();
 
     for (__tgt_offload_entry *i = E.Table.EntriesBegin, *e = E.Table.EntriesEnd;
          i < e; ++i) {
@@ -101,7 +102,7 @@
   __tgt_target_table *getOffloadEntriesTable(int32_t device_id) {
     assert(device_id < (int32_t)FuncGblEntries.size() &&
            "Unexpected device id!");
-    FuncOrGblEntryTy &E = FuncGblEntries[device_id];
+    FuncOrGblEntryTy &E = FuncGblEntries[device_id].back();
 
     return &E.Table;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49418.156020.patch
Type: text/x-patch
Size: 1643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180718/a245e935/attachment.bin>


More information about the Openmp-commits mailing list