summaryrefslogtreecommitdiff
path: root/examples/Kaleidoscope
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-07-31 17:55:53 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-07-31 17:55:53 +0000
commitaa50fa7c2f6a22d97a11336d7281377dcfcafc9d (patch)
tree7b2f76cc14efd083833a4fac0f769b4edca267f1 /examples/Kaleidoscope
parent3f2cb5c959754a99ebe7fe9611e8788afd2da8e8 (diff)
DI: Rewrite the DIBuilder local variable API
Replace the general `createLocalVariable()` with two more specific functions: `createParameterVariable()` and `createAutoVariable()`, and rewrite the documentation. Besides cleaning up the API, this avoids exposing the fake DWARF tags `DW_TAG_arg_variable` and `DW_TAG_auto_variable` to frontends, and is preparation for removing them completely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/Kaleidoscope')
-rw-r--r--examples/Kaleidoscope/Chapter8/toy.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp
index 72e5089177b..f525ac7a1b0 100644
--- a/examples/Kaleidoscope/Chapter8/toy.cpp
+++ b/examples/Kaleidoscope/Chapter8/toy.cpp
@@ -1253,9 +1253,8 @@ void PrototypeAST::CreateArgumentAllocas(Function *F) {
DIScope *Scope = KSDbgInfo.LexicalBlocks.back();
DIFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU->getFilename(),
KSDbgInfo.TheCU->getDirectory());
- DILocalVariable *D = DBuilder->createLocalVariable(
- dwarf::DW_TAG_arg_variable, Scope, Args[Idx], Unit, Line,
- KSDbgInfo.getDoubleTy(), true, 0, Idx + 1);
+ DILocalVariable *D = DBuilder->createParameterVariable(
+ Scope, Args[Idx], Idx + 1, Unit, Line, KSDbgInfo.getDoubleTy(), true);
DBuilder->insertDeclare(Alloca, D, DBuilder->createExpression(),
DebugLoc::get(Line, 0, Scope),