Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
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
8 changes: 7 additions & 1 deletion tools/external/wabt/src/tools/postpass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ static void ParseOptions(int argc, char** argv) {
s_outfile = argument;
ConvertBackslashToSlash(&s_outfile);
});
parser.AddOption(
'n', "allow-names",
"Preserve the name section",
[]() {
s_write_binary_options.write_debug_names = true;
});
parser.AddArgument("filename", OptionParser::ArgumentCount::One,
[](const char* argument) {
s_infile = argument;
Expand Down Expand Up @@ -145,7 +151,7 @@ int ProgramMain(int argc, char** argv) {
Module module;
const bool kStopOnFirstError = true;
ReadBinaryOptions options(s_features, s_log_stream_s.get(),
stub, kStopOnFirstError,
s_write_binary_options.write_debug_names, kStopOnFirstError,
stub);
result = ReadBinaryIr(s_infile.c_str(), file_data.data(),
file_data.size(), &options, &error_handler, &module);
Expand Down
1 change: 0 additions & 1 deletion tools/include/compiler_options.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,6 @@ static Options CreateOptions(bool add_defaults=true) {
if (!entry_opt.empty())
ldopts.insert(ldopts.end(), {"--entry", entry_opt});
if (allow_names_opt) {
ldopts.emplace_back("-fno-post-pass");
ldopts.emplace_back("--allow-names");
}
#endif
Expand Down
7 changes: 6 additions & 1 deletion tools/ld/eosio-ld.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ int main(int argc, const char **argv) {
std::cout << "Error: eosio.pp not found! (Try reinstalling eosio.wasmsdk)" << std::endl;
return -1;
}
if (!eosio::cdt::environment::exec_subprogram("eosio-pp", {opts.output_fn}))
std::vector<std::string> pp_opts;
if(allow_names_opt) {
pp_opts.push_back("--allow-names");
}
pp_opts.push_back(opts.output_fn);
if (!eosio::cdt::environment::exec_subprogram("eosio-pp", pp_opts))
return -1;
if ( !llvm::sys::fs::exists( opts.output_fn ) ) {
return -1;
Expand Down
4 changes: 1 addition & 3 deletions tools/toolchain-tester/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from printer import Printer as P
from printer import print_test_results, print_test_results_machine

from settings import Config
from testrunner import TestRunner
from testsuite import TestSuite

Expand Down Expand Up @@ -49,7 +48,6 @@ def main():

args = parser.parse_args()

Config.cdt_path = args.cdt
P.verbose = args.verbose

abs_test_directory = os.path.abspath(args.test_directory)
Expand All @@ -68,7 +66,7 @@ def main():
if os.path.isdir(abs_f):
test_directories.append(abs_f)

test_suites = list(map(lambda d: TestSuite(d), test_directories))
test_suites = list(map(lambda d: TestSuite(d, args.cdt), test_directories))

start = timer()
test_runner = TestRunner(test_suites, args.tests, args.jobs)
Expand Down
2 changes: 1 addition & 1 deletion tools/toolchain-tester/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run(self):
cf = self.test_json.get("compile_flags")
args = cf if cf else []

eosio_cpp = os.path.join(Config.cdt_path, "eosio-cpp")
eosio_cpp = os.path.join(self.test_suite.cdt_path, "eosio-cpp")
self._run(eosio_cpp, args)

def handle_test_result(self, res: subprocess.CompletedProcess, expected_pass=True):
Expand Down
3 changes: 2 additions & 1 deletion tools/toolchain-tester/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ class TestSuite:
by the directory structure.
"""

def __init__(self, directory: str):
def __init__(self, directory: str, cdt_path: str):
self.directory = directory
self.cdt_path = cdt_path
self.tests: List[tests.Test] = []
self.name = self._get_name()
self.test_type = self._get_test_type()
Expand Down