Skip to content

Commit 2114194

Browse files
committed
adding comments to Makefile
1 parent 8a987a5 commit 2114194

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

Makefile

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Based on https://stackoverflow.com/a/52036564 which is well worth reading!
22

3-
CXXFLAGS += -std=c++20 -W -Wall -g -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -fsanitize=address -static-libasan -O0 -rdynamic --coverage -I include
4-
5-
SOURCES := $(wildcard src/*.cpp)
3+
CXXFLAGS := -std=c++20 # use the 2020 version of the C++ standard
4+
CXXFLAGS += -g # generate debugging information
5+
CXXFLAGS += -Wall # enable most warnings, except those about ...
6+
CXXFLAGS += -Wno-unused-parameter # ... unused function parameters, ...
7+
CXXFLAGS += -Wno-unused-variable # ... unused variables, ...
8+
CXXFLAGS += -Wno-unused-function # ... or unused functions.
9+
CXXFLAGS += -fsanitize=address # enable address sanitization
10+
CXXFLAGS += -static-libasan # statically link with Address Sanitizer
11+
CXXFLAGS += -O0 # perform minimal optimisations
12+
CXXFLAGS += -rdynamic # to get more helpful traces when debugging
13+
CXXFLAGS += --coverage # enable code coverage
14+
CXXFLAGS += -I include # look for header files in the `include` directory
15+
16+
SOURCES := $(wildcard src/*.cpp) # all .cpp files are to be considered source files
617
DEPENDENCIES := $(patsubst src/%.cpp,build/%.d,$(SOURCES))
718

819
OBJECTS := $(patsubst src/%.cpp,build/%.o,$(SOURCES))

include/ast_function_definition.hpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,32 @@
55

66
class FunctionDefinition : public Node
77
{
8+
89
private:
10+
911
Node *declaration_specifiers_;
1012
Node *declarator_;
1113
Node *compound_statement_;
1214

1315
public:
14-
FunctionDefinition(Node *declaration_specifiers, Node *declarator, Node *compound_statement) : declaration_specifiers_(declaration_specifiers), declarator_(declarator), compound_statement_(compound_statement){};
16+
17+
FunctionDefinition
18+
(Node *declaration_specifiers,
19+
Node *declarator,
20+
Node *compound_statement) :
21+
declaration_specifiers_(declaration_specifiers),
22+
declarator_(declarator),
23+
compound_statement_(compound_statement){};
24+
1525
~FunctionDefinition()
1626
{
1727
delete declaration_specifiers_;
1828
delete declarator_;
1929
delete compound_statement_;
2030
};
31+
2132
void EmitRISC(std::ostream &stream, Context &context) const override;
33+
2234
void Print(std::ostream &stream) const override;
2335
};
2436

0 commit comments

Comments
 (0)