Skip to content

Commit

Permalink
Cleanup unused vector (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer authored Oct 6, 2024
1 parent ff0ba7b commit 4268557
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: hendrikmuhs/ccache-action@v1

- name: Setup Dependencies
run: sudo apt-get install ninja-build pipx uuid-dev
run: sudo apt-get install ninja-build pipx uuid-dev checksec jq

- name: Cache LLVM
id: cache-llvm
Expand Down Expand Up @@ -66,6 +66,10 @@ jobs:
mv ./src/spice spice
chmod +x spice
- name: Run Checksec
working-directory: bin
run: checksec --file=./spice --output=json | jq

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion src-bootstrap/ast/ast-nodes.spice
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ p ASTNode.ctor(CodeLoc codeLoc) {
assert false; // Please override at child level
}*/

public p ASTNode.addChild(ASTNode *child) {
public p ASTNode.addChild(ASTNode* child) {
this.children.pushBack(child);
child.parent = this;
}
Expand Down
1 change: 0 additions & 1 deletion src-bootstrap/global/global-resource-manager.spice
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public type GlobalResourceManager struct : IGlobalResourceManager {
public Vector<String> compileTimeStringValues
public BlockAllocator<ASTNode> astNodeAlloc // Used to allocate all AST nodes
public UnorderedMap<String, heap SourceFile*> sourceFiles // The GlobalResourceManager owns all source files
public Vector<ASTNode*> astNodes
public CliOptions& cliOptions
public ExternalLinkerInterface linker
public CacheManager cacheManager
Expand Down
1 change: 0 additions & 1 deletion src-bootstrap/parser/parser.spice
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ f<T*> Parser.createNode<T>() {
// Create the new node
//T* node = this.resourceManager.astNodeAlloc.allocate(T(this.lexer.getCodeLoc()));
T* node = this.astNodeAlloc.allocate(T(this.lexer.getCodeLoc()));
//this.resourceManager.astNodes.pushBack(node);

// If this is not the entry node, we need to add the new node to its parent
if !isRootNode {
Expand Down
1 change: 0 additions & 1 deletion src/ast/ASTBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,6 @@ template <typename T> T *ASTBuilder::createNode(const ParserRuleContext *ctx) {

// Create the new node
T *node = resourceManager.astNodeAlloc.allocate<T>(getCodeLoc(ctx));
resourceManager.astNodes.push_back(node);

// If this is not the entry node, we need to add the new node to its parent
if constexpr (!std::is_same_v<T, EntryNode>)
Expand Down
4 changes: 2 additions & 2 deletions src/global/GlobalResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ GlobalResourceManager::GlobalResourceManager(const CliOptions &cliOptions)
if (cliOptions.isNativeTarget && cliOptions.useCPUFeatures) {
// Retrieve native CPU name and the supported CPU features
cpuName = llvm::sys::getHostCPUName();
for (const llvm::StringMapEntry<bool> &feature : llvm::sys::getHostCPUFeatures()) {
for (const auto &[name, enabled] : llvm::sys::getHostCPUFeatures()) {
if (featureString.rdbuf()->in_avail() > 0)
featureString << ',';
featureString << (feature.second ? '+' : '-') << feature.first().str();
featureString << (enabled ? '+' : '-') << name.str();
}
}
cpuFeatures = featureString.str();
Expand Down
1 change: 0 additions & 1 deletion src/global/GlobalResourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class GlobalResourceManager {
std::vector<std::string> compileTimeStringValues;
BlockAllocator<ASTNode> astNodeAlloc = BlockAllocator<ASTNode>(memoryManager); // Used to allocate all AST nodes
std::unordered_map<std::string, std::unique_ptr<SourceFile>> sourceFiles; // The GlobalResourceManager owns all source files
std::vector<ASTNode *> astNodes;
const CliOptions &cliOptions;
ExternalLinkerInterface linker;
CacheManager cacheManager;
Expand Down

0 comments on commit 4268557

Please sign in to comment.