diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-20 00:58:46 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-20 00:58:46 +0000 |
commit | 2da09e44082b3caea7ab6347af522ece9a29edd9 (patch) | |
tree | 9f697967349b64fbce28dcbd028861c62e4cdbb3 /llvm/lib/IR/Metadata.cpp | |
parent | 0f529998a5355fde5662719c56e74492802cb816 (diff) | |
download | bcm5719-llvm-2da09e44082b3caea7ab6347af522ece9a29edd9.tar.gz bcm5719-llvm-2da09e44082b3caea7ab6347af522ece9a29edd9.zip |
IR: Canonicalize GenericDwarfNode empty headers to null
llvm-svn: 226532
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r-- | llvm/lib/IR/Metadata.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 97976308fcd..fc1f3e7a3cf 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -753,6 +753,10 @@ GenericDwarfNode *GenericDwarfNode::getImpl(LLVMContext &Context, unsigned Tag, ArrayRef<Metadata *> DwarfOps, StorageType Storage, bool ShouldCreate) { + // Canonicalize empty string to a nullptr. + if (Header && Header->getString().empty()) + Header = nullptr; + unsigned Hash = 0; if (Storage == Uniqued) { GenericDwarfNodeInfo::KeyTy Key(Tag, Header, DwarfOps); |