Merge "Change default dump format to JSON"
am: 963b9c59b3
Change-Id: I234dc350277ba4d5f3dde06234781ba8aa695ac3
This commit is contained in:
@@ -98,16 +98,16 @@ static llvm::cl::opt<abi_util::TextFormatIR> text_format_old(
|
||||
"ProtobufTextFormat", "ProtobufTextFormat"),
|
||||
clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON"),
|
||||
clEnumValEnd),
|
||||
llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
|
||||
llvm::cl::init(abi_util::TextFormatIR::Json),
|
||||
llvm::cl::cat(header_checker_category));
|
||||
|
||||
static llvm::cl::opt<abi_util::TextFormatIR> text_format_new(
|
||||
"input-format-new", llvm::cl::desc("Specify input format of new abi dump"),
|
||||
llvm::cl::values(clEnumValN(abi_util::TextFormatIR::ProtobufTextFormat,
|
||||
"ProtobufTextFormat", "ProtobugTextFormat"),
|
||||
"ProtobufTextFormat", "ProtobufTextFormat"),
|
||||
clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON"),
|
||||
clEnumValEnd),
|
||||
llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
|
||||
llvm::cl::init(abi_util::TextFormatIR::Json),
|
||||
llvm::cl::cat(header_checker_category));
|
||||
|
||||
static llvm::cl::opt<abi_util::TextFormatIR> text_format_diff(
|
||||
|
||||
@@ -57,7 +57,7 @@ static llvm::cl::opt<abi_util::TextFormatIR> output_format(
|
||||
"ProtobufTextFormat", "ProtobufTextFormat"),
|
||||
clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON"),
|
||||
clEnumValEnd),
|
||||
llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
|
||||
llvm::cl::init(abi_util::TextFormatIR::Json),
|
||||
llvm::cl::cat(header_checker_category));
|
||||
|
||||
// Hide irrelevant command line options defined in LLVM libraries.
|
||||
|
||||
@@ -72,7 +72,7 @@ static llvm::cl::opt<abi_util::TextFormatIR> input_format(
|
||||
"ProtobufTextFormat", "ProtobufTextFormat"),
|
||||
clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON"),
|
||||
clEnumValEnd),
|
||||
llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
|
||||
llvm::cl::init(abi_util::TextFormatIR::Json),
|
||||
llvm::cl::cat(header_linker_category));
|
||||
|
||||
static llvm::cl::opt<abi_util::TextFormatIR> output_format(
|
||||
@@ -81,7 +81,7 @@ static llvm::cl::opt<abi_util::TextFormatIR> output_format(
|
||||
"ProtobufTextFormat", "ProtobufTextFormat"),
|
||||
clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON"),
|
||||
clEnumValEnd),
|
||||
llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
|
||||
llvm::cl::init(abi_util::TextFormatIR::Json),
|
||||
llvm::cl::cat(header_linker_category));
|
||||
|
||||
class HeaderAbiLinker {
|
||||
|
||||
@@ -29,6 +29,7 @@ VENDOR_SUFFIX = '.vendor'
|
||||
|
||||
DEFAULT_CPPFLAGS = ['-x', 'c++', '-std=c++11']
|
||||
DEFAULT_CFLAGS = ['-std=gnu99']
|
||||
DEFAULT_FORMAT = 'ProtobufTextFormat'
|
||||
|
||||
TARGET_ARCHS = ['arm', 'arm64', 'x86', 'x86_64', 'mips', 'mips64']
|
||||
|
||||
@@ -99,6 +100,8 @@ def run_header_abi_dumper_on_file(input_path, output_path,
|
||||
for dir in export_include_dirs:
|
||||
cmd += ['-I', dir]
|
||||
cmd += flags
|
||||
if '-output-format' not in flags:
|
||||
cmd += ['-output-format', DEFAULT_FORMAT]
|
||||
cmd += ['--']
|
||||
cmd += cflags
|
||||
if input_ext == '.cpp' or input_ext == '.cc' or input_ext == '.h':
|
||||
@@ -120,6 +123,10 @@ def run_header_abi_linker(output_path, inputs, version_script, api, arch,
|
||||
cmd = ['header-abi-linker', '-o', output_path, '-v', version_script,
|
||||
'-api', api, '-arch', arch]
|
||||
cmd += flags
|
||||
if '-input-format' not in flags:
|
||||
cmd += ['-input-format', DEFAULT_FORMAT]
|
||||
if '-output-format' not in flags:
|
||||
cmd += ['-output-format', DEFAULT_FORMAT]
|
||||
cmd += inputs
|
||||
subprocess.check_call(cmd)
|
||||
with open(output_path, 'r') as f:
|
||||
@@ -182,6 +189,10 @@ def run_abi_diff(old_test_dump_path, new_test_dump_path, arch, lib_name,
|
||||
output_name = os.path.join(tmp, lib_name) + '.abidiff'
|
||||
abi_diff_cmd += ['-o', output_name]
|
||||
abi_diff_cmd += flags
|
||||
if '-input-format-old' not in flags:
|
||||
abi_diff_cmd += ['-input-format-old', DEFAULT_FORMAT]
|
||||
if '-input-format-new' not in flags:
|
||||
abi_diff_cmd += ['-input-format-new', DEFAULT_FORMAT]
|
||||
try:
|
||||
subprocess.check_call(abi_diff_cmd)
|
||||
except subprocess.CalledProcessError as err:
|
||||
|
||||
Reference in New Issue
Block a user