Revert (and fix properly) "Uninitialize the file descriptor."
authorMircea Trofin <mtrofin@google.com>
Thu, 2 Feb 2023 01:39:34 +0000 (17:39 -0800)
committerMircea Trofin <mtrofin@google.com>
Thu, 2 Feb 2023 01:44:47 +0000 (17:44 -0800)
commit1d13c5ec47664ab123f0cf02b349a271e5b446ab
tree4b9b2850dd8433ee6302ef30d5b7540adb11c4d8
parent029b410df31afd6ea1aee9da6949c84b6db19112
Revert (and fix properly) "Uninitialize the file descriptor."

This reverts commit f514b0e144db063931d19a8ebc2dc42083d0eb2f.

The culprit is that InEC is initialized before Inbound, and Inbound's
initialization happens through a call to openFileForRead. However, the
typical initialization order warnings don't fire; so the behavior was:
Inbound is initialized correctly by openFileForRead; then it's reset to
whatever initializer value (0 originally).

A fix is to move Inbound's decl upfront. I'd still prefer initializing
it to something - and -1 seems like a more appropriate value (it causes
a fail-fast rather than a hang due to trying to read from a
valid-looking but unopen fd).
llvm/include/llvm/Analysis/InteractiveModelRunner.h