diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 10:09:47 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 10:09:47 +0000 |
| commit | e2c65706e61be09ddb7eeb28cd1957acd4317bcf (patch) | |
| tree | 15447a03d67d395a722c5be3f0b05bc9f197197a /lib/CodeGen/ArrayHandler.cc | |
| parent | 45c9d37eb27d204a6202b33cb37e890af0171357 (diff) | |
feat(constants): implement literal constants with lexical scope
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/ArrayHandler.cc')
| -rw-r--r-- | lib/CodeGen/ArrayHandler.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/ArrayHandler.cc b/lib/CodeGen/ArrayHandler.cc index 6a89781..40a330f 100644 --- a/lib/CodeGen/ArrayHandler.cc +++ b/lib/CodeGen/ArrayHandler.cc @@ -33,6 +33,8 @@ void ArrayHandler::setupExternalFunctions() { } const ArrayMetadata *ArrayHandler::getMetadata(const std::string &Name) const { + auto Symbol = Symbols->find(Name); + if (Symbol == Symbols->end() || !Symbol->second.IsArray) return nullptr; auto It = ArrayTable.find(Name); if (It == ArrayTable.end()) { return nullptr; @@ -93,6 +95,8 @@ void ArrayHandler::emitArrayDeclare(ArrayDeclareStmtAST *Stmt, CodeGen &CG) { return; } + if (!CG.prepareSymbolDeclaration(Name)) return; + std::vector<Value*> Lows; std::vector<Value*> Highs; |
