[llvm] r183293 - Don't print default values for NumberOfAuxSymbols and AuxiliaryData.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jun 4 20:20:13 PDT 2013
Author: rafael
Date: Tue Jun 4 22:20:13 2013
New Revision: 183293
URL: http://llvm.org/viewvc/llvm-project?rev=183293&view=rev
Log:
Don't print default values for NumberOfAuxSymbols and AuxiliaryData.
Modified:
llvm/trunk/include/llvm/Object/YAML.h
llvm/trunk/lib/Object/COFFYAML.cpp
llvm/trunk/test/Object/obj2yaml.test
Modified: llvm/trunk/include/llvm/Object/YAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/YAML.h?rev=183293&r1=183292&r2=183293&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/YAML.h (original)
+++ llvm/trunk/include/llvm/Object/YAML.h Tue Jun 4 22:20:13 2013
@@ -41,6 +41,13 @@ public:
assert(isBinary);
return Data;
}
+ bool operator==(const BinaryRef &Ref) {
+ // Special case for default constructed BinaryRef.
+ if (Ref.Data.empty() && Data.empty())
+ return true;
+
+ return Ref.isBinary == isBinary && Ref.Data == Data;
+ }
};
}
Modified: llvm/trunk/lib/Object/COFFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFYAML.cpp?rev=183293&r1=183292&r2=183293&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFYAML.cpp (original)
+++ llvm/trunk/lib/Object/COFFYAML.cpp Tue Jun 4 22:20:13 2013
@@ -255,8 +255,9 @@ void MappingTraits<COFFYAML::Symbol>::ma
IO.mapRequired("SimpleType", S.SimpleType);
IO.mapRequired("ComplexType", S.ComplexType);
IO.mapRequired("StorageClass", NS->StorageClass);
- IO.mapOptional("NumberOfAuxSymbols", S.Header.NumberOfAuxSymbols);
- IO.mapOptional("AuxiliaryData", S.AuxiliaryData);
+ IO.mapOptional("NumberOfAuxSymbols", S.Header.NumberOfAuxSymbols,
+ (uint8_t) 0);
+ IO.mapOptional("AuxiliaryData", S.AuxiliaryData, object::yaml::BinaryRef());
}
void MappingTraits<COFFYAML::Section>::mapping(IO &IO, COFFYAML::Section &Sec) {
Modified: llvm/trunk/test/Object/obj2yaml.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml.test?rev=183293&r1=183292&r2=183293&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml.test (original)
+++ llvm/trunk/test/Object/obj2yaml.test Tue Jun 4 22:20:13 2013
@@ -150,3 +150,4 @@ COFF-X86-64-NEXT: SectionNumber: 0
COFF-X86-64-NEXT: SimpleType: IMAGE_SYM_TYPE_NULL
COFF-X86-64-NEXT: ComplexType: IMAGE_SYM_DTYPE_NULL
COFF-X86-64-NEXT: StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+COFF-X86-64-NOT: NumberOfAuxSymbols
More information about the llvm-commits
mailing list