[llvm] r179921 - Remove local namespace yaml to avoid confusion with llvm::yaml.
Benjamin Kramer
benny.kra at gmail.com
Sat Apr 20 03:47:59 PDT 2013
On 20.04.2013, at 05:13, Rafael Espindola <rafael.espindola at gmail.com> wrote:
> Author: rafael
> Date: Fri Apr 19 22:13:00 2013
> New Revision: 179921
>
> URL: http://llvm.org/viewvc/llvm-project?rev=179921&view=rev
> Log:
> Remove local namespace yaml to avoid confusion with llvm::yaml.
>
> Modified:
> llvm/trunk/tools/obj2yaml/coff2yaml.cpp
>
> Modified: llvm/trunk/tools/obj2yaml/coff2yaml.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/coff2yaml.cpp?rev=179921&r1=179920&r2=179921&view=diff
> ==============================================================================
> --- llvm/trunk/tools/obj2yaml/coff2yaml.cpp (original)
> +++ llvm/trunk/tools/obj2yaml/coff2yaml.cpp Fri Apr 19 22:13:00 2013
> @@ -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_ost
> 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,
> 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;
coff2yaml.cpp:238:16: warning: variable ‘H’ set but not used [-Wunused-but-set-variable]
was this addition intentional?
- Ben
>
> Out << "header: !Header\n";
> Out << " Machine: ";
> @@ -260,14 +258,14 @@ static raw_ostream &yamlCOFFSections(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';
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list