@@ -1750,15 +1750,13 @@ class DITemplateValueParameter : public DITemplateParameter {
17501750};
17511751
17521752// / \brief Base class for variables.
1753- // /
1754- // / TODO: Hardcode to DW_TAG_variable.
17551753class DIVariable : public DINode {
17561754 unsigned Line;
17571755
17581756protected:
1759- DIVariable (LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag ,
1760- unsigned Line, ArrayRef<Metadata *> Ops)
1761- : DINode(C, ID, Storage, Tag , Ops), Line(Line) {}
1757+ DIVariable (LLVMContext &C, unsigned ID, StorageType Storage, unsigned Line ,
1758+ ArrayRef<Metadata *> Ops)
1759+ : DINode(C, ID, Storage, dwarf::DW_TAG_variable , Ops), Line(Line) {}
17621760 ~DIVariable () = default ;
17631761
17641762public:
@@ -1803,8 +1801,7 @@ class DIGlobalVariable : public DIVariable {
18031801 DIGlobalVariable (LLVMContext &C, StorageType Storage, unsigned Line,
18041802 bool IsLocalToUnit, bool IsDefinition,
18051803 ArrayRef<Metadata *> Ops)
1806- : DIVariable(C, DIGlobalVariableKind, Storage, dwarf::DW_TAG_variable,
1807- Line, Ops),
1804+ : DIVariable(C, DIGlobalVariableKind, Storage, Line, Ops),
18081805 IsLocalToUnit (IsLocalToUnit), IsDefinition(IsDefinition) {}
18091806 ~DIGlobalVariable () = default ;
18101807
@@ -1876,8 +1873,6 @@ class DIGlobalVariable : public DIVariable {
18761873
18771874// / \brief Local variable.
18781875// /
1879- // / TODO: Split between arguments and otherwise.
1880- // / TODO: Use \c DW_TAG_variable instead of fake tags.
18811876// / TODO: Split up flags.
18821877class DILocalVariable : public DIVariable {
18831878 friend class LLVMContextImpl ;
@@ -1886,42 +1881,42 @@ class DILocalVariable : public DIVariable {
18861881 unsigned Arg;
18871882 unsigned Flags;
18881883
1889- DILocalVariable (LLVMContext &C, StorageType Storage, unsigned Tag,
1890- unsigned Line, unsigned Arg, unsigned Flags,
1891- ArrayRef<Metadata *> Ops)
1892- : DIVariable(C, DILocalVariableKind, Storage, Tag, Line, Ops), Arg(Arg),
1884+ DILocalVariable (LLVMContext &C, StorageType Storage, unsigned Line,
1885+ unsigned Arg, unsigned Flags, ArrayRef<Metadata *> Ops)
1886+ : DIVariable(C, DILocalVariableKind, Storage, Line, Ops), Arg(Arg),
18931887 Flags (Flags) {}
18941888 ~DILocalVariable () = default ;
18951889
1896- static DILocalVariable *getImpl (LLVMContext &Context, unsigned Tag ,
1897- DIScope *Scope, StringRef Name, DIFile *File,
1898- unsigned Line, DITypeRef Type, unsigned Arg,
1899- unsigned Flags, StorageType Storage,
1890+ static DILocalVariable *getImpl (LLVMContext &Context, DIScope *Scope ,
1891+ StringRef Name, DIFile *File, unsigned Line ,
1892+ DITypeRef Type, unsigned Arg, unsigned Flags ,
1893+ StorageType Storage,
19001894 bool ShouldCreate = true ) {
1901- return getImpl (Context, Tag, Scope, getCanonicalMDString (Context, Name),
1902- File, Line, Type, Arg, Flags, Storage, ShouldCreate);
1895+ return getImpl (Context, Scope, getCanonicalMDString (Context, Name), File ,
1896+ Line, Type, Arg, Flags, Storage, ShouldCreate);
19031897 }
1904- static DILocalVariable *
1905- getImpl (LLVMContext &Context, unsigned Tag, Metadata *Scope, MDString *Name,
1906- Metadata *File, unsigned Line, Metadata *Type, unsigned Arg,
1907- unsigned Flags, StorageType Storage, bool ShouldCreate = true );
1898+ static DILocalVariable *getImpl (LLVMContext &Context, Metadata *Scope,
1899+ MDString *Name, Metadata *File, unsigned Line,
1900+ Metadata *Type, unsigned Arg, unsigned Flags,
1901+ StorageType Storage,
1902+ bool ShouldCreate = true );
19081903
19091904 TempDILocalVariable cloneImpl () const {
1910- return getTemporary (getContext (), getTag (), getScope (), getName (),
1911- getFile (), getLine (), getType (), getArg (), getFlags ());
1905+ return getTemporary (getContext (), getScope (), getName (), getFile (),
1906+ getLine (), getType (), getArg (), getFlags ());
19121907 }
19131908
19141909public:
19151910 DEFINE_MDNODE_GET (DILocalVariable,
1916- (unsigned Tag, DILocalScope *Scope, StringRef Name,
1917- DIFile *File, unsigned Line, DITypeRef Type, unsigned Arg,
1911+ (DILocalScope * Scope, StringRef Name, DIFile *File ,
1912+ unsigned Line, DITypeRef Type, unsigned Arg,
19181913 unsigned Flags),
1919- (Tag, Scope, Name, File, Line, Type, Arg, Flags))
1914+ (Scope, Name, File, Line, Type, Arg, Flags))
19201915 DEFINE_MDNODE_GET(DILocalVariable,
1921- (unsigned Tag, Metadata *Scope, MDString *Name,
1922- Metadata *File, unsigned Line, Metadata *Type,
1923- unsigned Arg, unsigned Flags),
1924- (Tag, Scope, Name, File, Line, Type, Arg, Flags))
1916+ (Metadata * Scope, MDString *Name, Metadata *File ,
1917+ unsigned Line, Metadata *Type, unsigned Arg ,
1918+ unsigned Flags),
1919+ (Scope, Name, File, Line, Type, Arg, Flags))
19251920
19261921 TempDILocalVariable clone() const { return cloneImpl (); }
19271922
@@ -1932,6 +1927,7 @@ class DILocalVariable : public DIVariable {
19321927 return cast<DILocalScope>(DIVariable::getScope ());
19331928 }
19341929
1930+ bool isParameter () const { return Arg; }
19351931 unsigned getArg () const { return Arg; }
19361932 unsigned getFlags () const { return Flags; }
19371933
0 commit comments