-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #742 from fivosts/lexed_IR
Implement LLVM-based Lexer for IR
- Loading branch information
Showing
22 changed files
with
2,983 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
"""Utilities for LexedIRTuple derived observation space.""" | ||
import typing | ||
|
||
|
||
class LexedToken(typing.NamedTuple): | ||
ID: int | ||
kind: str | ||
category: str | ||
value: str |
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,30 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
# load("@rules_python//python:defs.bzl", "py_library") | ||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") | ||
|
||
cc_library( | ||
name = "LexedIr", | ||
srcs = [ | ||
"LLLexer.cc", | ||
"llvm_lexer_token_info.cc", | ||
], | ||
hdrs = [ | ||
"LLLexer.h", | ||
"LLToken.h", | ||
"escape.h", | ||
"lexed_ir.h", | ||
"llvm_lexer.h", | ||
"llvm_lexer_token_info.h", | ||
], | ||
copts = [ | ||
"-DGOOGLE_PROTOBUF_NO_RTTI", | ||
"-fno-rtti", | ||
], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@llvm//10.0.0", | ||
], | ||
) |
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,29 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
cg_add_all_subdirs() | ||
|
||
llvm_map_components_to_libnames(_LLVM_LIBS | ||
core support bitwriter | ||
) | ||
cg_cc_library( | ||
NAME LexedIr | ||
SRCS | ||
LLLexer.cc | ||
llvm_lexer_token_info.cc | ||
HDRS | ||
escape.h | ||
LLLexer.h | ||
LLToken.h | ||
llvm_lexer_token_info.h | ||
llvm_lexer.h | ||
lexed_ir.h | ||
ABS_DEPS | ||
${_LLVM_LIBS} | ||
INCLUDES | ||
${LLVM_INCLUDE_DIRS} | ||
DEFINES | ||
${LLVM_DEFINITIONS} | ||
) |
Oops, something went wrong.