Skip to content

Commit

Permalink
[cmake] Fix macros for mocking LLVM CMake config. Fix some typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
neboat committed Jan 7, 2024
1 parent 77c5186 commit 5a80d8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions cmake/Modules/CheetahMockLLVMCMakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# The motivation for this is to be able to generate the cilktools
# lit tests suites and run them against an arbitrary LLVM toolchain
# which doesn't ship the LLVM CMake build files.
macro(cilktools_mock_llvm_cmake_config)
macro(cheetah_mock_llvm_cmake_config)
message(STATUS "Attempting to mock the changes made by LLVMConfig.cmake")
cilktools_mock_llvm_cmake_config_set_cmake_path()
cilktools_mock_llvm_cmake_config_set_target_triple()
cilktools_mock_llvm_cmake_config_include_cmake_files()
cheetah_mock_llvm_cmake_config_set_cmake_path()
cheetah_mock_llvm_cmake_config_set_target_triple()
cheetah_mock_llvm_cmake_config_include_cmake_files()
endmacro()

macro(cilktools_mock_llvm_cmake_config_set_cmake_path)
macro(cheetah_mock_llvm_cmake_config_set_cmake_path)
# Point `LLVM_CMAKE_DIR` at the source tree in the monorepo.
set(LLVM_CMAKE_DIR "${LLVM_MAIN_SRC_DIR}/cmake/modules")
if (NOT EXISTS "${LLVM_CMAKE_DIR}")
Expand All @@ -22,7 +22,7 @@ macro(cilktools_mock_llvm_cmake_config_set_cmake_path)
message(STATUS "LLVM_CMAKE_DIR: \"${LLVM_CMAKE_DIR}\"")
endmacro()

function(cilktools_mock_llvm_cmake_config_set_target_triple)
function(cheetah_mock_llvm_cmake_config_set_target_triple)
# Various bits of cilktools depend on the `LLVM_TARGET_TRIPLE` variable
# being defined. This function tries to set a sensible value for the
# variable. This is a function rather than a macro to avoid polluting the
Expand Down Expand Up @@ -69,7 +69,7 @@ function(cilktools_mock_llvm_cmake_config_set_target_triple)
set(LLVM_TARGET_TRIPLE "${LLVM_TARGET_TRIPLE}" PARENT_SCOPE)
endfunction()

macro(cilktools_mock_llvm_cmake_config_include_cmake_files)
macro(cheetah_mock_llvm_cmake_config_include_cmake_files)
# Some cilktools CMake code needs to call code in this file.
include("${LLVM_CMAKE_DIR}/AddLLVM.cmake")
endmacro()
4 changes: 2 additions & 2 deletions runtime/local-hypertable.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static inline index_t inc_index(index_t i, index_t capacity) {
// Normal Probe, Wrapped Run (NP+WR): T <= i and H[i] > i
// The probe _must continue_ even though T < H[i].
// Wrapped Probe, Normal Run (WP+NR): T > i and H[i] <= i
// The probe _must termiante_ even though T > H[i].
// The probe _must terminate_ even though T > H[i].
//
// The table uses the following bit trick to handle all of these cases simply:
//
Expand All @@ -161,7 +161,7 @@ static inline index_t inc_index(index_t i, index_t capacity) {
// coincide with unsigned integer overflow, allowing the same
// comparison to be used in all cases.
//
// We can justify this bit trick in all caes:
// We can justify this bit trick in all cases:
//
// NP+NR and WP+WR: The original termination condition, T < H[i], implies that
// -T > -H[i]. Adding i to both sides does not affect the comparison.
Expand Down

0 comments on commit 5a80d8a

Please sign in to comment.