Skip to content

Commit bd674ff

Browse files
first commit
1 parent 2c88c5c commit bd674ff

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
66
set(CATCH_ENABLE_REPRODUCIBLE_BUILD OFF CACHE INTERNAL "Turn off tests")
77
#set(NES_WARNINGS "-Wall -Wextra -pedantic -Wno-null-character -Wno-dollar-in-identifier-extension -Werror=extra -Werror=exceptions -Werror=all -Werror=integer-overflow -Werror=return-type -Werror=return-stack-address -Werror=delete-non-virtual-dtor -Werror=deprecated -Werror=writable-strings -Werror=array-bounds -Werror=ignored-qualifiers -Werror=sign-compare -Wno-deprecated-copy-with-dtor -Wno-unused-variable -Wno-unused-but-set-variable -Wno-deprecated-declarations -Wno-invalid-offsetof ")
88

9+
10+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Werror -Wunused -Werror=vla -Wnarrowing -pedantic")
911
set(CMAKE_CXX_FLAGS "-fpermissive -fPIC -g")
1012
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
1113

nautilus-api/src/Interface/DataTypes/MemRefUtils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <Interface/DataTypes/MemRefUtils.hpp>
1717
#include <Interface/FunctionCall.hpp>
1818
#include <cstring>
19+
#include "Exceptions/NotImplementedException.hpp"
1920

2021
namespace NES::Nautilus::MemRefUtils {
2122

@@ -72,6 +73,8 @@ namespace NES::Nautilus::MemRefUtils {
7273
}
7374
NES_NOT_IMPLEMENTED();
7475
*/
76+
throw Exceptions::NotImplementedException("No plugin registered that can handle this operation between");
77+
7578
}
7679

7780
bool memeq(void *ptr1, void *ptr2, uint64_t size) { return memcmp(ptr1, ptr2, size) == 0; }

nautilus-api/src/Interface/DataTypes/Value.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <Interface/DataTypes/Value.hpp>
1818
#include <Tracing/TraceContext.hpp>
1919
#include <common/PluginRegistry.hpp>
20+
#include "Exceptions/NotImplementedException.hpp"
2021

2122
namespace NES::Nautilus {
2223

@@ -62,8 +63,8 @@ namespace NES::Nautilus {
6263
return result.value();
6364
}
6465
};
65-
//NES_THROW_RUNTIME_ERROR("No plugin registered that can handle this operation between " << left->toString() << " and "
66-
// << right->toString());
66+
throw Exceptions::NotImplementedException("No plugin registered that can handle this operation between");
67+
6768
}
6869

6970
Value<> evalWithCast(
@@ -210,7 +211,9 @@ namespace NES::Nautilus {
210211
return result.value();
211212
}
212213
};
213-
//NES_THROW_RUNTIME_ERROR("No plugin registered that can handle this operation");
214+
throw Exceptions::NotImplementedException("No plugin registered that can handle this operation between");
215+
216+
214217
}
215218

216219
Value<> ReadArrayIndexOp(const Value<> &input, Value<UInt32> &index) {
@@ -221,7 +224,9 @@ namespace NES::Nautilus {
221224
return result.value();
222225
}
223226
};
224-
//NES_THROW_RUNTIME_ERROR("No plugin registered that can handle this operation");
227+
throw Exceptions::NotImplementedException("No plugin registered that can handle this operation between");
228+
229+
225230
}
226231

227232
void WriteArrayIndexOp(const Value<> &input, Value<UInt32> &index, const Value<> &value) {
@@ -232,7 +237,7 @@ namespace NES::Nautilus {
232237
return;
233238
}
234239
};
235-
//NES_THROW_RUNTIME_ERROR("No plugin registered that can handle this operation");
240+
236241
}
237242

238243
}// namespace NES::Nautilus

