diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-12-18 21:48:19 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-12-18 21:48:19 +0000 |
commit | 99c7af26b72fb617f4aa1f60cf868155c2ccfe89 (patch) | |
tree | 6bf8de70e11297d32678fc6c7fa183067dc6f804 /llvm/lib/IR/DebugInfo.cpp | |
parent | 0630eb70949d748ba2661f12935584504deaec2b (diff) | |
download | bcm5719-llvm-99c7af26b72fb617f4aa1f60cf868155c2ccfe89.tar.gz bcm5719-llvm-99c7af26b72fb617f4aa1f60cf868155c2ccfe89.zip |
Debug info: Implement (rvalue) reference qualifiers for C++11 non-static
member functions. Paired commit with CFE.
rdar://problem/15356637
llvm-svn: 197613
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 75a70965a3a..ba45e828636 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -504,6 +504,10 @@ bool DICompositeType::Verify() const { if (!fieldIsMDString(DbgNode, 14)) return false; + // A subroutine type can't be both & and &&. + if (isLValueReference() && isRValueReference()) + return false; + return DbgNode->getNumOperands() == 15; } @@ -520,6 +524,11 @@ bool DISubprogram::Verify() const { // Containing type @ field 12. if (!fieldIsTypeRef(DbgNode, 12)) return false; + + // A subprogram can't be both & and &&. + if (isLValueReference() && isRValueReference()) + return false; + return DbgNode->getNumOperands() == 20; } @@ -1297,6 +1306,12 @@ void DIType::printInternal(raw_ostream &OS) const { OS << " [vector]"; if (isStaticMember()) OS << " [static]"; + + if (isLValueReference()) + OS << " [reference]"; + + if (isRValueReference()) + OS << " [rvalue reference]"; } void DIDerivedType::printInternal(raw_ostream &OS) const { @@ -1336,6 +1351,12 @@ void DISubprogram::printInternal(raw_ostream &OS) const { else if (isProtected()) OS << " [protected]"; + if (isLValueReference()) + OS << " [reference]"; + + if (isRValueReference()) + OS << " [rvalue reference]"; + StringRef Res = getName(); if (!Res.empty()) OS << " [" << Res << ']'; |