Skip to content

Commit 5098770

Browse files
committed
Do not pass a reference to a unique_ptr. NFC.
1 parent 55d9654 commit 5098770

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/CppInterOp/CppInterOpInterpreter.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,24 +171,24 @@ class Interpreter {
171171
private:
172172
static std::tuple<int, int, int>
173173
initAndGetFileDescriptors(std::vector<const char*>& vargs,
174-
std::unique_ptr<IOContext>& io_ctx) {
174+
IOContext& io_ctx) {
175175
int stdin_fd = 0;
176176
int stdout_fd = 1;
177177
int stderr_fd = 2;
178178

179179
// Only initialize temp files if not already initialized
180-
if (!io_ctx->stdin_file || !io_ctx->stdout_file || !io_ctx->stderr_file) {
181-
bool init = io_ctx->initializeTempFiles();
180+
if (!io_ctx.stdin_file || !io_ctx.stdout_file || !io_ctx.stderr_file) {
181+
bool init = io_ctx.initializeTempFiles();
182182
if (!init) {
183183
llvm::errs() << "Can't start out-of-process JIT execution.\n";
184184
stdin_fd = -1;
185185
stdout_fd = -1;
186186
stderr_fd = -1;
187187
}
188188
}
189-
stdin_fd = fileno(io_ctx->stdin_file.get());
190-
stdout_fd = fileno(io_ctx->stdout_file.get());
191-
stderr_fd = fileno(io_ctx->stderr_file.get());
189+
stdin_fd = fileno(io_ctx.stdin_file.get());
190+
stdout_fd = fileno(io_ctx.stdout_file.get());
191+
stderr_fd = fileno(io_ctx.stderr_file.get());
192192

193193
return std::make_tuple(stdin_fd, stdout_fd, stderr_fd);
194194
}
@@ -233,7 +233,7 @@ class Interpreter {
233233

234234
if (outOfProcess) {
235235
std::tie(stdin_fd, stdout_fd, stderr_fd) =
236-
initAndGetFileDescriptors(vargs, io_ctx);
236+
initAndGetFileDescriptors(vargs, *io_ctx);
237237

238238
if (stdin_fd == -1 || stdout_fd == -1 || stderr_fd == -1) {
239239
llvm::errs()

0 commit comments

Comments
 (0)