Skip to content

Commit

Permalink
Rename spicelib to spice_core (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer authored Jun 14, 2024
1 parent 6a3a826 commit cffb512
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ include_directories(../lib/antlr4/runtime/Cpp/runtime/src)
include_directories(${ANTLR_Spice_OUTPUT_DIR})

target_link_libraries(spice antlr4_static ${LLVM_LIBS})
add_library(spicelib STATIC ${SOURCES} ${ANTLR_Spice_CXX_OUTPUTS})
add_library(spice_core STATIC ${SOURCES} ${ANTLR_Spice_CXX_OUTPUTS})

# Add leak check target
add_custom_target(spiceleakcheck COMMAND valgrind --leak-check=full --error-exitcode=1 ./spice DEPENDS spice)
8 changes: 4 additions & 4 deletions src/typechecker/MacroDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define SOFT_ERROR_ER(node, type, message) \
{ \
resourceManager.errorManager.addSoftError(node, type, message); \
return ExprResult{node->setEvaluatedSymbolType(QualType(TY_UNRESOLVED), manIdx)}; \
return ExprResult{(node)->setEvaluatedSymbolType(QualType(TY_UNRESOLVED), manIdx)}; \
}

#define SOFT_ERROR_QT(node, type, message) \
Expand All @@ -30,19 +30,19 @@

#define HANDLE_UNRESOLVED_TYPE_ER(type) \
{ \
if (type.is(TY_UNRESOLVED)) \
if ((type).is(TY_UNRESOLVED)) \
return ExprResult{node->setEvaluatedSymbolType(QualType(TY_UNRESOLVED), manIdx)}; \
}

#define HANDLE_UNRESOLVED_TYPE_QT(qualType) \
{ \
if (qualType.is(TY_UNRESOLVED)) \
if ((qualType).is(TY_UNRESOLVED)) \
return node->setEvaluatedSymbolType(qualType, manIdx); \
}

#define HANDLE_UNRESOLVED_TYPE_PTR(type) \
{ \
if (type.is(TY_UNRESOLVED)) \
if ((type).is(TY_UNRESOLVED)) \
return nullptr; \
}

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include_directories(${ANTLR_Spice_OUTPUT_DIR})
include_directories(../lib/antlr4/runtime/Cpp/runtime/src)

add_test(NAME spicetest COMMAND spicetest)
target_link_libraries(spicetest PUBLIC spicelib gtest gmock antlr4_static ${LLVM_LIBS})
target_link_libraries(spicetest PUBLIC spice_core gtest gmock antlr4_static ${LLVM_LIBS})

# Test files symlink
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/test-files ${CMAKE_CURRENT_BINARY_DIR}/test-files SYMBOLIC)
Expand Down
6 changes: 3 additions & 3 deletions test/unittest/UnitBlockAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class DummyNode : public ASTNode {
~DummyNode() override { destructedDummyNodes++; }

// Visitor methods
std::any accept(AbstractASTVisitor *visitor) override { return {}; }
std::any accept(ParallelizableASTVisitor *visitor) const override { return {}; }
std::any accept(AbstractASTVisitor *visitor) override { return {}; } // LCOV_EXCL_LINE
std::any accept(ParallelizableASTVisitor *visitor) const override { return {}; } // LCOV_EXCL_LINE
};
static constexpr size_t DUMMY_NODE_SIZE = sizeof(DummyNode);
static_assert(DUMMY_NODE_SIZE == 104, "DummyNode size has changed. Update test accordingly.");
Expand Down Expand Up @@ -120,7 +120,7 @@ TEST(BlockAllocatorTest, TestBlockAllocatorOOM) {
ASSERT_EQ(i, nodes.at(i)->codeLoc.line);
ASSERT_EQ(1, nodes.at(i)->codeLoc.col);
}
FAIL(); // Should not reach this point
FAIL(); // LCOV_EXCL_LINE - Should not reach this point
} catch (CompilerError &ce) {
std::stringstream ss;
ss << "[Error|Compiler]:\n";
Expand Down

0 comments on commit cffb512

Please sign in to comment.