summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>2017-03-08 23:55:44 +0000
committerKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>2017-03-08 23:55:44 +0000
commitd5561e0a0bbd484da17d3b68ae5fedc0a057246b (patch)
tree40642d65e0adf50eae29e4cb204584c0de1a633c /llvm/lib/Bitcode/Writer
parentd4cb9c6da0b940e0b13c1c5a286cc67d31267d70 (diff)
downloadbcm5719-llvm-d5561e0a0bbd484da17d3b68ae5fedc0a057246b.tar.gz
bcm5719-llvm-d5561e0a0bbd484da17d3b68ae5fedc0a057246b.zip
[DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types
Differential Revision: https://reviews.llvm.org/D29670 llvm-svn: 297320
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 8e930c01998..9f18375d484 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1473,6 +1473,13 @@ void ModuleBitcodeWriter::writeDIDerivedType(const DIDerivedType *N,
Record.push_back(N->getFlags());
Record.push_back(VE.getMetadataOrNullID(N->getExtraData()));
+ // DWARF address space is encoded as N->getDWARFAddressSpace() + 1. 0 means
+ // that there is no DWARF address space associated with DIDerivedType.
+ if (const auto &DWARFAddressSpace = N->getDWARFAddressSpace())
+ Record.push_back(*DWARFAddressSpace + 1);
+ else
+ Record.push_back(0);
+
Stream.EmitRecord(bitc::METADATA_DERIVED_TYPE, Record, Abbrev);
Record.clear();
}
OpenPOWER on IntegriCloud