Move ObjectYAML code to a new library.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 1 Mar 2016 19:15:06 +0000 (19:15 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 1 Mar 2016 19:15:06 +0000 (19:15 +0000)
It is only ever used by obj2yaml and yaml2obj. No point in linking it
everywhere.

llvm-svn: 262368

20 files changed:
llvm/include/llvm/ObjectYAML/COFFYAML.h [moved from llvm/include/llvm/Object/COFFYAML.h with 98% similarity]
llvm/include/llvm/ObjectYAML/ELFYAML.h [moved from llvm/include/llvm/Object/ELFYAML.h with 98% similarity]
llvm/include/llvm/ObjectYAML/YAML.h [moved from llvm/include/llvm/MC/YAML.h with 88% similarity]
llvm/lib/CMakeLists.txt
llvm/lib/MC/CMakeLists.txt
llvm/lib/Object/CMakeLists.txt
llvm/lib/ObjectYAML/CMakeLists.txt [new file with mode: 0644]
llvm/lib/ObjectYAML/COFFYAML.cpp [moved from llvm/lib/Object/COFFYAML.cpp with 99% similarity]
llvm/lib/ObjectYAML/ELFYAML.cpp [moved from llvm/lib/Object/ELFYAML.cpp with 99% similarity]
llvm/lib/ObjectYAML/YAML.cpp [moved from llvm/lib/MC/YAML.cpp with 98% similarity]
llvm/tools/obj2yaml/CMakeLists.txt
llvm/tools/obj2yaml/coff2yaml.cpp
llvm/tools/obj2yaml/elf2yaml.cpp
llvm/tools/yaml2obj/CMakeLists.txt
llvm/tools/yaml2obj/yaml2coff.cpp
llvm/tools/yaml2obj/yaml2elf.cpp
llvm/unittests/CMakeLists.txt
llvm/unittests/MC/CMakeLists.txt
llvm/unittests/ObjectYAML/CMakeLists.txt [new file with mode: 0644]
llvm/unittests/ObjectYAML/YAMLTest.cpp [moved from llvm/unittests/MC/YAMLTest.cpp with 87% similarity]

similarity index 98%
rename from llvm/include/llvm/Object/COFFYAML.h
rename to llvm/include/llvm/ObjectYAML/COFFYAML.h
index 12a2522..ea1de16 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_OBJECT_COFFYAML_H
-#define LLVM_OBJECT_COFFYAML_H
+#ifndef LLVM_OBJECTYAML_COFFYAML_H
+#define LLVM_OBJECTYAML_COFFYAML_H
 
 #include "llvm/ADT/Optional.h"
-#include "llvm/MC/YAML.h"
+#include "llvm/ObjectYAML/YAML.h"
 #include "llvm/Support/COFF.h"
 
 namespace llvm {
similarity index 98%
rename from llvm/include/llvm/Object/ELFYAML.h
rename to llvm/include/llvm/ObjectYAML/ELFYAML.h
index df0aa50..81a4ec2 100644 (file)
 ///
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_OBJECT_ELFYAML_H
-#define LLVM_OBJECT_ELFYAML_H
+#ifndef LLVM_OBJECTYAML_ELFYAML_H
+#define LLVM_OBJECTYAML_ELFYAML_H
 
-#include "llvm/MC/YAML.h"
+#include "llvm/ObjectYAML/YAML.h"
 #include "llvm/Support/ELF.h"
 
 namespace llvm {
similarity index 88%
rename from llvm/include/llvm/MC/YAML.h
rename to llvm/include/llvm/ObjectYAML/YAML.h
index 383cdc6..7f68368 100644 (file)
@@ -1,5 +1,14 @@
-#ifndef LLVM_MC_YAML_H
-#define LLVM_MC_YAML_H
+//===- YAML.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_YAML_H
+#define LLVM_OBJECTYAML_YAML_H
 
 #include "llvm/Support/YAMLTraits.h"
 
index d00c10f..9449421 100644 (file)
@@ -10,6 +10,7 @@ add_subdirectory(Analysis)
 add_subdirectory(LTO)
 add_subdirectory(MC)
 add_subdirectory(Object)
+add_subdirectory(ObjectYAML)
 add_subdirectory(Option)
 add_subdirectory(DebugInfo)
 add_subdirectory(ExecutionEngine)
index a04f16c..698dc9f 100644 (file)
@@ -48,7 +48,6 @@ add_llvm_library(LLVMMC
   SubtargetFeature.cpp
   WinCOFFObjectWriter.cpp
   WinCOFFStreamer.cpp
-  YAML.cpp
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/MC
index 2ac2ee5..7993e75 100644 (file)
@@ -3,10 +3,8 @@ add_llvm_library(LLVMObject
   ArchiveWriter.cpp
   Binary.cpp
   COFFObjectFile.cpp
-  COFFYAML.cpp
   ELF.cpp
   ELFObjectFile.cpp
-  ELFYAML.cpp
   Error.cpp
   IRObjectFile.cpp
   MachOObjectFile.cpp
diff --git a/llvm/lib/ObjectYAML/CMakeLists.txt b/llvm/lib/ObjectYAML/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9ebe1e3
--- /dev/null
@@ -0,0 +1,5 @@
+add_llvm_library(LLVMObjectYAML
+  YAML.cpp
+  COFFYAML.cpp
+  ELFYAML.cpp
+  )
similarity index 99%
rename from llvm/lib/Object/COFFYAML.cpp
rename to llvm/lib/ObjectYAML/COFFYAML.cpp
index 4c1fca1..0aa1362 100644 (file)
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Object/COFFYAML.h"
+#include "llvm/ObjectYAML/COFFYAML.h"
 
 #define ECase(X) IO.enumCase(Value, #X, COFF::X);
 namespace llvm {
similarity index 99%
rename from llvm/lib/Object/ELFYAML.cpp
rename to llvm/lib/ObjectYAML/ELFYAML.cpp
index 856fd63..06db57a 100644 (file)
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Object/ELFYAML.h"
+#include "llvm/ObjectYAML/ELFYAML.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/MipsABIFlags.h"
 
similarity index 98%
rename from llvm/lib/MC/YAML.cpp
rename to llvm/lib/ObjectYAML/YAML.cpp
index 45db5c3..75cf1fb 100644 (file)
@@ -12,7 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/MC/YAML.h"
+#include "llvm/ObjectYAML/YAML.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cctype>
index 3cdac5c..9d8c32f 100644 (file)
@@ -1,5 +1,6 @@
 set(LLVM_LINK_COMPONENTS
   Object
+  ObjectYAML
   Support
   )
 
index f675bfe..343ed12 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "obj2yaml.h"
 #include "llvm/Object/COFF.h"
-#include "llvm/Object/COFFYAML.h"
+#include "llvm/ObjectYAML/COFFYAML.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/YAMLTraits.h"
 
index f2b0138..e05f428 100644 (file)
@@ -11,7 +11,7 @@
 #include "obj2yaml.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Object/ELFObjectFile.h"
-#include "llvm/Object/ELFYAML.h"
+#include "llvm/ObjectYAML/ELFYAML.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/YAMLTraits.h"
 
index 52e9df4..ac3fd77 100644 (file)
@@ -1,6 +1,7 @@
 set(LLVM_LINK_COMPONENTS
   MC
   Object
+  ObjectYAML
   Support
   )
 
index 9a0c92f..4453507 100644 (file)
@@ -19,7 +19,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Object/COFF.h"
-#include "llvm/Object/COFFYAML.h"
+#include "llvm/ObjectYAML/COFFYAML.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/SourceMgr.h"
index 2839afe..a2ae5e2 100644 (file)
@@ -16,7 +16,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/MC/StringTableBuilder.h"
 #include "llvm/Object/ELFObjectFile.h"
-#include "llvm/Object/ELFYAML.h"
+#include "llvm/ObjectYAML/ELFYAML.h"
 #include "llvm/Support/ELF.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/YAMLTraits.h"
index 48a573a..49a9b31 100644 (file)
@@ -23,6 +23,7 @@ add_subdirectory(LineEditor)
 add_subdirectory(Linker)
 add_subdirectory(MC)
 add_subdirectory(MI)
+add_subdirectory(ObjectYAML)
 add_subdirectory(Option)
 add_subdirectory(ProfileData)
 add_subdirectory(Support)
index 7c39f43..c760c02 100644 (file)
@@ -10,5 +10,4 @@ add_llvm_unittest(MCTests
   DwarfLineTables.cpp
   StringTableBuilderTest.cpp
   TargetRegistry.cpp
-  YAMLTest.cpp
   )
diff --git a/llvm/unittests/ObjectYAML/CMakeLists.txt b/llvm/unittests/ObjectYAML/CMakeLists.txt
new file mode 100644 (file)
index 0000000..baed10b
--- /dev/null
@@ -0,0 +1,8 @@
+set(LLVM_LINK_COMPONENTS
+  ObjectYAML
+  )
+
+add_llvm_unittest(ObjectYAMLTests
+  YAMLTest.cpp
+  )
+
similarity index 87%
rename from llvm/unittests/MC/YAMLTest.cpp
rename to llvm/unittests/ObjectYAML/YAMLTest.cpp
index 09709ad..606e160 100644 (file)
@@ -1,4 +1,4 @@
-//===- llvm/unittest/Object/YAMLTest.cpp - Tests for Object YAML ----------===//
+//===- YAMLTest.cpp - Tests for Object YAML -------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/MC/YAML.h"
+#include "llvm/ObjectYAML/YAML.h"
 #include "llvm/Support/YAMLTraits.h"
 #include "gtest/gtest.h"