diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-29 16:38:44 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-29 16:38:44 +0000 |
commit | e56023a059e5fafa97f0df32c65cf31cfc33ba17 (patch) | |
tree | 7dc2f67e2d8ddd5877015bf9f067146d88ecde92 /examples | |
parent | 42eeb1d91f66532c2aeba272c07c0eb813c0ca95 (diff) |
IR: Give 'DI' prefix to debug info metadata
Finish off PR23080 by renaming the debug info IR constructs from `MD*`
to `DI*`. The last of the `DIDescriptor` classes were deleted in
r235356, and the last of the related typedefs removed in r235413, so
this has all baked for about a week.
Note: If you have out-of-tree code (like a frontend), I recommend that
you get everything compiling and tests passing with the *previous*
commit before updating to this one. It'll be easier to keep track of
what code is using the `DIDescriptor` hierarchy and what you've already
updated, and I think you're extremely unlikely to insert bugs. YMMV of
course.
Back to *this* commit: I did this using the rename-md-di-nodes.sh
upgrade script I've attached to PR23080 (both code and testcases) and
filtered through clang-format-diff.py. I edited the tests for
test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns
were off-by-three. It should work on your out-of-tree testcases (and
code, if you've followed the advice in the previous paragraph).
Some of the tests are in badly named files now (e.g.,
test/Assembler/invalid-mdcompositetype-missing-tag.ll should be
'dicompositetype'); I'll come back and move the files in a follow-up
commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Kaleidoscope/Chapter8/toy.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp index a565e52e2eb..71bc2f68402 100644 --- a/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/examples/Kaleidoscope/Chapter8/toy.cpp @@ -93,13 +93,13 @@ class ExprAST; } static IRBuilder<> Builder(getGlobalContext()); struct DebugInfo { - MDCompileUnit *TheCU; - MDType *DblTy; - std::vector<MDScope *> LexicalBlocks; - std::map<const PrototypeAST *, MDScope *> FnScopeMap; + DICompileUnit *TheCU; + DIType *DblTy; + std::vector<DIScope *> LexicalBlocks; + std::map<const PrototypeAST *, DIScope *> FnScopeMap; void emitLocation(ExprAST *AST); - MDType *getDoubleTy(); + DIType *getDoubleTy(); } KSDbgInfo; static std::string IdentifierStr; // Filled in if tok_identifier @@ -816,7 +816,7 @@ static PrototypeAST *ParseExtern() { static DIBuilder *DBuilder; -MDType *DebugInfo::getDoubleTy() { +DIType *DebugInfo::getDoubleTy() { if (DblTy) return DblTy; @@ -827,7 +827,7 @@ MDType *DebugInfo::getDoubleTy() { void DebugInfo::emitLocation(ExprAST *AST) { if (!AST) return Builder.SetCurrentDebugLocation(DebugLoc()); - MDScope *Scope; + DIScope *Scope; if (LexicalBlocks.empty()) Scope = TheCU; else @@ -836,9 +836,9 @@ void DebugInfo::emitLocation(ExprAST *AST) { DebugLoc::get(AST->getLine(), AST->getCol(), Scope)); } -static MDSubroutineType *CreateFunctionType(unsigned NumArgs, MDFile *Unit) { +static DISubroutineType *CreateFunctionType(unsigned NumArgs, DIFile *Unit) { SmallVector<Metadata *, 8> EltTys; - MDType *DblTy = KSDbgInfo.getDoubleTy(); + DIType *DblTy = KSDbgInfo.getDoubleTy(); // Add the result type. EltTys.push_back(DblTy); @@ -1227,15 +1227,15 @@ Function *PrototypeAST::Codegen() { AI->setName(Args[Idx]); // Create a subprogram DIE for this function. - MDFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU->getFilename(), + DIFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU->getFilename(), KSDbgInfo.TheCU->getDirectory()); - MDScope *FContext = Unit; + DIScope *FContext = Unit; unsigned LineNo = Line; unsigned ScopeLine = Line; - MDSubprogram *SP = DBuilder->createFunction( + DISubprogram *SP = DBuilder->createFunction( FContext, Name, StringRef(), Unit, LineNo, CreateFunctionType(Args.size(), Unit), false /* internal linkage */, - true /* definition */, ScopeLine, DebugNode::FlagPrototyped, false, F); + true /* definition */, ScopeLine, DINode::FlagPrototyped, false, F); KSDbgInfo.FnScopeMap[this] = SP; return F; @@ -1250,10 +1250,10 @@ void PrototypeAST::CreateArgumentAllocas(Function *F) { AllocaInst *Alloca = CreateEntryBlockAlloca(F, Args[Idx]); // Create a debug descriptor for the variable. - MDScope *Scope = KSDbgInfo.LexicalBlocks.back(); - MDFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU->getFilename(), + DIScope *Scope = KSDbgInfo.LexicalBlocks.back(); + DIFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU->getFilename(), KSDbgInfo.TheCU->getDirectory()); - MDLocalVariable *D = DBuilder->createLocalVariable( + DILocalVariable *D = DBuilder->createLocalVariable( dwarf::DW_TAG_arg_variable, Scope, Args[Idx], Unit, Line, KSDbgInfo.getDoubleTy(), Idx); |