Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -2653,9 +2653,12 @@ } bool FunctionDecl::isNoReturn() const { - return hasAttr() || hasAttr() || - hasAttr() || - getType()->getAs()->getNoReturnAttr(); + bool HasNoReturnAttr = hasAttr() || hasAttr() || hasAttr(); + const auto *FuncType = getType()->getAs(); + bool TypeHasNoReturnAttr = false; + if (FuncType) + TypeHasNoReturnAttr = FuncType->getNoReturnAttr(); + return HasNoReturnAttr || TypeHasNoReturnAttr; } void Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -2641,6 +2641,9 @@ llvm::DIScope *Mod = getParentModuleOrNull(RDecl); FDContext = getContextDescriptor(RDecl, Mod ? Mod : TheCU); } + // Check if it is a noreturn-marked function + if (FD->isNoReturn()) + Flags |= llvm::DINode::FlagNoReturn; // Collect template parameters. TParamsArray = CollectFunctionTemplateParams(FD, Unit); }