diff options
author | Adrian Prantl <aprantl@apple.com> | 2018-01-05 01:13:37 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2018-01-05 01:13:37 +0000 |
commit | a29aac7b774d1fec7033f6d0fdfaf919e97e8492 (patch) | |
tree | 5e587194de1e42c151a402551dd4539375bb90be /llvm/lib/IR/Verifier.cpp | |
parent | 0429ebfabc4275a0f4cc120bb69e2ea317af3cfa (diff) | |
download | bcm5719-llvm-a29aac7b774d1fec7033f6d0fdfaf919e97e8492.tar.gz bcm5719-llvm-a29aac7b774d1fec7033f6d0fdfaf919e97e8492.zip |
Debug Info: Support DW_AT_calling_convention on composite types.
This implements the DWARF 5 feature described at
http://www.dwarfstd.org/ShowIssue.php?issue=141215.1
This allows a consumer to understand whether a composite data type is
trivially copyable and thus should be passed by value instead of by
reference. The canonical example is being able to distinguish the
following two types:
// S is not trivially copyable because of the explicit destructor.
struct S {
~S() {}
};
// T is a POD type.
struct T {
~T() = default;
};
This patch adds two new (DI)flags to LLVM metadata: TypePassByValue
and TypePassByReference.
<rdar://problem/36034922>
Differential Revision: https://reviews.llvm.org/D41743
llvm-svn: 321844
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 1754f7d4501..ab93b855776 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -905,9 +905,12 @@ void Verifier::visitDIDerivedType(const DIDerivedType &N) { } } +/// Detect mutually exclusive flags. static bool hasConflictingReferenceFlags(unsigned Flags) { - return (Flags & DINode::FlagLValueReference) && - (Flags & DINode::FlagRValueReference); + return ((Flags & DINode::FlagLValueReference) && + (Flags & DINode::FlagRValueReference)) || + ((Flags & DINode::FlagTypePassByValue) && + (Flags & DINode::FlagTypePassByReference)); } void Verifier::visitTemplateParams(const MDNode &N, const Metadata &RawParams) { |