[silgen] Mark a bunch of functions that SILGen open-codeds as "auto-generated" and thus not user generated code.

This ensures that we do not emit diagnostics onto these functions. I noticed we
were doing this with my work on opt-remarks when I was hitting diagnostics in
these functions in a set of subsequent commits.

The way that I found these is that I went through this file and looked for any
cases where we were never calling emitStmt on a user provided function body.

I also eliminated two places where we were setting a new DebugScope even though
preEmitFunction already does that for us.
This commit is contained in:
Michael Gottesman
2020-07-28 12:21:39 -07:00
parent 6187697a6c
commit e3fa1376f6
2 changed files with 31 additions and 20 deletions

View File

@@ -538,7 +538,8 @@ public:
/// it may have been generated from. These locations will have an artificial
/// line location of zero in DWARF, but in CodeView we want to use the given
/// line since line zero does not represent an artificial line in CodeView.
static RegularLocation getAutoGeneratedLocation(SourceLoc L) {
template <typename InputLocTy>
static RegularLocation getAutoGeneratedLocation(InputLocTy L) {
RegularLocation AL(L);
AL.markAutoGenerated();
return AL;