Skip to content

Commit 443745f

Browse files
author
kr-2003
committed
clang-tidy and env var
1 parent 4bf44b3 commit 443745f

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ add_definitions(${LLVM_DEFINITIONS_LIST})
314314
string(REGEX REPLACE "/build/lib/cmake/llvm$" "" LLVM_SOURCE_DIR "${LLVM_DIR}")
315315
add_definitions(-DLLVM_SOURCE_DIR="${LLVM_SOURCE_DIR}")
316316

317+
if(DEFINED LLVM_BUILT_WITH_OOP_JIT)
318+
add_definitions(-DLLVM_BUILT_WITH_OOP_JIT)
319+
endif()
320+
317321
# If the llvm sources are present add them with higher priority.
318322
if (LLVM_BUILD_MAIN_SRC_DIR)
319323
# LLVM_INCLUDE_DIRS contains the include paths to both LLVM's source and

lib/CppInterOp/Compatibility.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ inline void codeComplete(std::vector<std::string>& Results,
442442
#if defined(LLVM_BUILT_WITH_OOP_JIT) && !defined(_WIN32)
443443
inline pid_t getExecutorPID() { return /*llvm*/ getLastLaunchedExecutorPID(); }
444444

445-
inline pid_t getNthExecutorPID() {
446-
return /*llvm*/ getNthLaunchedExecutorPID();
445+
inline pid_t getNthExecutorPID(int n) {
446+
return /*llvm*/ getNthLaunchedExecutorPID(n);
447447
}
448448
#endif
449449

lib/CppInterOp/CppInterOpInterpreter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#endif
4545
#include <algorithm>
4646
#include <cstdio>
47-
#include <stdio.h>
47+
#include <memory>
4848
#include <utility>
4949
#include <vector>
5050

@@ -160,9 +160,9 @@ class Interpreter {
160160
bool outOfProcess = false;
161161

162162
bool initializeTempFiles() {
163-
stdin_file.reset(tmpfile());
164-
stdout_file.reset(tmpfile());
165-
stderr_file.reset(tmpfile());
163+
stdin_file.reset(tmpfile()); // NOLINT(cppcoreguidelines-owning-memory)
164+
stdout_file.reset(tmpfile()); // NOLINT(cppcoreguidelines-owning-memory)
165+
stderr_file.reset(tmpfile()); // NOLINT(cppcoreguidelines-owning-memory)
166166
return stdin_file && stdout_file && stderr_file;
167167
}
168168
};

unittests/CppInterOp/JitTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ TEST(Streams, StreamRedirectJIT) {
9898
printf("%s\n", "Hello World");
9999
fflush(stdout);
100100
)");
101-
std::string _ = Cpp::EndStdStreamCapture();
101+
std::string CapturedStringErr = Cpp::EndStdStreamCapture();
102102
std::string CapturedStringOut = Cpp::EndStdStreamCapture();
103103

104104
EXPECT_STREQ(CapturedStringOut.c_str(), "Hello World\n");
105+
EXPECT_STREQ(CapturedStringErr.c_str(), "");
105106
}

unittests/CppInterOp/Utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "clang/Frontend/CompilerInstance.h"
99
#include "clang/Sema/Lookup.h"
1010
#include "clang/Sema/Sema.h"
11+
#include "clang/Interpreter/PartialTranslationUnit.h"
1112

1213
#include <algorithm>
1314
#include <string>

0 commit comments

Comments
 (0)