Skip to content

Commit 99d16c6

Browse files
committed
[Heavy] Fix clang integration
1 parent 2e2efd5 commit 99d16c6

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

clang/lib/Parse/ParseDeclHeavy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ bool Parser::ParseHeavyScheme() {
316316
};
317317

318318
heavy::Context& Context = HeavyScheme->getContext();
319-
heavy::base::InitParseSourceFile(Context, ParseSourceFileFn);
319+
heavy::builtins::InitParseSourceFile(Context, ParseSourceFileFn);
320320
HEAVY_CLANG_VAR(diag_error).init(Context,
321321
Context.CreateLambda(diag_error));
322322
HEAVY_CLANG_VAR(diag_warning).init(Context,
@@ -398,7 +398,7 @@ bool Parser::ParseHeavyScheme() {
398398

399399
// Do the thing.
400400
heavy::TokenKind Terminator = heavy::tok::r_brace;
401-
HeavyScheme->ProcessTopLevelCommands(SchemeLexer, heavy::base::eval,
401+
HeavyScheme->ProcessTopLevelCommands(SchemeLexer, heavy::builtins::eval,
402402
ErrorHandler, Terminator);
403403

404404
// Return control to C++ Lexer

heavy/lib/Context.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,8 @@ SyntaxClosure* Context::CreateSyntaxClosure(SourceLocation Loc, Value Node,
16341634

16351635
EnvEntry Context::GetSyntax(EnvEntry Entry) {
16361636
heavy::Value V = Entry.Value;
1637+
if (!V)
1638+
return EnvEntry();
16371639
if (auto* B = dyn_cast<Binding>(V)) {
16381640
V = B->getValue();
16391641
// Unwrap any ExternName to see if it is a syntax.

heavy/test/Clang/import.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: clang++ -I %S/Inputs -fsyntax-only -Xclang -fheavy -Xclang -verify %s
1+
// RUN: clang++ -I %S/Inputs -I %heavy_module_path -fsyntax-only -Xclang -fheavy -Xclang -verify %s
22

33
#include <type_traits>
44

heavy/test/Clang/source-loc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// expected-note@14{{this is a bar in a list}}
99
namespace foo {
1010
heavy_scheme {
11-
(import (heavy base) (heavy clang))
11+
(import (heavy builtins) (heavy clang))
1212
(define foo 'foo)
1313
(define bar "bar")
1414
(define baz '(foo bar))

heavy/test/Nbdl/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace moo {
2626
}
2727

2828
heavy_scheme {
29-
(import (heavy base)
29+
(import (heavy builtins)
3030
(heavy clang)
3131
(heavy mlir)
3232
(nbdl comp))

heavy/test/Nbdl/context_error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: clang++ --std=c++23 -I %S/Inputs -fsyntax-only -Xclang -fheavy -Xclang -verify %s
22

33
heavy_scheme {
4-
(import (heavy base)
4+
(import (heavy builtins)
55
(heavy clang)
66
(heavy mlir)
77
(nbdl comp))

0 commit comments

Comments
 (0)