nautilus-jit/src/IR/BasicBlocks/BasicBlock.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <IR/Operations/IfOperation.hpp>
1818
#include <IR/Operations/Loop/LoopOperation.hpp>
1919
#include <IR/Operations/Operation.hpp>
20+
#include <Exceptions/NotImplementedException.hpp>
2021
#include <algorithm>
2122
#include <cstdint>
2223
#include <memory>
@@ -150,9 +151,7 @@ namespace NES::Nautilus::IR {
150151
} else if (operations.back()->getOperationType() == IR::Operations::Operation::OperationType::ReturnOp) {
151152
return {};
152153
} else {
153-
//NES_ERROR("BasicBlock::getNextBlocks: Tried to get next block for unsupported operation type: "
154-
// << magic_enum::enum_name(operations.back()->getOperationType()));
155-
//NES_NOT_IMPLEMENTED();
154+
throw Exceptions::NotImplementedException("BasicBlock::getNextBlocks: Tried to get next block for unsupported operation type.");
156155
}
157156
}
158157

nautilus-jit/src/Tracing/Phases/TraceToIRConversionPhase.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,6 @@ namespace NES::Nautilus::Tracing {
331331
TraceOperation &operation) {
332332
auto leftInput = frame.getValue(createValueIdentifier(operation.input[0]));
333333
auto rightInput = frame.getValue(createValueIdentifier(operation.input[1]));
334-
335-
NES::Nautilus::IR::Operations::CompareOperation::Comparator comparator;
336-
comparator = NES::Nautilus::IR::Operations::CompareOperation::Comparator::LT;
337-
338334
auto resultIdentifier = createValueIdentifier(operation.result);
339335
auto compareOperation = std::make_shared<NES::Nautilus::IR::Operations::CompareOperation>(
340336
resultIdentifier,
@@ -352,9 +348,6 @@ namespace NES::Nautilus::Tracing {
352348
auto leftInput = frame.getValue(createValueIdentifier(operation.input[0]));
353349
auto rightInput = frame.getValue(createValueIdentifier(operation.input[1]));
354350

355-
NES::Nautilus::IR::Operations::CompareOperation::Comparator comparator;
356-
comparator = NES::Nautilus::IR::Operations::CompareOperation::Comparator::GT;
357-
358351
auto resultIdentifier = createValueIdentifier(operation.result);
359352
auto compareOperation = std::make_shared<NES::Nautilus::IR::Operations::CompareOperation>(
360353
resultIdentifier,

nautilus-jit/src/Tracing/Tag/TagRecorder.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <Exceptions/TagCreationException.hpp>
1616
#include <Tracing/Tag/TagRecorder.hpp>
1717
#include <execinfo.h>
18+
#include "Exceptions/NotImplementedException.hpp"
1819

1920
namespace NES::Nautilus::Tracing {
2021
TagRecorder::TagRecorder(TagAddress startAddress) : startAddress(startAddress) {}
@@ -33,7 +34,8 @@ namespace NES::Nautilus::Tracing {
3334
#else
3435

3536
TagVector TagRecorder::createBaseTag() {
36-
// NES_NOT_IMPLEMENTED();
37+
throw Exceptions::NotImplementedException("No plugin registered that can handle this operation between");
38+
3739
}
3840

3941
#endif

nautilus-jit/src/Tracing/TraceUtil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <Interface/DataTypes/Boolean.hpp>
1616
#include <Tracing/TraceContext.hpp>
1717
#include <Tracing/TraceUtil.hpp>
18+
#include "Exceptions/NotImplementedException.hpp"
1819

1920
namespace NES::Nautilus::Tracing::TraceUtil {
2021

@@ -42,8 +43,7 @@ namespace NES::Nautilus::Tracing::TraceUtil {
4243
return boolValue->getValue();
4344
}
4445
}
45-
46-
// NES_THROW_RUNTIME_ERROR("Can't evaluate bool on non Boolean value: " << value->toString());
46+
throw Exceptions::NotImplementedException("Can't evaluate bool on non Boolean value");
4747
}
4848

4949
void traceAssignmentOperation(const Nautilus::Tracing::ValueRef &targetRef,

0 commit comments

Comments
 (0)