[PATCH] Use NativeReferenceIvarsV2 if necessary.

Shankar Kalpathi Easwaran shankarke at gmail.com
Tue Nov 19 09:02:37 PST 2013



================
Comment at: lib/ReaderWriter/Native/WriterNative.cpp:175-185
@@ +174,13 @@
+  // possible.
+  void maybeConvertReferencesToV1() {
+    std::set<int64_t> addends;
+    for (const NativeReferenceIvarsV2 &ref : _referencesV2) {
+      if (!canConvertReferenceToV1(ref))
+        return;
+      addends.insert(ref.addend);
+      if (addends.size() >= UINT16_MAX)
+        return;
+    }
+    convertReferencesToV1();
+  }
+
----------------
This converts either all references to V1 or everything remains V2. We might want to convert a part of the references if the targetIndex < UINT16_MAX and leave the rest to V2, if the targetIndex is higher than 16 bits.




http://llvm-reviews.chandlerc.com/D2217



More information about the llvm-commits mailing list