Add Driver.Context setter (#89081)
authorMike Voorhees <mrvoorhe@users.noreply.github.com>
Wed, 19 Jul 2023 19:41:57 +0000 (15:41 -0400)
committerGitHub <noreply@github.com>
Wed, 19 Jul 2023 19:41:57 +0000 (12:41 -0700)
commit50ba405797f6cc57d57ff4d2503079b4c32acc7b
tree62c407732004858e34512dfca142e073babd5930
parent4c356de76a1a9f0df9f43ec1baa9feb0ddd73ce0
Add Driver.Context setter (#89081)

We implement our own `Driver.SetupContext`.  Our command line parsing logic is different and we have additional command line options.

In our very old revision of the upstream linker there was
```
protected LinkContext context;
```

Which we would set.  This would ensure that if one of the helper methods that uses the context were called that things would all work.
The most common scenario seems to be for error logging.  There are many helper methods that will call `Context.LogError` and if we haven't set the `context` field by then we have a problem.

We are syncing up and now the `context` field is private and there is a protected property getter, but no setter.

Adding a setter was the easiest way to get our context stored in the `context` field.
src/tools/illink/src/linker/Linker/Driver.cs