[llvm] r273915 - [yaml2obj] Remove --format option in favor of YAML tags
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 27 12:53:54 PDT 2016
Author: cbieneman
Date: Mon Jun 27 14:53:53 2016
New Revision: 273915
URL: http://llvm.org/viewvc/llvm-project?rev=273915&view=rev
Log:
[yaml2obj] Remove --format option in favor of YAML tags
Summary:
Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that.
Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are:
!ELF
!COFF
!mach-o
!fat-mach-o
I have a corresponding patch that is quite large that fixes up all the in-tree test cases.
Reviewers: rafael, Bigcheese, compnerd, silvas
Subscribers: compnerd, llvm-commits
Differential Revision: http://reviews.llvm.org/D21711
Added:
llvm/trunk/include/llvm/ObjectYAML/ObjectYAML.h
llvm/trunk/lib/ObjectYAML/ObjectYAML.cpp
llvm/trunk/test/tools/yaml2obj/
llvm/trunk/test/tools/yaml2obj/missing_document_tag.yaml
llvm/trunk/test/tools/yaml2obj/unsupported_document_tag.yaml
Modified:
llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h
llvm/trunk/lib/ObjectYAML/CMakeLists.txt
llvm/trunk/lib/ObjectYAML/COFFYAML.cpp
llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
llvm/trunk/lib/ObjectYAML/MachOYAML.cpp
llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml
llvm/trunk/test/Object/AMDGPU/elf-definitios.yaml
llvm/trunk/test/Object/AMDGPU/elf32-unknown.yaml
llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml
llvm/trunk/test/Object/AMDGPU/elf64-unknown.yaml
llvm/trunk/test/Object/Inputs/COFF/i386.yaml
llvm/trunk/test/Object/Inputs/COFF/long-file-symbol.yaml
llvm/trunk/test/Object/Inputs/COFF/long-section-name.yaml
llvm/trunk/test/Object/Inputs/COFF/section-aux-symbol.yaml
llvm/trunk/test/Object/Inputs/COFF/weak-external.yaml
llvm/trunk/test/Object/Inputs/COFF/weak-externals.yaml
llvm/trunk/test/Object/Inputs/COFF/x86-64.yaml
llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml
llvm/trunk/test/Object/Mips/abi-flags.yaml
llvm/trunk/test/Object/Mips/elf-abi.yaml
llvm/trunk/test/Object/Mips/elf-flags.yaml
llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml
llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml
llvm/trunk/test/Object/elf-unknown-type.test
llvm/trunk/test/Object/obj2yaml-sectiongroup.test
llvm/trunk/test/Object/yaml2obj-coff-invalid-alignment.test
llvm/trunk/test/Object/yaml2obj-coff-multi-doc.test
llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml
llvm/trunk/test/Object/yaml2obj-elf-bits-endian.test
llvm/trunk/test/Object/yaml2obj-elf-file-headers-with-e_flags.yaml
llvm/trunk/test/Object/yaml2obj-elf-file-headers.yaml
llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test
llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml
llvm/trunk/test/Object/yaml2obj-elf-rel.yaml
llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml
llvm/trunk/test/Object/yaml2obj-elf-section-invalid-size.yaml
llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml
llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml
llvm/trunk/test/ObjectYAML/MachO/bind_opcode.yaml
llvm/trunk/test/ObjectYAML/MachO/bogus_load_command.yaml
llvm/trunk/test/ObjectYAML/MachO/dylib_dylinker_command.yaml
llvm/trunk/test/ObjectYAML/MachO/export_trie.yaml
llvm/trunk/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml
llvm/trunk/test/ObjectYAML/MachO/lazy_bind_opcode.yaml
llvm/trunk/test/ObjectYAML/MachO/load_commands.yaml
llvm/trunk/test/ObjectYAML/MachO/mach_header.yaml
llvm/trunk/test/ObjectYAML/MachO/mach_header_32_malformed.yaml
llvm/trunk/test/ObjectYAML/MachO/mach_header_64.yaml
llvm/trunk/test/ObjectYAML/MachO/out_of_order_linkedit.yaml
llvm/trunk/test/ObjectYAML/MachO/rebase_opcode.yaml
llvm/trunk/test/ObjectYAML/MachO/sections.yaml
llvm/trunk/test/ObjectYAML/MachO/symtab.yaml
llvm/trunk/test/ObjectYAML/MachO/weak_bind_opcode.yaml
llvm/trunk/test/tools/llvm-ar/Inputs/coff.yaml
llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml
llvm/trunk/test/tools/llvm-ar/default-add.test
llvm/trunk/test/tools/llvm-ar/default-coff.test
llvm/trunk/test/tools/llvm-ar/default-elf.test
llvm/trunk/test/tools/llvm-ar/default-macho.test
llvm/trunk/test/tools/llvm-ar/override.test
llvm/trunk/test/tools/llvm-objdump/Inputs/file-aux-record.yaml
llvm/trunk/test/tools/llvm-readobj/Inputs/file-aux-record.yaml
llvm/trunk/test/tools/llvm-readobj/Inputs/file-multiple-aux-records.yaml
llvm/trunk/test/tools/llvm-readobj/elf-sec-flags.test
llvm/trunk/test/tools/sanstats/elf.test
llvm/trunk/tools/obj2yaml/macho2yaml.cpp
llvm/trunk/tools/yaml2obj/yaml2coff.cpp
llvm/trunk/tools/yaml2obj/yaml2elf.cpp
llvm/trunk/tools/yaml2obj/yaml2macho.cpp
llvm/trunk/tools/yaml2obj/yaml2obj.cpp
llvm/trunk/tools/yaml2obj/yaml2obj.h
Modified: llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h (original)
+++ llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h Mon Jun 27 14:53:53 2016
@@ -129,12 +129,6 @@ struct UniversalBinary {
std::vector<Object> Slices;
};
-struct MachFile {
- bool isFat;
- UniversalBinary FatFile;
- Object ThinFile;
-};
-
} // namespace llvm::MachOYAML
} // namespace llvm
@@ -174,10 +168,6 @@ template <> struct MappingTraits<MachOYA
static void mapping(IO &IO, MachOYAML::UniversalBinary &UniversalBinary);
};
-template <> struct MappingTraits<MachOYAML::MachFile> {
- static void mapping(IO &IO, MachOYAML::MachFile &MachFile);
-};
-
template <> struct MappingTraits<MachOYAML::LoadCommand> {
static void mapping(IO &IO, MachOYAML::LoadCommand &LoadCommand);
};
Added: llvm/trunk/include/llvm/ObjectYAML/ObjectYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ObjectYAML/ObjectYAML.h?rev=273915&view=auto
==============================================================================
--- llvm/trunk/include/llvm/ObjectYAML/ObjectYAML.h (added)
+++ llvm/trunk/include/llvm/ObjectYAML/ObjectYAML.h Mon Jun 27 14:53:53 2016
@@ -0,0 +1,35 @@
+//===- ObjectYAML.h ---------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_OBJECTYAML_OBJECTYAML_H
+#define LLVM_OBJECTYAML_OBJECTYAML_H
+
+#include "llvm/Support/YAMLTraits.h"
+#include "llvm/ObjectYAML/ELFYAML.h"
+#include "llvm/ObjectYAML/COFFYAML.h"
+#include "llvm/ObjectYAML/MachOYAML.h"
+
+namespace llvm {
+namespace yaml {
+
+struct YamlObjectFile {
+ std::unique_ptr<ELFYAML::Object> Elf;
+ std::unique_ptr<COFFYAML::Object> Coff;
+ std::unique_ptr<MachOYAML::Object> MachO;
+ std::unique_ptr<MachOYAML::UniversalBinary> FatMachO;
+};
+
+template <> struct MappingTraits<YamlObjectFile> {
+ static void mapping(IO &IO, YamlObjectFile &ObjectFile);
+};
+
+} // namespace yaml
+} // namespace llvm
+
+#endif
Modified: llvm/trunk/lib/ObjectYAML/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/CMakeLists.txt?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/CMakeLists.txt (original)
+++ llvm/trunk/lib/ObjectYAML/CMakeLists.txt Mon Jun 27 14:53:53 2016
@@ -3,4 +3,5 @@ add_llvm_library(LLVMObjectYAML
COFFYAML.cpp
ELFYAML.cpp
MachOYAML.cpp
+ ObjectYAML.cpp
)
Modified: llvm/trunk/lib/ObjectYAML/COFFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/COFFYAML.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/COFFYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/COFFYAML.cpp Mon Jun 27 14:53:53 2016
@@ -493,6 +493,7 @@ void MappingTraits<COFFYAML::Section>::m
}
void MappingTraits<COFFYAML::Object>::mapping(IO &IO, COFFYAML::Object &Obj) {
+ IO.mapTag("!COFF", true);
IO.mapOptional("OptionalHeader", Obj.OptionalHeader);
IO.mapRequired("header", Obj.Header);
IO.mapRequired("sections", Obj.Sections);
Modified: llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/ELFYAML.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/ELFYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/ELFYAML.cpp Mon Jun 27 14:53:53 2016
@@ -820,6 +820,7 @@ void MappingTraits<ELFYAML::Relocation>:
void MappingTraits<ELFYAML::Object>::mapping(IO &IO, ELFYAML::Object &Object) {
assert(!IO.getContext() && "The IO context is initialized already");
IO.setContext(&Object);
+ IO.mapTag("!ELF", true);
IO.mapRequired("FileHeader", Object.Header);
IO.mapOptional("Sections", Object.Sections);
IO.mapOptional("Symbols", Object.Symbols);
Modified: llvm/trunk/lib/ObjectYAML/MachOYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/MachOYAML.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/MachOYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/MachOYAML.cpp Mon Jun 27 14:53:53 2016
@@ -132,34 +132,6 @@ void MappingTraits<MachOYAML::UniversalB
IO.setContext(nullptr);
}
-void MappingTraits<MachOYAML::MachFile>::mapping(
- IO &IO, MachOYAML::MachFile &MachFile) {
- if (!IO.getContext()) {
- IO.setContext(&MachFile);
- }
- if (IO.outputting()) {
- if (MachFile.isFat) {
- IO.mapTag("!fat-mach-o", true);
- MappingTraits<MachOYAML::UniversalBinary>::mapping(IO, MachFile.FatFile);
- } else {
- IO.mapTag("!mach-o", true);
- MappingTraits<MachOYAML::Object>::mapping(IO, MachFile.ThinFile);
- }
- } else {
- if (IO.mapTag("!fat-mach-o")) {
- MachFile.isFat = true;
- MappingTraits<MachOYAML::UniversalBinary>::mapping(IO, MachFile.FatFile);
- } else if (IO.mapTag("!mach-o")) {
- MachFile.isFat = false;
- MappingTraits<MachOYAML::Object>::mapping(IO, MachFile.ThinFile);
- } else {
- assert(false && "No tag found in YAML, cannot identify file type!");
- }
- }
- if (IO.getContext() == &MachFile)
- IO.setContext(nullptr);
-}
-
void MappingTraits<MachOYAML::LinkEditData>::mapping(
IO &IO, MachOYAML::LinkEditData &LinkEditData) {
IO.mapOptional("RebaseOpcodes", LinkEditData.RebaseOpcodes);
Added: llvm/trunk/lib/ObjectYAML/ObjectYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/ObjectYAML.cpp?rev=273915&view=auto
==============================================================================
--- llvm/trunk/lib/ObjectYAML/ObjectYAML.cpp (added)
+++ llvm/trunk/lib/ObjectYAML/ObjectYAML.cpp Mon Jun 27 14:53:53 2016
@@ -0,0 +1,57 @@
+//===- ObjectYAML.cpp - YAML utilities for object files -------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines a wrapper class for handling tagged YAML input
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ObjectYAML/YAML.h"
+#include "llvm/ObjectYAML/ObjectYAML.h"
+
+using namespace llvm;
+using namespace yaml;
+
+void MappingTraits<YamlObjectFile>::mapping(IO &IO,
+ YamlObjectFile &ObjectFile) {
+ if (IO.outputting()) {
+ if (ObjectFile.Elf)
+ MappingTraits<ELFYAML::Object>::mapping(IO, *ObjectFile.Elf);
+ if (ObjectFile.Coff)
+ MappingTraits<COFFYAML::Object>::mapping(IO, *ObjectFile.Coff);
+ if (ObjectFile.MachO)
+ MappingTraits<MachOYAML::Object>::mapping(IO, *ObjectFile.MachO);
+ if (ObjectFile.FatMachO)
+ MappingTraits<MachOYAML::UniversalBinary>::mapping(IO,
+ *ObjectFile.FatMachO);
+ } else {
+ if (IO.mapTag("!ELF")) {
+ ObjectFile.Elf.reset(new ELFYAML::Object());
+ MappingTraits<ELFYAML::Object>::mapping(IO, *ObjectFile.Elf);
+ } else if (IO.mapTag("!COFF")) {
+ ObjectFile.Coff.reset(new COFFYAML::Object());
+ MappingTraits<COFFYAML::Object>::mapping(IO, *ObjectFile.Coff);
+ } else if (IO.mapTag("!mach-o")) {
+ ObjectFile.MachO.reset(new MachOYAML::Object());
+ MappingTraits<MachOYAML::Object>::mapping(IO, *ObjectFile.MachO);
+ } else if (IO.mapTag("!fat-mach-o")) {
+ ObjectFile.FatMachO.reset(new MachOYAML::UniversalBinary());
+ MappingTraits<MachOYAML::UniversalBinary>::mapping(IO,
+ *ObjectFile.FatMachO);
+ } else {
+ Input &In = (Input &)IO;
+ std::string Tag = In.getCurrentNode()->getRawTag();
+ if (Tag.empty())
+ IO.setError("YAML Object File missing document type tag!");
+ else
+ IO.setError(
+ llvm::Twine("YAML Object File unsupported document type tag '") +
+ llvm::Twine(Tag.c_str()) + llvm::Twine("'!"));
+ }
+ }
+}
Modified: llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml (original)
+++ llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: obj2yaml %t | FileCheck %s
# CHECK: - Name: .rela.text
@@ -14,6 +14,7 @@
# CHECK-NEXT: Symbol: main
# CHECK-NEXT: Type: R_AARCH64_TLSGD_ADR_PREL21
+!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/AMDGPU/elf-definitios.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AMDGPU/elf-definitios.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/AMDGPU/elf-definitios.yaml (original)
+++ llvm/trunk/test/Object/AMDGPU/elf-definitios.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: yaml2obj %s > %t.o
# RUN: llvm-readobj -s -file-headers %t.o | FileCheck %s
# CHECK: Format: ELF64-amdgpu-hsacobj
@@ -14,7 +14,7 @@
# CHECK: SHF_AMDGPU_HSA_READONLY (0x200000)
# CHECK: }
----
+--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/AMDGPU/elf32-unknown.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AMDGPU/elf32-unknown.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/AMDGPU/elf32-unknown.yaml (original)
+++ llvm/trunk/test/Object/AMDGPU/elf32-unknown.yaml Mon Jun 27 14:53:53 2016
@@ -1,9 +1,9 @@
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: yaml2obj %s > %t.o
# RUN: llvm-readobj -s -file-headers %t.o | FileCheck %s
# CHECK: Format: ELF32-amdgpu
----
+--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml (original)
+++ llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: llvm-readobj -r %t | FileCheck %s
# CHECK: Relocations [
@@ -13,6 +13,7 @@
# CHECK: }
# CHECK: ]
+!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/AMDGPU/elf64-unknown.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AMDGPU/elf64-unknown.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/AMDGPU/elf64-unknown.yaml (original)
+++ llvm/trunk/test/Object/AMDGPU/elf64-unknown.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: yaml2obj %s > %t.o
# RUN: llvm-readobj -s -file-headers %t.o | FileCheck %s
# CHECK: Format: ELF64-amdgpu
Modified: llvm/trunk/test/Object/Inputs/COFF/i386.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/COFF/i386.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Inputs/COFF/i386.yaml (original)
+++ llvm/trunk/test/Object/Inputs/COFF/i386.yaml Mon Jun 27 14:53:53 2016
@@ -1,3 +1,4 @@
+!COFF
header: !Header
Machine: IMAGE_FILE_MACHINE_I386 # (0x14c)
Characteristics: [ IMAGE_FILE_DEBUG_STRIPPED ]
Modified: llvm/trunk/test/Object/Inputs/COFF/long-file-symbol.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/COFF/long-file-symbol.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Inputs/COFF/long-file-symbol.yaml (original)
+++ llvm/trunk/test/Object/Inputs/COFF/long-file-symbol.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_AMD64
Characteristics: [ IMAGE_FILE_RELOCS_STRIPPED, IMAGE_FILE_LINE_NUMS_STRIPPED ]
Modified: llvm/trunk/test/Object/Inputs/COFF/long-section-name.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/COFF/long-section-name.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Inputs/COFF/long-section-name.yaml (original)
+++ llvm/trunk/test/Object/Inputs/COFF/long-section-name.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_I386
Characteristics: [ IMAGE_FILE_RELOCS_STRIPPED, IMAGE_FILE_LINE_NUMS_STRIPPED, IMAGE_FILE_LOCAL_SYMS_STRIPPED, IMAGE_FILE_32BIT_MACHINE ]
Modified: llvm/trunk/test/Object/Inputs/COFF/section-aux-symbol.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/COFF/section-aux-symbol.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Inputs/COFF/section-aux-symbol.yaml (original)
+++ llvm/trunk/test/Object/Inputs/COFF/section-aux-symbol.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_I386
Characteristics: [ IMAGE_FILE_RELOCS_STRIPPED, IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LINE_NUMS_STRIPPED, IMAGE_FILE_32BIT_MACHINE, IMAGE_FILE_DEBUG_STRIPPED ]
Modified: llvm/trunk/test/Object/Inputs/COFF/weak-external.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/COFF/weak-external.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Inputs/COFF/weak-external.yaml (original)
+++ llvm/trunk/test/Object/Inputs/COFF/weak-external.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_I386
Characteristics: [ IMAGE_FILE_LINE_NUMS_STRIPPED, IMAGE_FILE_32BIT_MACHINE ]
Modified: llvm/trunk/test/Object/Inputs/COFF/weak-externals.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/COFF/weak-externals.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Inputs/COFF/weak-externals.yaml (original)
+++ llvm/trunk/test/Object/Inputs/COFF/weak-externals.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_ARMNT
Characteristics: [ ]
Modified: llvm/trunk/test/Object/Inputs/COFF/x86-64.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/COFF/x86-64.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Inputs/COFF/x86-64.yaml (original)
+++ llvm/trunk/test/Object/Inputs/COFF/x86-64.yaml Mon Jun 27 14:53:53 2016
@@ -1,3 +1,4 @@
+!COFF
header: !Header
Machine: IMAGE_FILE_MACHINE_AMD64 # (0x8664)
Modified: llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml (original)
+++ llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: llvm-readobj -r %t | FileCheck %s
# CHECK: Relocations [
@@ -13,6 +13,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
+!ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/Mips/abi-flags.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/abi-flags.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/abi-flags.yaml (original)
+++ llvm/trunk/test/Object/Mips/abi-flags.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: llvm-readobj -mips-abi-flags %t | FileCheck -check-prefix=OBJ %s
# RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s
@@ -34,6 +34,7 @@
# YAML-NEXT: CPR1Size: REG_64
# YAML-NEXT: Flags1: [ ODDSPREG ]
+!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2MSB
Modified: llvm/trunk/test/Object/Mips/elf-abi.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/elf-abi.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/elf-abi.yaml (original)
+++ llvm/trunk/test/Object/Mips/elf-abi.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf -docnum=1 %s > %t.o32
+# RUN: yaml2obj -docnum=1 %s > %t.o32
# RUN: llvm-readobj -file-headers %t.o32 | FileCheck -check-prefix=O32OBJ %s
# RUN: obj2yaml %t.o32 | FileCheck -check-prefix=O32YAML %s
@@ -10,7 +10,7 @@
# O32YAML: Flags: [ EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
-# RUN: yaml2obj -format=elf -docnum=2 %s > %t.o64
+# RUN: yaml2obj -docnum=2 %s > %t.o64
# RUN: llvm-readobj -file-headers %t.o64 | FileCheck -check-prefix=O64OBJ %s
# RUN: obj2yaml %t.o64 | FileCheck -check-prefix=O64YAML %s
@@ -22,7 +22,7 @@
# O64YAML: Flags: [ EF_MIPS_PIC, EF_MIPS_ABI_O64, EF_MIPS_ARCH_64 ]
-# RUN: yaml2obj -format=elf -docnum=3 %s > %t.eabi32
+# RUN: yaml2obj -docnum=3 %s > %t.eabi32
# RUN: llvm-readobj -file-headers %t.eabi32 | FileCheck -check-prefix=E32OBJ %s
# RUN: obj2yaml %t.eabi32 | FileCheck -check-prefix=E32YAML %s
@@ -34,7 +34,7 @@
# E32YAML: Flags: [ EF_MIPS_PIC, EF_MIPS_ABI_EABI32, EF_MIPS_ARCH_32 ]
-# RUN: yaml2obj -format=elf -docnum=4 %s > %t.eabi64
+# RUN: yaml2obj -docnum=4 %s > %t.eabi64
# RUN: llvm-readobj -file-headers %t.eabi64 | FileCheck -check-prefix=E64OBJ %s
# RUN: obj2yaml %t.eabi64 | FileCheck -check-prefix=E64YAML %s
@@ -47,7 +47,7 @@
# E64YAML: Flags: [ EF_MIPS_PIC, EF_MIPS_ABI_EABI64, EF_MIPS_ARCH_64 ]
# o32
----
+--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/Mips/elf-flags.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/elf-flags.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/elf-flags.yaml (original)
+++ llvm/trunk/test/Object/Mips/elf-flags.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: llvm-readobj -file-headers %t | FileCheck -check-prefix=OBJ %s
# RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s
@@ -25,7 +25,7 @@
# YAML-NEXT: Machine: EM_MIPS
# YAML-NEXT: Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI2, EF_MIPS_32BITMODE, EF_MIPS_FP64, EF_MIPS_NAN2008, EF_MIPS_MICROMIPS, EF_MIPS_ARCH_ASE_M16, EF_MIPS_ARCH_ASE_MDMX, EF_MIPS_ABI_O32, EF_MIPS_MACH_OCTEON, EF_MIPS_ARCH_32R6 ]
----
+--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml (original)
+++ llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: llvm-readobj -r %t | FileCheck -check-prefix=OBJ %s
# RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s
@@ -41,7 +41,7 @@
# YAML-NEXT: Type2: R_MIPS_LO16
# YAML-NEXT: SpecSym: RSS_GP0
----
+--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml (original)
+++ llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: llvm-readobj -r %t | FileCheck %s
# CHECK: Relocations [
@@ -7,6 +7,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
+!ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/elf-unknown-type.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/elf-unknown-type.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/elf-unknown-type.test (original)
+++ llvm/trunk/test/Object/elf-unknown-type.test Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -file-headers - | FileCheck %s
+# RUN: yaml2obj %s | llvm-readobj -file-headers - | FileCheck %s
!ELF
FileHeader: !FileHeader
Modified: llvm/trunk/test/Object/obj2yaml-sectiongroup.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml-sectiongroup.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml-sectiongroup.test (original)
+++ llvm/trunk/test/Object/obj2yaml-sectiongroup.test Mon Jun 27 14:53:53 2016
@@ -1,7 +1,7 @@
# Checks that the tool is able to read section groups with ELF.
RUN: obj2yaml %p/Inputs/sectionGroup.elf.x86-64 > %t1.sectiongroup.yaml
RUN: FileCheck %s --check-prefix ELF-GROUP < %t1.sectiongroup.yaml
-RUN: yaml2obj -format=elf %t1.sectiongroup.yaml -o %t2.o.elf
+RUN: yaml2obj %t1.sectiongroup.yaml -o %t2.o.elf
RUN: llvm-readobj -sections %t2.o.elf | FileCheck %s -check-prefix=SECTIONS
#ELF-GROUP: - Name: .group
#ELF-GROUP: Type: SHT_GROUP
Modified: llvm/trunk/test/Object/yaml2obj-coff-invalid-alignment.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-coff-invalid-alignment.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-coff-invalid-alignment.test (original)
+++ llvm/trunk/test/Object/yaml2obj-coff-invalid-alignment.test Mon Jun 27 14:53:53 2016
@@ -2,7 +2,7 @@
# CHECK: Section alignment is too large
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_AMD64
Characteristics: []
Modified: llvm/trunk/test/Object/yaml2obj-coff-multi-doc.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-coff-multi-doc.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-coff-multi-doc.test (original)
+++ llvm/trunk/test/Object/yaml2obj-coff-multi-doc.test Mon Jun 27 14:53:53 2016
@@ -1,15 +1,15 @@
-# RUN: yaml2obj -format=coff -docnum=1 %s \
+# RUN: yaml2obj -docnum=1 %s \
# RUN: | llvm-readobj -symbols - | FileCheck -check-prefix=DOC1 %s
-# RUN: yaml2obj -format=coff -docnum=2 %s \
+# RUN: yaml2obj -docnum=2 %s \
# RUN: | llvm-readobj -symbols - | FileCheck -check-prefix=DOC2 %s
-# RUN: not yaml2obj -format=coff -docnum=3 %s 2>&1 \
+# RUN: not yaml2obj -docnum=3 %s 2>&1 \
# RUN: | FileCheck -check-prefix=DOC3 %s
# DOC1: Name: _sym1
# DOC2: Name: _sym2
# DOC3: yaml2obj: Cannot find the 3rd document
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_I386
Characteristics: [ IMAGE_FILE_DEBUG_STRIPPED ]
@@ -49,7 +49,7 @@ symbols:
ComplexType: IMAGE_SYM_DTYPE_NULL
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_I386
Characteristics: [ IMAGE_FILE_DEBUG_STRIPPED ]
Modified: llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml Mon Jun 27 14:53:53 2016
@@ -1,6 +1,6 @@
# Check that yaml2obj takes in account section AddressAlign field.
-# RUN: yaml2obj -format=elf %s > %t
+# RUN: yaml2obj %s > %t
# RUN: llvm-readobj -s %t | FileCheck %s
# CHECK: Section {
@@ -20,7 +20,7 @@
# CHECK-NEXT: EntrySize: 0
# CHECK-NEXT: }
----
+--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Modified: llvm/trunk/test/Object/yaml2obj-elf-bits-endian.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-bits-endian.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-bits-endian.test (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-bits-endian.test Mon Jun 27 14:53:53 2016
@@ -1,7 +1,7 @@
-RUN: yaml2obj -format=elf %p/Inputs/ELF/LE64.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix LE64
-RUN: yaml2obj -format=elf %p/Inputs/ELF/BE64.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix BE64
-RUN: yaml2obj -format=elf %p/Inputs/ELF/LE32.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix LE32
-RUN: yaml2obj -format=elf %p/Inputs/ELF/BE32.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix BE32
+RUN: yaml2obj %p/Inputs/ELF/LE64.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix LE64
+RUN: yaml2obj %p/Inputs/ELF/BE64.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix BE64
+RUN: yaml2obj %p/Inputs/ELF/LE32.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix LE32
+RUN: yaml2obj %p/Inputs/ELF/BE32.yaml | llvm-readobj -file-headers - | FileCheck %s --check-prefix BE32
LE64: Class: 64-bit (0x2)
LE64-NEXT: DataEncoding: LittleEndian (0x1)
Modified: llvm/trunk/test/Object/yaml2obj-elf-file-headers-with-e_flags.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-file-headers-with-e_flags.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-file-headers-with-e_flags.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-file-headers-with-e_flags.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -file-headers - | FileCheck %s
+# RUN: yaml2obj %s | llvm-readobj -file-headers - | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS32
Modified: llvm/trunk/test/Object/yaml2obj-elf-file-headers.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-file-headers.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-file-headers.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-file-headers.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -file-headers - | FileCheck %s
+# RUN: yaml2obj %s | llvm-readobj -file-headers - | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS64
Modified: llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test Mon Jun 27 14:53:53 2016
@@ -1,8 +1,8 @@
-# RUN: yaml2obj -format=elf -docnum=1 %s \
+# RUN: yaml2obj -docnum=1 %s \
# RUN: | llvm-readobj -symbols - | FileCheck -check-prefix=DOC1 %s
-# RUN: yaml2obj -format=elf -docnum=2 %s \
+# RUN: yaml2obj -docnum=2 %s \
# RUN: | llvm-readobj -symbols - | FileCheck -check-prefix=DOC2 %s
-# RUN: not yaml2obj -format=elf -docnum=3 %s 2>&1 \
+# RUN: not yaml2obj -docnum=3 %s 2>&1 \
# RUN: | FileCheck -check-prefix=DOC3 %s
# DOC1: Name: T1 (1)
Modified: llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -sections -relocations - | FileCheck %s
+# RUN: yaml2obj %s | llvm-readobj -sections -relocations - | FileCheck %s
!ELF
FileHeader: !FielHeader
Modified: llvm/trunk/test/Object/yaml2obj-elf-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-rel.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-rel.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-rel.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -sections -relocations - | FileCheck %s
+# RUN: yaml2obj %s | llvm-readobj -sections -relocations - | FileCheck %s
!ELF
FileHeader: !FileHeader
Modified: llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml Mon Jun 27 14:53:53 2016
@@ -1,5 +1,5 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -sections -section-data - | FileCheck %s
-# RUN: yaml2obj -format=elf -o %t %s
+# RUN: yaml2obj %s | llvm-readobj -sections -section-data - | FileCheck %s
+# RUN: yaml2obj -o %t %s
# RUN: llvm-readobj -sections -section-data %t | FileCheck %s
!ELF
Modified: llvm/trunk/test/Object/yaml2obj-elf-section-invalid-size.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-section-invalid-size.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-section-invalid-size.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-section-invalid-size.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: not yaml2obj -format=elf -o %t %s 2>&1 | FileCheck %s
+# RUN: not yaml2obj -o %t %s 2>&1 | FileCheck %s
!ELF
FileHeader:
Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -symbols - | FileCheck %s
+# RUN: yaml2obj %s | llvm-readobj -symbols - | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS64
Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -symbols - | FileCheck %s
+# RUN: yaml2obj %s | llvm-readobj -symbols - | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS64
Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml Mon Jun 27 14:53:53 2016
@@ -1,6 +1,6 @@
-# RUN: yaml2obj -format=elf %s | llvm-readobj -symbols - | \
+# RUN: yaml2obj %s | llvm-readobj -symbols - | \
# RUN: FileCheck --check-prefix OBJ %s
-# RUN: yaml2obj -format=elf %s | obj2yaml - | FileCheck --check-prefix YAML %s
+# RUN: yaml2obj %s | obj2yaml - | FileCheck --check-prefix YAML %s
# OBJ: Symbol {
# OBJ: Name: default1 (36)
@@ -87,7 +87,7 @@
# YAML-NEXT: Visibility: STV_PROTECTED
# YAML-NEXT: Other: [ STO_MIPS_PIC, STO_MIPS_MICROMIPS ]
----
+--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Modified: llvm/trunk/test/ObjectYAML/MachO/bind_opcode.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/bind_opcode.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/bind_opcode.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/bind_opcode.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/bogus_load_command.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/bogus_load_command.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/bogus_load_command.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/bogus_load_command.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/dylib_dylinker_command.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/dylib_dylinker_command.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/dylib_dylinker_command.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/dylib_dylinker_command.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/export_trie.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/export_trie.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/export_trie.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/export_trie.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !fat-mach-o
FatHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/lazy_bind_opcode.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/lazy_bind_opcode.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/lazy_bind_opcode.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/lazy_bind_opcode.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/load_commands.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/load_commands.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/load_commands.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/load_commands.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/mach_header.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/mach_header.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/mach_header.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/mach_header.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/mach_header_32_malformed.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/mach_header_32_malformed.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/mach_header_32_malformed.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/mach_header_32_malformed.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: not yaml2obj -format=macho %s 2>&1 | FileCheck %s
+# RUN: not yaml2obj %s 2>&1 | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/mach_header_64.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/mach_header_64.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/mach_header_64.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/mach_header_64.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/out_of_order_linkedit.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/out_of_order_linkedit.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/out_of_order_linkedit.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/out_of_order_linkedit.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/rebase_opcode.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/rebase_opcode.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/rebase_opcode.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/rebase_opcode.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/sections.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/sections.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/sections.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/sections.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/symtab.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/symtab.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/symtab.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/symtab.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/ObjectYAML/MachO/weak_bind_opcode.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ObjectYAML/MachO/weak_bind_opcode.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/ObjectYAML/MachO/weak_bind_opcode.yaml (original)
+++ llvm/trunk/test/ObjectYAML/MachO/weak_bind_opcode.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-# RUN: yaml2obj -format=macho %s | obj2yaml | FileCheck %s
+# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !mach-o
FileHeader:
Modified: llvm/trunk/test/tools/llvm-ar/Inputs/coff.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/Inputs/coff.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/Inputs/coff.yaml (original)
+++ llvm/trunk/test/tools/llvm-ar/Inputs/coff.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
----
+--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_AMD64
Characteristics: [ ]
Modified: llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml (original)
+++ llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
----
+--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Modified: llvm/trunk/test/tools/llvm-ar/default-add.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/default-add.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/default-add.test (original)
+++ llvm/trunk/test/tools/llvm-ar/default-add.test Mon Jun 27 14:53:53 2016
@@ -1,5 +1,5 @@
-RUN: yaml2obj -format macho %S/Inputs/macho.yaml -o %t-macho.o
-RUN: yaml2obj -format coff %S/Inputs/coff.yaml -o %t-coff.o
+RUN: yaml2obj %S/Inputs/macho.yaml -o %t-macho.o
+RUN: yaml2obj %S/Inputs/coff.yaml -o %t-coff.o
RUN: rm -f %t.ar
RUN: llvm-ar crs %t.ar %t-macho.o
Modified: llvm/trunk/test/tools/llvm-ar/default-coff.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/default-coff.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/default-coff.test (original)
+++ llvm/trunk/test/tools/llvm-ar/default-coff.test Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-RUN: yaml2obj -format coff %S/Inputs/coff.yaml -o %t.obj
+RUN: yaml2obj %S/Inputs/coff.yaml -o %t.obj
RUN: rm -f %t.ar
RUN: llvm-ar crs %t.ar %t.obj
Modified: llvm/trunk/test/tools/llvm-ar/default-elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/default-elf.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/default-elf.test (original)
+++ llvm/trunk/test/tools/llvm-ar/default-elf.test Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-RUN: yaml2obj -format elf %S/Inputs/elf.yaml -o %t.o
+RUN: yaml2obj %S/Inputs/elf.yaml -o %t.o
RUN: rm -f %t.ar
RUN: llvm-ar crs %t.ar %t.o
Modified: llvm/trunk/test/tools/llvm-ar/default-macho.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/default-macho.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/default-macho.test (original)
+++ llvm/trunk/test/tools/llvm-ar/default-macho.test Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-RUN: yaml2obj -format macho %S/Inputs/macho.yaml -o %t.o
+RUN: yaml2obj %S/Inputs/macho.yaml -o %t.o
RUN: rm -f %t.ar
RUN: llvm-ar crs %t.ar %t.o
Modified: llvm/trunk/test/tools/llvm-ar/override.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/override.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/override.test (original)
+++ llvm/trunk/test/tools/llvm-ar/override.test Mon Jun 27 14:53:53 2016
@@ -1,4 +1,4 @@
-RUN: yaml2obj -format macho %S/Inputs/macho.yaml -o %t.o
+RUN: yaml2obj %S/Inputs/macho.yaml -o %t.o
RUN: rm -f %t.ar
RUN: llvm-ar -format gnu crs %t.ar %t.o
Modified: llvm/trunk/test/tools/llvm-objdump/Inputs/file-aux-record.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/Inputs/file-aux-record.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/Inputs/file-aux-record.yaml (original)
+++ llvm/trunk/test/tools/llvm-objdump/Inputs/file-aux-record.yaml Mon Jun 27 14:53:53 2016
@@ -1,3 +1,4 @@
+!COFF
header: !Header
Machine: IMAGE_FILE_MACHINE_I386 # (0x14c)
Characteristics: [ IMAGE_FILE_DEBUG_STRIPPED ]
Modified: llvm/trunk/test/tools/llvm-readobj/Inputs/file-aux-record.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/file-aux-record.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/Inputs/file-aux-record.yaml (original)
+++ llvm/trunk/test/tools/llvm-readobj/Inputs/file-aux-record.yaml Mon Jun 27 14:53:53 2016
@@ -1,3 +1,4 @@
+!COFF
header: !Header
Machine: IMAGE_FILE_MACHINE_I386 # (0x14c)
Characteristics: [ IMAGE_FILE_DEBUG_STRIPPED ]
Modified: llvm/trunk/test/tools/llvm-readobj/Inputs/file-multiple-aux-records.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/file-multiple-aux-records.yaml?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/Inputs/file-multiple-aux-records.yaml (original)
+++ llvm/trunk/test/tools/llvm-readobj/Inputs/file-multiple-aux-records.yaml Mon Jun 27 14:53:53 2016
@@ -1,3 +1,4 @@
+!COFF
header: !Header
Machine: IMAGE_FILE_MACHINE_I386 # (0x14c)
Characteristics: [ IMAGE_FILE_DEBUG_STRIPPED ]
Modified: llvm/trunk/test/tools/llvm-readobj/elf-sec-flags.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-sec-flags.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-sec-flags.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-sec-flags.test Mon Jun 27 14:53:53 2016
@@ -1,6 +1,6 @@
# Check that llvm-readobj shows arch specific ELF section flags.
-# RUN: yaml2obj -format=elf -docnum 1 %s > %t-amdgpu.o
+# RUN: yaml2obj -docnum 1 %s > %t-amdgpu.o
# RUN: llvm-readobj -s %t-amdgpu.o | FileCheck -check-prefix=AMD %s
# AMD: Flags [ (0x300000)
@@ -9,7 +9,7 @@
# AMD-NEXT: ]
# amdgpu.o
----
+--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
@@ -23,7 +23,7 @@ Sections:
Flags: [SHF_AMDGPU_HSA_GLOBAL, SHF_AMDGPU_HSA_READONLY]
Size: 4
-# RUN: yaml2obj -format=elf -docnum 2 %s > %t-hex.o
+# RUN: yaml2obj -docnum 2 %s > %t-hex.o
# RUN: llvm-readobj -s %t-hex.o | FileCheck -check-prefix=HEX %s
# HEX: Flags [ (0x10000000)
@@ -31,7 +31,7 @@ Sections:
# HEX-NEXT: ]
# hex.o
----
+--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
@@ -44,7 +44,7 @@ Sections:
Flags: [SHF_HEX_GPREL]
Size: 4
-# RUN: yaml2obj -format=elf -docnum 3 %s > %t-mips.o
+# RUN: yaml2obj -docnum 3 %s > %t-mips.o
# RUN: llvm-readobj -s %t-mips.o | FileCheck -check-prefix=MIPS %s
# MIPS: Flags [ (0x38000000)
@@ -54,7 +54,7 @@ Sections:
# MIPS-NEXT: ]
# mips.o
----
+--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
@@ -67,7 +67,7 @@ Sections:
Flags: [SHF_MIPS_GPREL, SHF_MIPS_MERGE, SHF_MIPS_NOSTRIP]
Size: 4
-# RUN: yaml2obj -format=elf -docnum 4 %s > %t-x86_64.o
+# RUN: yaml2obj -docnum 4 %s > %t-x86_64.o
# RUN: llvm-readobj -s %t-x86_64.o | FileCheck -check-prefix=X86_64 %s
# X86_64: Flags [ (0x10000000)
@@ -75,7 +75,7 @@ Sections:
# X86_64-NEXT: ]
# x86_64.o
----
+--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Modified: llvm/trunk/test/tools/sanstats/elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/sanstats/elf.test?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/test/tools/sanstats/elf.test (original)
+++ llvm/trunk/test/tools/sanstats/elf.test Mon Jun 27 14:53:53 2016
@@ -1,5 +1,5 @@
-# RUN: yaml2obj -format=elf %s > %t1.o
-# RUN: yaml2obj -format=elf %s > %t2.o
+# RUN: yaml2obj %s > %t1.o
+# RUN: yaml2obj %s > %t2.o
# RUN: echo -ne "\x04" > %t.stats
@@ -39,7 +39,7 @@
# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-icall 12
# CHECK: /tmp{{[/\\]}}f.c:1 f1 <unknown> 14
----
+--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Added: llvm/trunk/test/tools/yaml2obj/missing_document_tag.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/missing_document_tag.yaml?rev=273915&view=auto
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/missing_document_tag.yaml (added)
+++ llvm/trunk/test/tools/yaml2obj/missing_document_tag.yaml Mon Jun 27 14:53:53 2016
@@ -0,0 +1,6 @@
+# RUN: not yaml2obj %s 2>&1 | FileCheck %s
+
+---
+DummyData:
+ foo: 0
+...
Added: llvm/trunk/test/tools/yaml2obj/unsupported_document_tag.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/unsupported_document_tag.yaml?rev=273915&view=auto
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/unsupported_document_tag.yaml (added)
+++ llvm/trunk/test/tools/yaml2obj/unsupported_document_tag.yaml Mon Jun 27 14:53:53 2016
@@ -0,0 +1,8 @@
+# RUN: not yaml2obj %s 2>&1 | FileCheck %s
+
+--- !unsupported-tag
+DummyData:
+ foo: 0
+...
+
+#check error: YAML Object File unsupported document type tag '!unsupported-tag'!
Modified: llvm/trunk/tools/obj2yaml/macho2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/macho2yaml.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/macho2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/macho2yaml.cpp Mon Jun 27 14:53:53 2016
@@ -10,7 +10,7 @@
#include "Error.h"
#include "obj2yaml.h"
#include "llvm/Object/MachOUniversal.h"
-#include "llvm/ObjectYAML/MachOYAML.h"
+#include "llvm/ObjectYAML/ObjectYAML.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
@@ -467,15 +467,18 @@ Error macho2yaml(raw_ostream &Out, const
if (!YAML)
return YAML.takeError();
+ yaml::YamlObjectFile YAMLFile;
+ YAMLFile.MachO = std::move(YAML.get());
+
yaml::Output Yout(Out);
- Yout << *(YAML.get());
+ Yout << YAMLFile;
return Error::success();
}
Error macho2yaml(raw_ostream &Out, const object::MachOUniversalBinary &Obj) {
- MachOYAML::MachFile YAMLFile;
- YAMLFile.isFat = true;
- MachOYAML::UniversalBinary &YAML = YAMLFile.FatFile;
+ yaml::YamlObjectFile YAMLFile;
+ YAMLFile.FatMachO.reset(new MachOYAML::UniversalBinary());
+ MachOYAML::UniversalBinary &YAML = *YAMLFile.FatMachO;
YAML.Header.magic = Obj.getMagic();
YAML.Header.nfat_arch = Obj.getNumberOfObjects();
Modified: llvm/trunk/tools/yaml2obj/yaml2coff.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2coff.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2coff.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2coff.cpp Mon Jun 27 14:53:53 2016
@@ -18,7 +18,7 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Object/COFF.h"
-#include "llvm/ObjectYAML/COFFYAML.h"
+#include "llvm/ObjectYAML/ObjectYAML.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
@@ -532,14 +532,7 @@ static bool writeCOFF(COFFParser &CP, ra
return true;
}
-int yaml2coff(yaml::Input &YIn, raw_ostream &Out) {
- COFFYAML::Object Doc;
- YIn >> Doc;
- if (YIn.error()) {
- errs() << "yaml2obj: Failed to parse YAML file!\n";
- return 1;
- }
-
+int yaml2coff(llvm::COFFYAML::Object &Doc, raw_ostream &Out) {
COFFParser CP(Doc);
if (!CP.parse()) {
errs() << "yaml2obj: Failed to parse YAML file!\n";
Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Mon Jun 27 14:53:53 2016
@@ -558,13 +558,7 @@ static bool isLittleEndian(const ELFYAML
return Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB);
}
-int yaml2elf(yaml::Input &YIn, raw_ostream &Out) {
- ELFYAML::Object Doc;
- YIn >> Doc;
- if (YIn.error()) {
- errs() << "yaml2obj: Failed to parse YAML file!\n";
- return 1;
- }
+int yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out) {
using object::ELFType;
typedef ELFType<support::little, true> LE64;
typedef ELFType<support::big, true> BE64;
Modified: llvm/trunk/tools/yaml2obj/yaml2macho.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2macho.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2macho.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2macho.cpp Mon Jun 27 14:53:53 2016
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
#include "yaml2obj.h"
-#include "llvm/ObjectYAML/MachOYAML.h"
+#include "llvm/ObjectYAML/ObjectYAML.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MachO.h"
@@ -426,8 +426,8 @@ Error MachOWriter::writeStringTable(raw_
class UniversalWriter {
public:
- UniversalWriter(MachOYAML::MachFile &MachFile)
- : MachFile(MachFile), fileStart(0) {}
+ UniversalWriter(yaml::YamlObjectFile &ObjectFile)
+ : ObjectFile(ObjectFile), fileStart(0) {}
Error writeMachO(raw_ostream &OS);
@@ -437,21 +437,21 @@ private:
void ZeroToOffset(raw_ostream &OS, size_t offset);
- MachOYAML::MachFile &MachFile;
+ yaml::YamlObjectFile &ObjectFile;
uint64_t fileStart;
};
Error UniversalWriter::writeMachO(raw_ostream &OS) {
fileStart = OS.tell();
- if (!MachFile.isFat) {
- MachOWriter Writer(MachFile.ThinFile);
+ if (ObjectFile.MachO) {
+ MachOWriter Writer(*ObjectFile.MachO);
return Writer.writeMachO(OS);
}
if (auto Err = writeFatHeader(OS))
return Err;
if (auto Err = writeFatArchs(OS))
return Err;
- auto &FatFile = MachFile.FatFile;
+ auto &FatFile = *ObjectFile.FatMachO;
assert(FatFile.FatArchs.size() == FatFile.Slices.size());
for (size_t i = 0; i < FatFile.Slices.size(); i++) {
ZeroToOffset(OS, FatFile.FatArchs[i].offset);
@@ -465,7 +465,7 @@ Error UniversalWriter::writeMachO(raw_os
}
Error UniversalWriter::writeFatHeader(raw_ostream &OS) {
- auto &FatFile = MachFile.FatFile;
+ auto &FatFile = *ObjectFile.FatMachO;
MachO::fat_header header;
header.magic = FatFile.Header.magic;
header.nfat_arch = FatFile.Header.nfat_arch;
@@ -509,7 +509,7 @@ void writeFatArch<MachO::fat_arch_64>(Ma
}
Error UniversalWriter::writeFatArchs(raw_ostream &OS) {
- auto &FatFile = MachFile.FatFile;
+ auto &FatFile = *ObjectFile.FatMachO;
bool is64Bit = FatFile.Header.magic == MachO::FAT_MAGIC_64;
for (auto Arch : FatFile.FatArchs) {
if (is64Bit)
@@ -529,14 +529,7 @@ void UniversalWriter::ZeroToOffset(raw_o
} // end anonymous namespace
-int yaml2macho(yaml::Input &YIn, raw_ostream &Out) {
- MachOYAML::MachFile Doc;
- YIn >> Doc;
- if (YIn.error()) {
- errs() << "yaml2obj: Failed to parse YAML file!\n";
- return 1;
- }
-
+int yaml2macho(yaml::YamlObjectFile &Doc, raw_ostream &Out) {
UniversalWriter Writer(Doc);
if (auto Err = Writer.writeMachO(Out)) {
errs() << toString(std::move(Err));
Modified: llvm/trunk/tools/yaml2obj/yaml2obj.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2obj.cpp?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2obj.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2obj.cpp Mon Jun 27 14:53:53 2016
@@ -16,6 +16,7 @@
#include "yaml2obj.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ObjectYAML/ObjectYAML.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
@@ -32,29 +33,6 @@ using namespace llvm;
static cl::opt<std::string>
Input(cl::Positional, cl::desc("<input>"), cl::init("-"));
-// TODO: The "right" way to tell what kind of object file a given YAML file
-// corresponds to is to look at YAML "tags" (e.g. `!Foo`). Then, different
-// tags (`!ELF`, `!COFF`, etc.) would be used to discriminate between them.
-// Interpreting the tags is needed eventually for when writing test cases,
-// so that we can e.g. have `!Archive` contain a sequence of `!ELF`, and
-// just Do The Right Thing. However, interpreting these tags and acting on
-// them appropriately requires some work in the YAML parser and the YAMLIO
-// library.
-enum YAMLObjectFormat {
- YOF_COFF,
- YOF_ELF,
- YOF_MACHO
-};
-
-cl::opt<YAMLObjectFormat> Format(
- "format",
- cl::desc("Interpret input as this type of object file"),
- cl::values(
- clEnumValN(YOF_COFF, "coff", "COFF object file format"),
- clEnumValN(YOF_ELF, "elf", "ELF object file format"),
- clEnumValN(YOF_MACHO, "macho", "Mach-O object file format"),
- clEnumValEnd));
-
cl::opt<unsigned>
DocNum("docnum", cl::init(1),
cl::desc("Read specified document from input (default = 1)"));
@@ -62,14 +40,26 @@ DocNum("docnum", cl::init(1),
static cl::opt<std::string> OutputFilename("o", cl::desc("Output filename"),
cl::value_desc("filename"));
-typedef int (*ConvertFuncPtr)(yaml::Input & YIn, raw_ostream &Out);
-
-static int convertYAML(yaml::Input &YIn, raw_ostream &Out,
- ConvertFuncPtr Convert) {
+static int convertYAML(yaml::Input &YIn, raw_ostream &Out) {
unsigned CurDocNum = 0;
do {
- if (++CurDocNum == DocNum)
- return Convert(YIn, Out);
+ if (++CurDocNum == DocNum) {
+ yaml::YamlObjectFile Doc;
+ YIn >> Doc;
+ if (YIn.error()) {
+ errs() << "yaml2obj: Failed to parse YAML file!\n";
+ return 1;
+ }
+
+ if (Doc.Elf)
+ return yaml2elf(*Doc.Elf, Out);
+ if (Doc.Coff)
+ return yaml2coff(*Doc.Coff, Out);
+ if (Doc.MachO || Doc.FatMachO)
+ return yaml2macho(Doc, Out);
+ errs() << "yaml2obj: Unknown document type!\n";
+ return 1;
+ }
} while (YIn.nextDocument());
errs() << "yaml2obj: Cannot find the " << DocNum
@@ -99,21 +89,9 @@ int main(int argc, char **argv) {
if (!Buf)
return 1;
- ConvertFuncPtr Convert = nullptr;
- if (Format == YOF_COFF)
- Convert = yaml2coff;
- else if (Format == YOF_ELF)
- Convert = yaml2elf;
- else if (Format == YOF_MACHO)
- Convert = yaml2macho;
- else {
- errs() << "Not yet implemented\n";
- return 1;
- }
-
yaml::Input YIn(Buf.get()->getBuffer());
- int Res = convertYAML(YIn, Out->os(), Convert);
+ int Res = convertYAML(YIn, Out->os());
if (Res == 0)
Out->keep();
Modified: llvm/trunk/tools/yaml2obj/yaml2obj.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2obj.h?rev=273915&r1=273914&r2=273915&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2obj.h (original)
+++ llvm/trunk/tools/yaml2obj/yaml2obj.h Mon Jun 27 14:53:53 2016
@@ -14,12 +14,23 @@
namespace llvm {
class raw_ostream;
+
+namespace COFFYAML {
+struct Object;
+}
+
+namespace ELFYAML {
+struct Object;
+}
+
namespace yaml {
class Input;
+struct YamlObjectFile;
}
}
-int yaml2coff(llvm::yaml::Input &YIn, llvm::raw_ostream &Out);
-int yaml2elf(llvm::yaml::Input &YIn, llvm::raw_ostream &Out);
-int yaml2macho(llvm::yaml::Input &YIn, llvm::raw_ostream &Out);
+
+int yaml2coff(llvm::COFFYAML::Object &Doc, llvm::raw_ostream &Out);
+int yaml2elf(llvm::ELFYAML::Object &Doc, llvm::raw_ostream &Out);
+int yaml2macho(llvm::yaml::YamlObjectFile &Doc, llvm::raw_ostream &Out);
#endif
More information about the llvm-commits
mailing list