[llvm] r278307 - [MachOYAML] Don't output empty ExportTrie
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 10 17:20:03 PDT 2016
Author: cbieneman
Date: Wed Aug 10 19:20:03 2016
New Revision: 278307
URL: http://llvm.org/viewvc/llvm-project?rev=278307&view=rev
Log:
[MachOYAML] Don't output empty ExportTrie
The YAML representation was always outputting the root node of an export trie even if the trie was empty. While this doesn't really have any functional impact, it does add visual clutter to the yaml file.
Modified:
llvm/trunk/lib/ObjectYAML/MachOYAML.cpp
Modified: llvm/trunk/lib/ObjectYAML/MachOYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/MachOYAML.cpp?rev=278307&r1=278306&r2=278307&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/MachOYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/MachOYAML.cpp Wed Aug 10 19:20:03 2016
@@ -138,7 +138,8 @@ void MappingTraits<MachOYAML::LinkEditDa
IO.mapOptional("BindOpcodes", LinkEditData.BindOpcodes);
IO.mapOptional("WeakBindOpcodes", LinkEditData.WeakBindOpcodes);
IO.mapOptional("LazyBindOpcodes", LinkEditData.LazyBindOpcodes);
- IO.mapOptional("ExportTrie", LinkEditData.ExportTrie);
+ if(LinkEditData.ExportTrie.Children.size() > 0 || !IO.outputting())
+ IO.mapOptional("ExportTrie", LinkEditData.ExportTrie);
IO.mapOptional("NameList", LinkEditData.NameList);
IO.mapOptional("StringTable", LinkEditData.StringTable);
}
More information about the llvm-commits
mailing list