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 | 5112542840c5be96f2245a2a0fa59dea57dfe6f4 (patch) | |
tree | 7e4f77cda808075302069eb289c8364d57a6d6d1 /include | |
parent | f5d3392e50890e657c28160b58a3fa92d1789d75 (diff) | |
download | llvm-5112542840c5be96f2245a2a0fa59dea57dfe6f4.tar.gz llvm-5112542840c5be96f2245a2a0fa59dea57dfe6f4.tar.bz2 llvm-5112542840c5be96f2245a2a0fa59dea57dfe6f4.tar.xz |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/DIBuilder.h | 11 | ||||
-rw-r--r-- | include/llvm/DebugInfo.h | 47 |
2 files changed, 41 insertions, 17 deletions
diff --git a/include/llvm/DIBuilder.h b/include/llvm/DIBuilder.h index 924aab586f..44f40819c7 100644 --- a/include/llvm/DIBuilder.h +++ b/include/llvm/DIBuilder.h @@ -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); diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 768cf4ea10..0a56e2f47d 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -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. |