summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/DWARFEmitter.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2017-03-07 18:50:58 +0000
committerChris Bieneman <beanz@apple.com>2017-03-07 18:50:58 +0000
commitb3ca711ab38eee12bddb6275967d739c05b73dc1 (patch)
tree15259297ba7f355d77a6806166ac53030da9411e /llvm/lib/ObjectYAML/DWARFEmitter.cpp
parent44296ea4db3e5055bd4c7ae5da31be285dc7ac34 (diff)
downloadbcm5719-llvm-b3ca711ab38eee12bddb6275967d739c05b73dc1.tar.gz
bcm5719-llvm-b3ca711ab38eee12bddb6275967d739c05b73dc1.zip
[ObjectYAML] Add support for DWARF5 Unit header
In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields. llvm-svn: 297183
Diffstat (limited to 'llvm/lib/ObjectYAML/DWARFEmitter.cpp')
-rw-r--r--llvm/lib/ObjectYAML/DWARFEmitter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
index c1116a1be46..1aa1519b708 100644
--- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp
+++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
@@ -130,8 +130,15 @@ protected:
virtual void onStartCompileUnit(const DWARFYAML::Unit &CU) {
writeInitialLength(CU.Length, OS, DebugInfo.IsLittleEndian);
writeInteger((uint16_t)CU.Version, OS, DebugInfo.IsLittleEndian);
- writeInteger((uint32_t)CU.AbbrOffset, OS, DebugInfo.IsLittleEndian);
- writeInteger((uint8_t)CU.AddrSize, OS, DebugInfo.IsLittleEndian);
+ if(CU.Version >= 5) {
+ writeInteger((uint8_t)CU.Type, OS, DebugInfo.IsLittleEndian);
+ writeInteger((uint8_t)CU.AddrSize, OS, DebugInfo.IsLittleEndian);
+ writeInteger((uint32_t)CU.AbbrOffset, OS, DebugInfo.IsLittleEndian);
+ }else {
+ writeInteger((uint32_t)CU.AbbrOffset, OS, DebugInfo.IsLittleEndian);
+ writeInteger((uint8_t)CU.AddrSize, OS, DebugInfo.IsLittleEndian);
+ }
+
}
virtual void onStartDIE(const DWARFYAML::Unit &CU,
OpenPOWER on IntegriCloud