Move tracing_flag into a common directory (#669)

Intended to combine well with #668, so neither is alone.
This commit is contained in:
Jon Meow
2021-07-21 09:57:54 -07:00
committed by GitHub
parent 08a2d44570
commit f3cbfc04c6
12 changed files with 26 additions and 21 deletions
+1 -7
View File
@@ -12,18 +12,12 @@ cc_binary(
name = "executable_semantics",
srcs = ["main.cpp"],
deps = [
"//executable_semantics/common:tracing_flag",
"//executable_semantics/syntax",
"@llvm-project//llvm:Support",
],
)
cc_library(
name = "tracing_flag",
srcs = ["tracing_flag.cpp"],
hdrs = ["tracing_flag.h"],
visibility = ["//executable_semantics:__subpackages__"],
)
EXAMPLES = [
"assignment_copy1",
"assignment_copy2",
+12
View File
@@ -0,0 +1,12 @@
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
package(default_visibility = ["//executable_semantics:__subpackages__"])
cc_library(
name = "tracing_flag",
srcs = ["tracing_flag.cpp"],
hdrs = ["tracing_flag.h"],
visibility = ["//executable_semantics:__subpackages__"],
)
@@ -2,11 +2,10 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "executable_semantics/tracing_flag.h"
#include "executable_semantics/common/tracing_flag.h"
namespace Carbon {
// Program option to enable/disable tracing.
bool tracing_output = false;
} // namespace Carbon
@@ -2,8 +2,8 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef EXECUTABLE_SEMANTICS_TRACING_FLAG_H_
#define EXECUTABLE_SEMANTICS_TRACING_FLAG_H_
#ifndef EXECUTABLE_SEMANTICS_COMMON_TRACING_FLAG_H_
#define EXECUTABLE_SEMANTICS_COMMON_TRACING_FLAG_H_
namespace Carbon {
@@ -12,4 +12,4 @@ extern bool tracing_output;
} // namespace Carbon
#endif // EXECUTABLE_SEMANTICS_TRACING_FLAG_H_
#endif // EXECUTABLE_SEMANTICS_COMMON_TRACING_FLAG_H_
+2 -2
View File
@@ -87,10 +87,10 @@ cc_library(
":value",
"//common:check",
"//common:ostream",
"//executable_semantics:tracing_flag",
"//executable_semantics/ast:declaration",
"//executable_semantics/ast:expression",
"//executable_semantics/ast:function_definition",
"//executable_semantics/common:tracing_flag",
],
)
@@ -102,10 +102,10 @@ cc_library(
":containers",
":interpreter",
"//common:ostream",
"//executable_semantics:tracing_flag",
"//executable_semantics/ast:expression",
"//executable_semantics/ast:function_definition",
"//executable_semantics/ast:statement",
"//executable_semantics/common:tracing_flag",
],
)
@@ -14,10 +14,10 @@
#include "common/check.h"
#include "executable_semantics/ast/expression.h"
#include "executable_semantics/ast/function_definition.h"
#include "executable_semantics/common/tracing_flag.h"
#include "executable_semantics/interpreter/action.h"
#include "executable_semantics/interpreter/frame.h"
#include "executable_semantics/interpreter/stack.h"
#include "executable_semantics/tracing_flag.h"
namespace Carbon {
@@ -11,8 +11,8 @@
#include <vector>
#include "executable_semantics/ast/function_definition.h"
#include "executable_semantics/common/tracing_flag.h"
#include "executable_semantics/interpreter/interpreter.h"
#include "executable_semantics/tracing_flag.h"
namespace Carbon {
+1 -1
View File
@@ -6,9 +6,9 @@
#include <cstring>
#include <iostream>
#include "executable_semantics/common/tracing_flag.h"
#include "executable_semantics/syntax/parse.h"
#include "executable_semantics/syntax/syntax_helpers.h"
#include "executable_semantics/tracing_flag.h"
#include "llvm/Support/CommandLine.h"
int main(int argc, char* argv[]) {
+1 -1
View File
@@ -30,9 +30,9 @@ cc_library(
deps = [
":paren_contents",
"//common:ostream",
"//executable_semantics:tracing_flag",
"//executable_semantics/ast:declaration",
"//executable_semantics/ast:expression",
"//executable_semantics/common:tracing_flag",
"//executable_semantics/interpreter",
"//executable_semantics/interpreter:typecheck",
],
+1 -1
View File
@@ -8,7 +8,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include <cstdlib>
#include <iostream>
#include "executable_semantics/tracing_flag.h"
#include "executable_semantics/common/tracing_flag.h"
#include "executable_semantics/syntax/parse_and_lex_context.h"
#include "llvm/ADT/StringExtras.h"
%}
+1 -1
View File
@@ -6,9 +6,9 @@
#include <iostream>
#include "executable_semantics/common/tracing_flag.h"
#include "executable_semantics/syntax/parse_and_lex_context.h"
#include "executable_semantics/syntax/parser.h"
#include "executable_semantics/tracing_flag.h"
extern FILE* yyin;
@@ -5,9 +5,9 @@
#include "executable_semantics/syntax/syntax_helpers.h"
#include "common/ostream.h"
#include "executable_semantics/common/tracing_flag.h"
#include "executable_semantics/interpreter/interpreter.h"
#include "executable_semantics/interpreter/typecheck.h"
#include "executable_semantics/tracing_flag.h"
namespace Carbon {