Skip to content

Commit 04378a1

Browse files
author
git apple-llvm automerger
committed
Merge commit '4b4782bc868b' from llvm.org/main into next
2 parents a83a7e7 + 4b4782b commit 04378a1

31 files changed

+0
-1201
lines changed

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
497497

498498
/// A list of functions that are replacable by the loader.
499499
std::vector<std::string> LoaderReplaceableFunctionNames;
500-
/// The name of a file that contains functions which will be compiled for
501-
/// hotpatching. See -fms-secure-hotpatch-functions-file.
502-
std::string MSSecureHotPatchFunctionsFile;
503-
504-
/// A list of functions which will be compiled for hotpatching.
505-
/// See -fms-secure-hotpatch-functions-list.
506-
std::vector<std::string> MSSecureHotPatchFunctionsList;
507500

508501
public:
509502
// Define accessors/mutators for code generation options of enumeration type.

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3946,24 +3946,6 @@ def fms_hotpatch : Flag<["-"], "fms-hotpatch">, Group<f_Group>,
39463946
Visibility<[ClangOption, CC1Option, CLOption]>,
39473947
HelpText<"Ensure that all functions can be hotpatched at runtime">,
39483948
MarshallingInfoFlag<CodeGenOpts<"HotPatch">>;
3949-
3950-
// See llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
3951-
def fms_secure_hotpatch_functions_file
3952-
: Joined<["-"], "fms-secure-hotpatch-functions-file=">,
3953-
Group<f_Group>,
3954-
Visibility<[ClangOption, CC1Option, CLOption]>,
3955-
MarshallingInfoString<CodeGenOpts<"MSSecureHotPatchFunctionsFile">>,
3956-
HelpText<"Path to a file that contains a list of mangled names of "
3957-
"functions that should be hot-patched for Windows Secure "
3958-
"Hot-Patching">;
3959-
def fms_secure_hotpatch_functions_list
3960-
: CommaJoined<["-"], "fms-secure-hotpatch-functions-list=">,
3961-
Group<f_Group>,
3962-
Visibility<[ClangOption, CC1Option, CLOption]>,
3963-
MarshallingInfoStringVector<CodeGenOpts<"MSSecureHotPatchFunctionsList">>,
3964-
HelpText<"List of mangled symbol names of functions that should be "
3965-
"hot-patched for Windows Secure Hot-Patching">;
3966-
39673949
def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>,
39683950
Visibility<[ClangOption, CC1Option]>,
39693951
HelpText<"Override the default ABI to return all structs on the stack">;

clang/lib/CodeGen/CGCall.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,13 +2668,6 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
26682668
// CPU/feature overrides. addDefaultFunctionDefinitionAttributes
26692669
// handles these separately to set them based on the global defaults.
26702670
GetCPUAndFeaturesAttributes(CalleeInfo.getCalleeDecl(), FuncAttrs);
2671-
2672-
// Windows hotpatching support
2673-
if (!MSHotPatchFunctions.empty()) {
2674-
bool IsHotPatched = llvm::binary_search(MSHotPatchFunctions, Name);
2675-
if (IsHotPatched)
2676-
FuncAttrs.addAttribute("marked_for_windows_hot_patching");
2677-
}
26782671
}
26792672

26802673
// Mark functions that are replaceable by the loader.

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -460,35 +460,6 @@ CodeGenModule::CodeGenModule(ASTContext &C,
460460
if (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86)
461461
getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters",
462462
CodeGenOpts.NumRegisterParameters);
463-
464-
// If there are any functions that are marked for Windows secure hot-patching,
465-
// then build the list of functions now.
466-
if (!CGO.MSSecureHotPatchFunctionsFile.empty() ||
467-
!CGO.MSSecureHotPatchFunctionsList.empty()) {
468-
if (!CGO.MSSecureHotPatchFunctionsFile.empty()) {
469-
auto BufOrErr =
470-
llvm::MemoryBuffer::getFile(CGO.MSSecureHotPatchFunctionsFile);
471-
if (BufOrErr) {
472-
const llvm::MemoryBuffer &FileBuffer = **BufOrErr;
473-
for (llvm::line_iterator I(FileBuffer.getMemBufferRef(), true), E;
474-
I != E; ++I)
475-
this->MSHotPatchFunctions.push_back(std::string{*I});
476-
} else {
477-
auto &DE = Context.getDiagnostics();
478-
unsigned DiagID =
479-
DE.getCustomDiagID(DiagnosticsEngine::Error,
480-
"failed to open hotpatch functions file "
481-
"(-fms-hotpatch-functions-file): %0 : %1");
482-
DE.Report(DiagID) << CGO.MSSecureHotPatchFunctionsFile
483-
<< BufOrErr.getError().message();
484-
}
485-
}
486-
487-
for (const auto &FuncName : CGO.MSSecureHotPatchFunctionsList)
488-
this->MSHotPatchFunctions.push_back(FuncName);
489-
490-
llvm::sort(this->MSHotPatchFunctions);
491-
}
492463
}
493464

494465
CodeGenModule::~CodeGenModule() {

clang/lib/CodeGen/CodeGenModule.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,6 @@ class CodeGenModule : public CodeGenTypeCache {
686686

687687
AtomicOptions AtomicOpts;
688688

689-
// A set of functions which should be hot-patched; see
690-
// -fms-hotpatch-functions-file (and -list). This will nearly always be empty.
691-
// The list is sorted for binary-searching.
692-
std::vector<std::string> MSHotPatchFunctions;
693-
694689
public:
695690
CodeGenModule(ASTContext &C, IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
696691
const HeaderSearchOptions &headersearchopts,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7002,14 +7002,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &Job,
70027002

70037003
Args.AddLastArg(CmdArgs, options::OPT_fms_hotpatch);
70047004

7005-
if (Arg *A = Args.getLastArg(options::OPT_fms_secure_hotpatch_functions_file))
7006-
Args.AddLastArg(CmdArgs, options::OPT_fms_secure_hotpatch_functions_file);
7007-
7008-
for (const auto &A :
7009-
Args.getAllArgValues(options::OPT_fms_secure_hotpatch_functions_list))
7010-
CmdArgs.push_back(
7011-
Args.MakeArgString("-fms-secure-hotpatch-functions-list=" + Twine(A)));
7012-
70137005
if (TC.SupportsProfiling()) {
70147006
Args.AddLastArg(CmdArgs, options::OPT_pg);
70157007

clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c

Lines changed: 0 additions & 18 deletions
This file was deleted.

clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp

Lines changed: 0 additions & 24 deletions
This file was deleted.

clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)