Debug info: Implement (rvalue) reference qualifiers for C++11 non-static

member functions. Paired commit with CFE.

rdar://problem/15356637

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197613 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2013-12-18 21:48:19 +00:00
parent f5d3392e50
commit 5112542840
6 changed files with 170 additions and 19 deletions

View File

@@ -415,10 +415,13 @@ namespace llvm {
StringRef UniqueIdentifier = StringRef());
/// createSubroutineType - Create subroutine type.
/// @param File File in which this subroutine is defined.
/// @param ParameterTypes An array of subroutine parameter types. This
/// includes return type at 0th index.
DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes);
/// @param File File in which this subroutine is defined.
/// @param ParameterTypes An array of subroutine parameter types. This
/// includes return type at 0th index.
/// @param Flags E.g.: LValueReference.
/// These flags are used to emit dwarf attributes.
DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes,
unsigned Flags = 0);
/// createArtificialType - Create a new DIType with "artificial" flag set.
DIType createArtificialType(DIType Ty);

View File

@@ -64,20 +64,22 @@ class DIDescriptor {
public:
enum {
FlagPrivate = 1 << 0,
FlagProtected = 1 << 1,
FlagFwdDecl = 1 << 2,
FlagAppleBlock = 1 << 3,
FlagBlockByrefStruct = 1 << 4,
FlagVirtual = 1 << 5,
FlagArtificial = 1 << 6,
FlagExplicit = 1 << 7,
FlagPrototyped = 1 << 8,
FlagPrivate = 1 << 0,
FlagProtected = 1 << 1,
FlagFwdDecl = 1 << 2,
FlagAppleBlock = 1 << 3,
FlagBlockByrefStruct = 1 << 4,
FlagVirtual = 1 << 5,
FlagArtificial = 1 << 6,
FlagExplicit = 1 << 7,
FlagPrototyped = 1 << 8,
FlagObjcClassComplete = 1 << 9,
FlagObjectPointer = 1 << 10,
FlagVector = 1 << 11,
FlagStaticMember = 1 << 12,
FlagIndirectVariable = 1 << 13
FlagObjectPointer = 1 << 10,
FlagVector = 1 << 11,
FlagStaticMember = 1 << 12,
FlagIndirectVariable = 1 << 13,
FlagLValueReference = 1 << 14,
FlagRValueReference = 1 << 15
};
protected:
@@ -313,6 +315,12 @@ public:
}
bool isVector() const { return (getFlags() & FlagVector) != 0; }
bool isStaticMember() const { return (getFlags() & FlagStaticMember) != 0; }
bool isLValueReference() const {
return (getFlags() & FlagLValueReference) != 0;
}
bool isRValueReference() const {
return (getFlags() & FlagRValueReference) != 0;
}
bool isValid() const { return DbgNode && isType(); }
/// replaceAllUsesWith - Replace all uses of debug info referenced by
@@ -470,6 +478,19 @@ public:
return (getUnsignedField(13) & FlagPrototyped) != 0;
}
/// Return true if this subprogram is a C++11 reference-qualified
/// non-static member function (void foo() &).
unsigned isLValueReference() const {
return (getUnsignedField(13) & FlagLValueReference) != 0;
}
/// Return true if this subprogram is a C++11
/// rvalue-reference-qualified non-static member function
/// (void foo() &&).
unsigned isRValueReference() const {
return (getUnsignedField(13) & FlagRValueReference) != 0;
}
unsigned isOptimized() const;
/// Verify - Verify that a subprogram descriptor is well formed.