Skip to content
Snippets Groups Projects
Commit 7b498bee authored by David Blaikie's avatar David Blaikie
Browse files

DebugInfo: Classify noreturn function types as non-reconstructible

This information isn't preserved in the DWARF description of function
types (though probably should be - it's preserved on the function
declarations/definitions themselves through the DW_AT_noreturn attribute
- but we should move or also include that in the subroutine type itself
too - but for now, with it not being there, the DWARF is lossy and
can't be reconstructed)
parent 0bfa1ab0
No related branches found
No related tags found
No related merge requests found
......@@ -5078,6 +5078,7 @@ struct ReconstitutableType : public RecursiveASTVisitor<ReconstitutableType> {
bool VisitFunctionProtoType(FunctionProtoType *FT) {
// noexcept is not encoded in DWARF, so the reversi
Reconstitutable &= !isNoexceptExceptionSpec(FT->getExceptionSpecType());
Reconstitutable &= !FT->getNoReturnAttr();
return Reconstitutable;
}
bool VisitRecordType(RecordType *RT) {
......
......@@ -116,4 +116,10 @@ void f() {
f1<const unsigned _BitInt(5)>();
// CHECK: !DISubprogram(name: "f1<const unsigned _BitInt(5)>",
// Add a parameter just so this differs from other attributed function types
// that don't mangle differently.
int fnrt() __attribute__((noreturn));
f1<decltype(fnrt)>();
// CHECK: !DISubprogram(name: "f1<int () __attribute__((noreturn))>",
}
......@@ -325,6 +325,8 @@ int main() {
f1<int t1<>::*>();
void fcc() __attribute__((swiftcall));
f1<decltype(fcc)>();
int fnrt() __attribute__((noreturn));
f1<decltype(fnrt)>();
}
void t8::mem() {
struct t7 { };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment