Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 86e7a05

Browse files
committed
PR35705: Fix Chapter 9 example code for API changes to DIBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321214 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d694a38 commit 86e7a05

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Diff for: docs/tutorial/LangImpl09.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ expressions:
197197
if (DblTy)
198198
return DblTy;
199199
200-
DblTy = DBuilder->createBasicType("double", 64, 64, dwarf::DW_ATE_float);
200+
DblTy = DBuilder->createBasicType("double", 64, dwarf::DW_ATE_float);
201201
return DblTy;
202202
}
203203

@@ -208,7 +208,8 @@ And then later on in ``main`` when we're constructing our module:
208208
DBuilder = new DIBuilder(*TheModule);
209209
210210
KSDbgInfo.TheCU = DBuilder->createCompileUnit(
211-
dwarf::DW_LANG_C, "fib.ks", ".", "Kaleidoscope Compiler", 0, "", 0);
211+
dwarf::DW_LANG_C, DBuilder->createFile("fib.ks", "."),
212+
"Kaleidoscope Compiler", 0, "", 0);
212213

213214
There are a couple of things to note here. First, while we're producing a
214215
compile unit for a language called Kaleidoscope we used the language

Diff for: examples/Kaleidoscope/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ add_subdirectory(Chapter5)
1414
add_subdirectory(Chapter6)
1515
add_subdirectory(Chapter7)
1616
add_subdirectory(Chapter8)
17+
add_subdirectory(Chapter9)

Diff for: examples/Kaleidoscope/Chapter9/toy.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ DIType *DebugInfo::getDoubleTy() {
823823
if (DblTy)
824824
return DblTy;
825825

826-
DblTy = DBuilder->createBasicType("double", 64, 64, dwarf::DW_ATE_float);
826+
DblTy = DBuilder->createBasicType("double", 64, dwarf::DW_ATE_float);
827827
return DblTy;
828828
}
829829

@@ -1436,7 +1436,8 @@ int main() {
14361436
// Currently down as "fib.ks" as a filename since we're redirecting stdin
14371437
// but we'd like actual source locations.
14381438
KSDbgInfo.TheCU = DBuilder->createCompileUnit(
1439-
dwarf::DW_LANG_C, "fib.ks", ".", "Kaleidoscope Compiler", 0, "", 0);
1439+
dwarf::DW_LANG_C, DBuilder->createFile("fib.ks", "."),
1440+
"Kaleidoscope Compiler", 0, "", 0);
14401441

14411442
// Run the main "interpreter loop" now.
14421443
MainLoop();

0 commit comments

Comments
 (0)