summaryrefslogtreecommitdiff
path: root/lib/ObjectYAML
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-08-11 00:20:03 +0000
committerChris Bieneman <beanz@apple.com>2016-08-11 00:20:03 +0000
commit50b70a6871df334cb09f715fcdb539d6b260077d (patch)
tree597ba6320741c292fb3a92c37d864eea32495ed6 /lib/ObjectYAML
parent497466801a1a22a34147c067870e8a4c0026c8ba (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r--lib/ObjectYAML/MachOYAML.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ObjectYAML/MachOYAML.cpp b/lib/ObjectYAML/MachOYAML.cpp
index d819e80836c..5825d0042eb 100644
--- a/lib/ObjectYAML/MachOYAML.cpp
+++ b/lib/ObjectYAML/MachOYAML.cpp
@@ -138,7 +138,8 @@ void MappingTraits<MachOYAML::LinkEditData>::mapping(
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);
}