DebugInfo: Use MDTypeRef throughout the hierarchy

Use `MDTypeRef` (etc.) in the new debug info hierarchy rather than raw
`Metadata *` pointers.

I rolled in a change to `DIBuilder` that looks unrelated: take `DIType`
instead of `DITypeRef` as type arguments when creating variables.
However, this was the simplest way to use `MDTypeRef` within the
functions, and didn't require any cleanups from callers in clang (since
they were all passing in `DIType`s anyway, relying on their implicit
conversions to `DITypeRef`).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-06 19:03:45 +00:00
parent ebb3c53316
commit e009b6fd92
8 changed files with 206 additions and 186 deletions

View File

@@ -464,7 +464,7 @@ namespace llvm {
/// @param Decl Reference to the corresponding declaration.
DIGlobalVariable createGlobalVariable(DIDescriptor Context, StringRef Name,
StringRef LinkageName, DIFile File,
unsigned LineNo, DITypeRef Ty,
unsigned LineNo, DIType Ty,
bool isLocalToUnit,
llvm::Constant *Val,
MDNode *Decl = nullptr);
@@ -473,7 +473,7 @@ namespace llvm {
/// except that the resulting DbgNode is temporary and meant to be RAUWed.
DIGlobalVariable createTempGlobalVariableFwdDecl(
DIDescriptor Context, StringRef Name, StringRef LinkageName,
DIFile File, unsigned LineNo, DITypeRef Ty, bool isLocalToUnit,
DIFile File, unsigned LineNo, DIType Ty, bool isLocalToUnit,
llvm::Constant *Val, MDNode *Decl = nullptr);
/// createLocalVariable - Create a new descriptor for the specified
@@ -491,11 +491,9 @@ namespace llvm {
/// @param ArgNo If this variable is an argument then this argument's
/// number. 1 indicates 1st argument.
DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
StringRef Name,
DIFile File, unsigned LineNo,
DITypeRef Ty, bool AlwaysPreserve = false,
unsigned Flags = 0,
unsigned ArgNo = 0);
StringRef Name, DIFile File, unsigned LineNo,
DIType Ty, bool AlwaysPreserve = false,
unsigned Flags = 0, unsigned ArgNo = 0);
/// createExpression - Create a new descriptor for the specified
/// variable which has a complex address expression for its address.