================
@@ -165,6 +165,21 @@ void diagnosticHandler(const DiagnosticInfo &DI) {
   }
 }
 
+bool hasFatBinary(const ArgList &Args, MemoryBufferRef Buffer) {
+  if (Args.hasArg(OPT_dry_run) && Args.hasArg(OPT_assume_device_object))
+    return false;
+  if (identify_magic(Buffer.getBuffer()) != file_magic::elf_relocatable)
+    return false;
+  Expected<std::unique_ptr<ObjectFile>> ObjFile =
+      ObjectFile::createObjectFile(Buffer);
+  if (!ObjFile) {
+    consumeError(ObjFile.takeError());
+    return false;
+  }
----------------
jhuber6 wrote:

Isn't that what this does? It consumed the error and returns false if it's in 
an error state.

https://github.com/llvm/llvm-project/pull/165519
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to