-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
123 additions
and
70 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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2023, Trail of Bits, Inc. | ||
|
||
#ifndef VAST_DIALECT_CORE_LINKAGE_HELPER | ||
#define VAST_DIALECT_CORE_LINKAGE_HELPER | ||
include "mlir/IR/OpBase.td" | ||
|
||
def Core_GlobalLinkageKind : Attr< | ||
CPred<"::llvm::isa<::vast::core::GlobalLinkageKindAttr>($_self)">, | ||
"global linkage kind" | ||
> { | ||
let storageType = "::vast::core::GlobalLinkageKindAttr"; | ||
let returnType = "::vast::core::GlobalLinkageKind"; | ||
let convertFromStorage = "$_self.getValue()"; | ||
let constBuilderCall = [{ | ||
::vast::core::GlobalLinkageKindAttr::get($_builder.getContext(), $0) | ||
}]; | ||
} | ||
|
||
#endif // VAST_DIALECT_CORE_LINKAGE_HELPER |
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: %vast-front -vast-emit-mlir=hl -o - %s | %file-check %s -check-prefix=HL | ||
// RUN: %check-evict-static-locals %s | %file-check %s -check-prefix=EVICTED | ||
// RUN: %check-core-to-llvm %s | %file-check %s -check-prefix=LLVM | ||
|
||
// HL: hl.var @x sc_static | ||
// HL: hl.ref @x | ||
|
||
// EVICTED: hl.var @foo.x sc_static | ||
// EVICTED: ll.func @foo | ||
// EVICTED: hl.ref @foo.x | ||
|
||
// LLVM: llvm.mlir.global internal @foo.x() | ||
// LLVM: llvm.func @foo | ||
// LLVM: llvm.mlir.addressof @foo.x | ||
int foo() { | ||
static int x = 5; | ||
return x++; | ||
} |
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