[llvm] [llvm-ar][Object][COFF] Compute UseECMap in computeMemberData. (PR #85230)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 13:53:52 PDT 2024


================
@@ -678,6 +678,25 @@ static bool isECObject(object::SymbolicFile &Obj) {
   return false;
 }
 
+static bool useECMap(object::SymbolicFile &Obj) {
+  if (Obj.isCOFF())
+    return COFF::isAnyArm64(cast<COFFObjectFile>(&Obj)->getMachine());
+
+  if (Obj.isCOFFImportFile())
+    return COFF::isAnyArm64(cast<COFFImportFile>(&Obj)->getMachine());
+
+  if (Obj.isIR()) {
+    Expected<std::string> TripleStr =
+        getBitcodeTargetTriple(Obj.getMemoryBufferRef());
+    if (!TripleStr)
+      return false;
+    Triple T(*TripleStr);
+    return T.getArch() == Triple::aarch64;
----------------
efriedma-quic wrote:

Should we check that the target is COFF?

https://github.com/llvm/llvm-project/pull/85230


More information about the llvm-commits mailing list