summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/examples/Kaleidoscope/Chapter9/toy.cpp5
-rw-r--r--llvm/include/llvm/IR/DebugInfoMetadata.h7
2 files changed, 6 insertions, 6 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp
index 7a12b5a80cc..19bac1a8bc7 100644
--- a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp
@@ -1245,9 +1245,8 @@ Function *FunctionAST::codegen() {
unsigned ScopeLine = LineNo;
DISubprogram *SP = DBuilder->createFunction(
FContext, P.getName(), StringRef(), Unit, LineNo,
- CreateFunctionType(TheFunction->arg_size(), Unit),
- false /* internal linkage */, true /* definition */, ScopeLine,
- DINode::FlagPrototyped, false);
+ CreateFunctionType(TheFunction->arg_size(), Unit), ScopeLine,
+ DINode::FlagPrototyped, DISubprogram::SPFlagDefinition);
TheFunction->setSubprogram(SP);
// Push the current scope.
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 0c0057163b3..8e502e479f1 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -1628,9 +1628,10 @@ public:
bool IsOptimized,
unsigned Virtuality = SPFlagNonvirtual) {
// We're assuming virtuality is the low-order field.
- static_assert(SPFlagVirtual == dwarf::DW_VIRTUALITY_virtual &&
- SPFlagPureVirtual == dwarf::DW_VIRTUALITY_pure_virtual,
- "Virtuality constant mismatch");
+ static_assert(
+ int(SPFlagVirtual) == int(dwarf::DW_VIRTUALITY_virtual &&
+ int(SPFlagPureVirtual) == int(dwarf::DW_VIRTUALITY_pure_virtual),
+ "Virtuality constant mismatch");
return static_cast<DISPFlags>((Virtuality & SPFlagVirtuality) |
(IsLocalToUnit ? SPFlagLocalToUnit : 0) |
(IsDefinition ? SPFlagDefinition : 0) |
OpenPOWER on IntegriCloud