summaryrefslogtreecommitdiff
path: root/tools/obj2yaml
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-20 03:13:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-20 03:13:00 +0000
commit9e39d0bc2092f97c531591737af8abda48211169 (patch)
tree11a7fb3d3269429d2de8aee8937e8c7d4428d277 /tools/obj2yaml
parentda177ce51c2c718e2655e96b9fdcebb68d4fd291 (diff)
downloadllvm-9e39d0bc2092f97c531591737af8abda48211169.tar.gz
llvm-9e39d0bc2092f97c531591737af8abda48211169.tar.bz2
llvm-9e39d0bc2092f97c531591737af8abda48211169.tar.xz
Remove local namespace yaml to avoid confusion with llvm::yaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/obj2yaml')
-rw-r--r--tools/obj2yaml/coff2yaml.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/obj2yaml/coff2yaml.cpp b/tools/obj2yaml/coff2yaml.cpp
index 4a8ffbd81e..349d0c1756 100644
--- a/tools/obj2yaml/coff2yaml.cpp
+++ b/tools/obj2yaml/coff2yaml.cpp
@@ -202,8 +202,6 @@ RelocationTypesARMPairs [] = {
};
#undef STRING_PAIR
-namespace yaml { // COFF-specific yaml-writing specific routines
-
static raw_ostream &writeName(raw_ostream &Out,
const char *Name, std::size_t NameSize) {
for (std::size_t i = 0; i < NameSize; ++i) {
@@ -224,8 +222,6 @@ static raw_ostream &writeBitMask(raw_ostream &Out,
return Out;
}
-} // end of yaml namespace
-
// Given an array of pod_pair<enum, const char *>, look up a value
template <typename T, std::size_t N>
const char *nameLookup(const pod_pair<T, const char *> (&Arr)[N],
@@ -237,9 +233,11 @@ const char *nameLookup(const pod_pair<T, const char *> (&Arr)[N],
return NotFound;
}
-
static raw_ostream &yamlCOFFHeader(const object::coff_file_header *Header,
raw_ostream &Out) {
+ COFF::header H;
+ H.Machine = Header->Machine;
+ H.Characteristics = Header->Characteristics;
Out << "header: !Header\n";
Out << " Machine: ";
@@ -260,14 +258,14 @@ static raw_ostream &yamlCOFFSections(object::COFFObjectFile &Obj,
Out << " - !Section\n";
Out << " Name: ";
- yaml::writeName(Out, sect->Name, sizeof(sect->Name)) << '\n';
+ writeName(Out, sect->Name, sizeof(sect->Name)) << '\n';
Out << " Characteristics: [";
- yaml::writeBitMask(Out, SectionCharacteristicsPairs1, sect->Characteristics);
+ writeBitMask(Out, SectionCharacteristicsPairs1, sect->Characteristics);
Out << nameLookup(SectionCharacteristicsPairsAlignment,
sect->Characteristics & 0x00F00000, "# Unrecognized_IMAGE_SCN_ALIGN")
<< ", ";
- yaml::writeBitMask(Out, SectionCharacteristicsPairs2, sect->Characteristics);
+ writeBitMask(Out, SectionCharacteristicsPairs2, sect->Characteristics);
Out << "] # ";
yaml::writeHexNumber(Out, sect->Characteristics) << '\n';