Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions examples/span_se_log_file_status.emb → BUILD
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# Copyright 2019 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# https://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[$default byte_order: "LittleEndian"]

struct LogFileStatus:
0:4 UInt file_state
4:16 UInt:8[12] file_name
16:20 UInt file_size_kb
20:24 UInt media
29 changes: 5 additions & 24 deletions public/build_defs.bzl → build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ def emboss_cc_library(name, srcs, deps = [], visibility = None):
name = name + "_header",
tools = [
# TODO(bolms): Make "emboss" driver program.
"//front_end:emboss_front_end",
"//back_end/cpp:emboss_codegen_cpp",
"//compiler/front_end:emboss_front_end",
"//compiler/back_end/cpp:emboss_codegen_cpp",
],
srcs = srcs + [dep + "__emb" for dep in deps],
cmd = ("$(location //front_end:emboss_front_end) " +
cmd = ("$(location //compiler/front_end:emboss_front_end) " +
"--output-ir-to-stdout " +
"--import-dir=. " +
"--import-dir='$(GENDIR)' " +
"$(location {}) > $(@D)/$$(basename $(OUTS) .h).ir; " +
"$(location //back_end/cpp:emboss_codegen_cpp) " +
"$(location //compiler/back_end/cpp:emboss_codegen_cpp) " +
"< $(@D)/$$(basename $(OUTS) .h).ir > " +
"$(OUTS); " +
"rm $(@D)/$$(basename $(OUTS) .h).ir").format(") $location( ".join(srcs)),
Expand All @@ -68,26 +68,7 @@ def emboss_cc_library(name, srcs, deps = [], visibility = None):
":" + name + "_header",
],
deps = deps + [
"//public:cpp_utils",
"//runtime/cpp:cpp_utils",
],
visibility = visibility,
)

# TODO(bolms): Maybe move this to a non-public build_defs?
def emboss_cc_util_test(name, copts = [], **kwargs):
"""Constructs two cc_test targets, with and without optimizations."""
native.cc_test(
name = name,
copts = copts + ["-Wsign-compare"],
**kwargs
)
native.cc_test(
name = name + "_no_opts",
copts = copts + [
# This is generally a dangerous flag for an individual target, but
# these tests do not depend on any other .cc files that might
# #include any Emboss headers.
"-DEMBOSS_NO_OPTIMIZATIONS",
],
**kwargs
)
File renamed without changes.
14 changes: 7 additions & 7 deletions back_end/cpp/BUILD → compiler/back_end/cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ py_binary(
visibility = ["//visibility:public"],
deps = [
":header_generator",
"//public:ir_pb2",
"//compiler/util:ir_pb2",
],
)

Expand All @@ -41,10 +41,10 @@ py_library(
"generated_code_templates",
],
deps = [
"//back_end/util:code_template",
"//public:ir_pb2",
"//util:ir_util",
"//util:name_conversion",
"//compiler/back_end/util:code_template",
"//compiler/util:ir_pb2",
"//compiler/util:ir_util",
"//compiler/util:name_conversion",
],
)

Expand Down Expand Up @@ -254,7 +254,7 @@ emboss_cc_test(
"testcode/bits_test.cc",
],
deps = [
"//public:cpp_utils",
"//runtime/cpp:cpp_utils",
"//testdata:bits_emboss",
"@com_google_googletest//:gtest_main",
],
Expand All @@ -266,7 +266,7 @@ emboss_cc_test(
"testcode/anonymous_bits_test.cc",
],
deps = [
"//public:cpp_utils",
"//runtime/cpp:cpp_utils",
"//testdata:anonymous_bits_emboss",
"@com_google_googletest//:gtest_main",
],
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import sys

from back_end.cpp import header_generator
from public import ir_pb2
from compiler.back_end.cpp import header_generator
from compiler.util import ir_pb2


def main(argv):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <type_traits>
#include <utility>

#include "public/emboss_cpp_util.h"
#include "runtime/cpp/emboss_cpp_util.h"

$_includes_$

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import pkgutil
import re

from back_end.util import code_template
from public import ir_pb2
from util import ir_util
from util import name_conversion
from compiler.back_end.util import code_template
from compiler.util import ir_pb2
from compiler.util import ir_util
from compiler.util import name_conversion

_TEMPLATES = code_template.parse_templates(pkgutil.get_data(
"back_end.cpp",
"compiler.back_end.cpp",
"generated_code_templates").decode(encoding="UTF-8"))

_CPP_RESERVED_WORDS = set((
Expand Down Expand Up @@ -63,7 +63,7 @@
_SUPPORT_NAMESPACE = "::emboss::support"

# TODO(bolms): This should be a command-line flag.
_PRELUDE_INCLUDE_FILE = "public/emboss_prelude.h"
_PRELUDE_INCLUDE_FILE = "runtime/cpp/emboss_prelude.h"


def _get_module_namespace(module):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <vector>

#include "gtest/gtest.h"
#include "public/emboss_cpp_util.h"
#include "runtime/cpp/emboss_cpp_util.h"
#include "testdata/alignments.emb.h"

namespace emboss {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <vector>

#include "gtest/gtest.h"
#include "public/emboss_cpp_util.h"
#include "runtime/cpp/emboss_cpp_util.h"
#include "testdata/anonymous_bits.emb.h"

namespace emboss {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "public/emboss_text_util.h"
#include "runtime/cpp/emboss_text_util.h"
#include "testdata/auto_array_size.emb.h"

namespace emboss {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <vector>

#include "gtest/gtest.h"
#include "public/emboss_cpp_util.h"
#include "runtime/cpp/emboss_cpp_util.h"
#include "testdata/bits.emb.h"

namespace emboss {
Expand Down
2 changes: 1 addition & 1 deletion back_end/util/BUILD → compiler/back_end/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Shared utilities for Emboss back ends.

package(
default_visibility = ["//back_end:__subpackages__"],
default_visibility = ["//compiler:__subpackages__"],
)

py_library(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""Tests for code_template."""

import unittest
from back_end.util import code_template
from compiler.back_end.util import code_template


class FormatTest(unittest.TestCase):
Expand Down
Loading