Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cilksan/csanrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void __csanrt_unit_init(

acquired = 1;
assert(lock == acquired);
int res = lock.compare_exchange_strong(
[[maybe_unused]] int res = lock.compare_exchange_strong(
acquired, 0, std::memory_order::memory_order_seq_cst);
assert(res);
}
Expand Down
6 changes: 3 additions & 3 deletions cilksan/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MemoryAccess_t {
csi_id_t ver_acc_id = UNKNOWN_CSI_ACC_ID;

// Default constructor
MemoryAccess_t() {}
MemoryAccess_t() = default;
MemoryAccess_t(DS_t *func, version_t version, csi_id_t acc_id, MAType_t type)
: ver_func(makeVerFunc(func, version)),
ver_acc_id(makeTypedID(acc_id, type)) {
Expand Down Expand Up @@ -120,7 +120,7 @@ class MemoryAccess_t {

// Set the fields of this MemoryAccess_t directly. This method is used to
// avoid unnecessary updates to reference counts that may be incurred by using
// the copy contructor.
// the copy constructor.
void set(DS_t *func, version_t version, csi_id_t acc_id, MAType_t type) {
DS_t *this_func = getFuncFromVerFunc();
if (this_func != func) {
Expand Down Expand Up @@ -233,7 +233,7 @@ class MemoryAccess_t {
// }
// }

// Logic to check if the given previous MemoryAccess_t is logically in
// Check if the given previous MemoryAccess_t is logically in
// parallel with the current strand.
__attribute__((always_inline)) static bool
previousAccessInParallel(MemoryAccess_t *PrevAccess, const FrameData_t *f) {
Expand Down
4 changes: 2 additions & 2 deletions cilksan/disjointset.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class DisjointSet_t {
return _list;
}

// The length of the list. Automically reset to 0 on unlock().
// The length of the list. Automatically reset to 0 on unlock().
__attribute__((always_inline)) int length() { return _length; }

// Crashes the program if lock() is called a second time before unlock().
Expand Down Expand Up @@ -571,7 +571,7 @@ class DisjointSet_t {
FullSlabs = Slab;
}

cilksan_assert(DJSet && "No disjoinst set found.");
cilksan_assert(DJSet && "No disjoint set found.");
return DJSet;
}

Expand Down
2 changes: 1 addition & 1 deletion cilksan/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ static std::map<uintptr_t, size_t> pages_to_clear;
// dlsym uses some of the memory functions we are trying to interpose, which
// means that calling dlsym directly will lead to infinite recursion and a
// segfault. Fortunately, dlsym can make do with memory-allocation functions
// returning NULL, so we return NULL when we detect this inifinite recursion.
// returning NULL, so we return NULL when we detect this infinite recursion.
//
// This trick seems questionable, but it also seems to be standard practice.
// It's the same trick used by memusage.c in glibc, and there's little
Expand Down
4 changes: 2 additions & 2 deletions cilksan/locking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ static LockID_t next_lock_id = atomic_lock_id + 1;
// Map from memory addresses to locks allocated at those locations.
static AddrMap_t<LockID_t> lock_ids;

static inline void emit_acquire_release_warning(bool is_aquire,
static inline void emit_acquire_release_warning(bool is_acquire,
const void *mutex) {
if (is_aquire)
if (is_acquire)
fprintf(err_io,
"Cilksan Warning: Cannot model lock-acquire of unknown lock at "
"location %p\n",
Expand Down
8 changes: 4 additions & 4 deletions cilksan/simple_shadow_mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ template <unsigned AllocIdx> class SimpleDictionary {
static constexpr uintptr_t LINE_IDX_MASK = LINE_MASK ^ PAGE_MASK;

// Helper methods to get the indices into the dictionary from a given address.
// We used these helper methods, rather than a bitfiled struct, because the
// We used these helper methods, rather than a bitfield struct, because the
// language standard provides too few guarantees on the order of fields in a
// bitfield struct.
__attribute__((always_inline)) static uintptr_t byte(uintptr_t addr) {
Expand Down Expand Up @@ -156,7 +156,7 @@ template <unsigned AllocIdx> class SimpleDictionary {
Chunk_t() = delete;
};

// Helper methods to check if chunk startsat a line or page boundary.
// Helper methods to check if chunk starts at a line or page boundary.
__attribute__((always_inline)) static bool isLineStart(Chunk_t chunk) {
return isLineStart(chunk.addr);
}
Expand Down Expand Up @@ -312,7 +312,7 @@ template <unsigned AllocIdx> class SimpleDictionary {
void refine(unsigned newLgGrainsize) {
cilksan_assert(newLgGrainsize < getLgGrainsize() &&
"Invalid grainsize for refining Line_t.");
// If Data hasn't been materialzed yet, then just update LgGrainsize.
// If Data hasn't been materialized yet, then just update LgGrainsize.
if (!isMaterialized()) {
setLgGrainsize(newLgGrainsize);
return;
Expand Down Expand Up @@ -382,7 +382,7 @@ template <unsigned AllocIdx> class SimpleDictionary {
// Get the grainsize of the access.
unsigned AccessedLgGrainsize = Accessed.getLgGrainsize();

// If we're overwritting the entire line, then we can coalesce the line.
// If we're overwriting the entire line, then we can coalesce the line.
if (AccessedLgGrainsize == LG_LINE_SIZE) {
// Reset the line if necessary.
if (getLgGrainsize() != LG_LINE_SIZE)
Expand Down
4 changes: 2 additions & 2 deletions cilksan/spbag.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ class SPBagInterface {
if (!that->get_ds())
return;

// cilksan_assert(that->_ds && "No disjointset node with that bag.");
// cilksan_assert(that->_ds && "No disjoint set node with that bag.");
if (!_ds) {
that->get_ds()->inc_ref_count();
_ds = that->get_ds();
return;
}

cilksan_assert(_ds && "No disjointset node with this bag.");
cilksan_assert(_ds && "No disjoint set node with this bag.");
set_ds(_ds->combine(that->get_ds()));
}
};
Expand Down
5 changes: 2 additions & 3 deletions cilkscale/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#if SERIAL_TOOL
#include <cilk/cilk_stub.h>
#else // !SERIAL_TOOL
#include <cilk/cilk.h>
#include <cilk/ostream_reducer.h>
#include <cilk/ostream_reducer>
using out_reducer = cilk::ostream_reducer<char>;
#endif // SERIAL_TOOL

Expand Down Expand Up @@ -98,7 +97,7 @@ class BenchmarkImplT {

// Top-level benchmarking tool.
static BenchmarkImplT *createTool(void) {
// Ordered dynamic initalization should ensure that it's safe to create the
// Ordered dynamic initialization should ensure that it's safe to create the
// tool.
return new BenchmarkImplT(getenv("CILKSCALE_OUT"));
}
Expand Down
5 changes: 2 additions & 3 deletions cilkscale/cilkscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#if SERIAL_TOOL
FILE *err_io = stderr;
#else // !SERIAL_TOOL
#include <cilk/cilk_api.h>
#include <cilk/ostream_reducer.h>
#include <cilk/ostream_reducer>
using out_reducer = cilk::ostream_reducer<char>;
#endif // SERIAL_TOOL

Expand Down Expand Up @@ -72,7 +71,7 @@ class CilkscaleImplT {

// Top-level Cilkscale tool.
static CilkscaleImplT *createTool(void) {
// Ordered dynamic initalization should ensure that it's safe to create the
// Ordered dynamic initialization should ensure that it's safe to create the
// tool.
return new CilkscaleImplT(getenv("CILKSCALE_OUT"));
}
Expand Down
18 changes: 9 additions & 9 deletions cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,20 @@ if(APPLE)

# Note: In order to target x86_64h on OS X the minimum deployment target must
# be 10.8 or higher.
set(DEFAULT_SANITIZER_MIN_OSX_VERSION 10.14)
set(DEFAULT_CILKTOOLS_MIN_OSX_VERSION 11)
set(DARWIN_osx_MIN_VER_FLAG "-mmacosx-version-min")
if(NOT SANITIZER_MIN_OSX_VERSION)
if(NOT CILKTOOLS_MIN_OSX_VERSION)
string(REGEX MATCH "${DARWIN_osx_MIN_VER_FLAG}=([.0-9]+)"
MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}")
if(MACOSX_VERSION_MIN_FLAG)
set(SANITIZER_MIN_OSX_VERSION "${CMAKE_MATCH_1}")
set(CILKTOOLS_MIN_OSX_VERSION "${CMAKE_MATCH_1}")
elseif(CMAKE_OSX_DEPLOYMENT_TARGET)
set(SANITIZER_MIN_OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET})
set(CILKTOOLS_MIN_OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET})
else()
set(SANITIZER_MIN_OSX_VERSION ${DEFAULT_SANITIZER_MIN_OSX_VERSION})
set(CILKTOOLS_MIN_OSX_VERSION ${DEFAULT_CILKTOOLS_MIN_OSX_VERSION})
endif()
if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
message(FATAL_ERROR "macOS deployment target '${SANITIZER_MIN_OSX_VERSION}' is too old.")
if(CILKTOOLS_MIN_OSX_VERSION VERSION_LESS "10.7")
message(FATAL_ERROR "macOS deployment target '${CILKTOOLS_MIN_OSX_VERSION}' is too old.")
endif()
endif()

Expand All @@ -321,10 +321,10 @@ if(APPLE)

set(DARWIN_osx_CFLAGS
${DARWIN_COMMON_CFLAGS}
${DARWIN_osx_MIN_VER_FLAG}=${SANITIZER_MIN_OSX_VERSION})
${DARWIN_osx_MIN_VER_FLAG}=${CILKTOOLS_MIN_OSX_VERSION})
set(DARWIN_osx_LINK_FLAGS
${DARWIN_COMMON_LINK_FLAGS}
${DARWIN_osx_MIN_VER_FLAG}=${SANITIZER_MIN_OSX_VERSION})
${DARWIN_osx_MIN_VER_FLAG}=${CILKTOOLS_MIN_OSX_VERSION})

if(DARWIN_osx_SYSROOT)
list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT})
Expand Down
4 changes: 1 addition & 3 deletions test/cilksan/TestCases/ploop-spawn.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// RUN: %clangxx_cilksan -fopencilk -Og %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
#include <cilk/opadd_reducer>
#include <cstdio>
#include <cstdlib>
#include <vector>

#include <cilk/cilk.h>
#include <cilk/opadd_reducer.h>

template<typename T> void sum(std::vector<T> &v) {
T sum_racy = 0;
cilk::opadd_reducer<T> sum_pos = 0;
Expand Down
7 changes: 3 additions & 4 deletions test/cilksan/TestCases/reducer-lock-test.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// RUN: %clangxx_cilksan -fopencilk -Og %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s

#include <stdio.h>
#include <cilk/cilk.h>
#include <cilk/opadd_reducer.h>
#include <chrono>
#include <thread>
#include <cilk/opadd_reducer>
#include <pthread.h>
#include <stdio.h>
#include <thread>

int main() {
cilk::opadd_reducer<int> sum = 0;
Expand Down
4 changes: 1 addition & 3 deletions test/cilksan/TestCases/sum-ints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <iostream>
#include <sstream>
#include <cilk/cilk.h>
#include <chrono>
#include <pthread.h>
#include <typeinfo>
Expand All @@ -27,8 +26,7 @@
#include <vector>
#include <type_traits>
#include <random>

#include <cilk/opadd_reducer.h>
#include <cilk/opadd_reducer>
#include <cilk/cilk_api.h>

#include <cilk/cilksan.h>
Expand Down
20 changes: 9 additions & 11 deletions test/cilksan/TestCases/sum-vector-int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,19 @@
*/


#include <iostream>
#include <sstream>
#include <cilk/cilk.h>
#include <chrono>
#include <pthread.h>
#include <typeinfo>
#include <numeric>
#include <algorithm>
#include <chrono>
#include <cilk/opadd_reducer>
#include <iostream>
#include <iterator>
#include <vector>
#include <type_traits>
#include <numeric>
#include <pthread.h>
#include <random>
#include <sstream>
#include <type_traits>
#include <typeinfo>
#include <unistd.h>

#include <cilk/opadd_reducer.h>
#include <vector>

#ifdef WLS
#include <cilk/cilk_api.h>
Expand Down
Loading