Revert "Rebase: [Facebook] Add clang driver options to test debug info and BOLT"

This reverts commit f921985a29.
This commit is contained in:
spupyrev 2022-07-11 09:43:39 -07:00
parent 127e59048c
commit b444358126
9 changed files with 1 additions and 81 deletions

View File

@ -4001,10 +4001,6 @@ def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC
MarshallingInfoFlag<CodeGenOpts<"InstrumentForProfiling">>;
def pipe : Flag<["-", "--"], "pipe">,
HelpText<"Use pipes between commands, when possible">;
// Facebook T92898286
def post_link_optimize : Flag<["--"], "post-link-optimize">,
HelpText<"Apply post-link optimizations using BOLT">;
// End Facebook T92898286
def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">;
def prebind : Flag<["-"], "prebind">;
def preload : Flag<["-"], "preload">;

View File

@ -684,41 +684,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
}
// Facebook T92898286
if (Args.hasArg(options::OPT_post_link_optimize))
CmdArgs.push_back("-q");
// End Facebook T92898286
Args.AddAllArgs(CmdArgs, options::OPT_T);
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
C.addCommand(std::make_unique<Command>(JA, *this,
ResponseFileSupport::AtFileCurCP(),
Exec, CmdArgs, Inputs, Output));
// Facebook T92898286
if (!Args.hasArg(options::OPT_post_link_optimize) || !Output.isFilename())
return;
const char *MvExec = Args.MakeArgString(ToolChain.GetProgramPath("mv"));
ArgStringList MoveCmdArgs;
MoveCmdArgs.push_back(Output.getFilename());
const char *PreBoltBin =
Args.MakeArgString(Twine(Output.getFilename()) + ".pre-bolt");
MoveCmdArgs.push_back(PreBoltBin);
C.addCommand(std::make_unique<Command>(JA, *this, ResponseFileSupport::None(),
MvExec, MoveCmdArgs, None));
ArgStringList BoltCmdArgs;
const char *BoltExec =
Args.MakeArgString(ToolChain.GetProgramPath("llvm-bolt"));
BoltCmdArgs.push_back(PreBoltBin);
BoltCmdArgs.push_back("-reorder-blocks=reverse");
BoltCmdArgs.push_back("-update-debug-sections");
BoltCmdArgs.push_back("-o");
BoltCmdArgs.push_back(Output.getFilename());
C.addCommand(std::make_unique<Command>(JA, *this, ResponseFileSupport::None(),
BoltExec, BoltCmdArgs, None));
// End Facebook T92898286
}
void tools::gnutools::Assembler::ConstructJob(Compilation &C,

View File

@ -74,13 +74,7 @@ if is_msvc:
# use_clang() and use_lld() respectively, so set them to "", if needed.
if not hasattr(config, 'clang_src_dir'):
config.clang_src_dir = ""
# Facebook T92898286
should_test_bolt = get_required_attr(config, "llvm_test_bolt")
if should_test_bolt:
llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects), additional_flags=['--post-link-optimize'])
else:
llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects))
# End Facebook T92898286
llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects))
if not hasattr(config, 'lld_src_dir'):
config.lld_src_dir = ""
@ -262,9 +256,3 @@ llvm_config.feature_config(
# Allow 'REQUIRES: XXX-registered-target' in tests.
for arch in config.targets_to_build:
config.available_features.add(arch.lower() + '-registered-target')
# Facebook T92898286
# Ensure the user's PYTHONPATH is included.
if 'PYTHONPATH' in os.environ:
config.environment['PYTHONPATH'] = os.environ['PYTHONPATH']
# End Facebook T92898286

View File

@ -21,10 +21,6 @@ config.mlir_src_root = "@MLIR_SOURCE_DIR@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
# Facebook T92898286
config.llvm_test_bolt = lit.util.pythonize_bool("@LLVM_TEST_BOLT@")
# End Facebook T92898286
import lit.llvm
lit.llvm.initialize(lit_config, config)

View File

@ -207,11 +207,6 @@ if is_configured('lldb_libs_dir'):
if is_configured('lldb_framework_dir'):
dotest_cmd += ['--framework', config.lldb_framework_dir]
# Facebook T92898286
if is_configured("llvm_test_bolt"):
dotest_cmd += ['-E', '"--post-link-optimize"']
# End Facebook T92898286
if 'lldb-repro-capture' in config.available_features or \
'lldb-repro-replay' in config.available_features:
dotest_cmd += ['--skip-category=lldb-vscode', '--skip-category=std-module']

View File

@ -1,9 +1,5 @@
@LIT_SITE_CFG_IN_HEADER@
#Facebook T92898286
import lit.util
#End Facebook T92898286
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")
@ -37,10 +33,6 @@ config.dsymutil = lit_config.substitute('@LLDB_TEST_DSYMUTIL@')
config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api")
# Facebook T92898286
config.llvm_test_bolt = lit.util.pythonize_bool("@LLVM_TEST_BOLT@")
# End Facebook T92898286
# Plugins
lldb_build_intel_pt = '@LLDB_BUILD_INTEL_PT@'
if lldb_build_intel_pt == '1':

View File

@ -138,11 +138,6 @@ def use_support_substitutions(config):
# The clang module cache is used for building inferiors.
host_flags += ['-fmodules-cache-path={}'.format(config.clang_module_cache)]
# Facebook T92898286
if config.llvm_test_bolt:
host_flags += ['--post-link-optimize']
# End Facebook T92898286
host_flags = ' '.join(host_flags)
config.substitutions.append(('%clang_host', '%clang ' + host_flags))
config.substitutions.append(('%clangxx_host', '%clangxx ' + host_flags))

View File

@ -1,10 +1,5 @@
@LIT_SITE_CFG_IN_HEADER@
#Facebook T92898286
import lit.util
#End Facebook T92898286
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")
@ -32,10 +27,6 @@ config.lldb_system_debugserver = @LLDB_USE_SYSTEM_DEBUGSERVER@
config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-shell")
# Facebook T92898286
config.llvm_test_bolt = lit.util.pythonize_bool("@LLVM_TEST_BOLT@")
# End Facebook T92898286
import lit.llvm
lit.llvm.initialize(lit_config, config)

View File

@ -577,10 +577,6 @@ set(LLVM_LIB_FUZZING_ENGINE "" CACHE PATH
option(LLVM_USE_SPLIT_DWARF
"Use -gsplit-dwarf when compiling llvm and --gdb-index when linking." OFF)
# Facebook T92898286
option(LLVM_TEST_BOLT "Enable BOLT testing in non-BOLT tests that use clang" OFF)
# End Facebook T92898286
# Define an option controlling whether we should build for 32-bit on 64-bit
# platforms, where supported.
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT (WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX"))