-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some parallelism issues on for statement (#69 from wesuRage/main)
Fixed some parallelism issues on for statement
- Loading branch information
Showing
12 changed files
with
68 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef GLOBAL_ID_RETURN_H | ||
#define GLOBAL_ID_RETURN_H | ||
|
||
#include <string> | ||
|
||
extern std::string global_id_return; | ||
|
||
#endif // GLOBAL_ID_RETURN_H |
9 changes: 6 additions & 3 deletions
9
src/backend/generator/expressions/generate_assignment_expr.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#include "backend/generator/expressions/generate_identifier.hpp" | ||
#include "backend/generator/symbols/identifier_symbol_table.hpp" | ||
#include "backend/generator/parallel/queue.hpp" | ||
#include "backend/generator/utils/return_id.hpp" | ||
|
||
llvm::Value *generate_identifier(IdentifierNode *node) { | ||
try { | ||
return find_or_wait_for_identifier(node, global_id_return); | ||
} catch (...) { | ||
throw std::runtime_error("Error: identifier not found!"); | ||
const SymbolInfo* id = find_identifier(node->symbol); | ||
if (id) { | ||
if (global_id_return == "declaration") { | ||
return id->declaration; | ||
} else { | ||
return id->value; | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
#include "backend/generator/expressions/generate_expr.hpp" | ||
#include "backend/generator/utils/generate_stop.hpp" | ||
#include "backend/generator/utils/return_id.hpp" | ||
|
||
llvm::Value *generate_stop(AstNode *node, llvm::LLVMContext &Context, llvm::IRBuilder<> &Builder, llvm::Module &Module) { | ||
BinaryExprNode *bin_expr = (BinaryExprNode *)node->data; | ||
return generate_expr(bin_expr->right, Context, Builder, Module); | ||
|
||
global_id_return = "declaration"; | ||
llvm::Value *expr = generate_expr(bin_expr->right, Context, Builder, Module); | ||
global_id_return = "value"; | ||
|
||
return expr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "backend/generator/utils/return_id.hpp" | ||
|
||
std::string global_id_return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters