diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-02-14 21:24:03 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-02-14 21:24:03 +0000 |
| commit | d75c7debad4509ece98792074e64b8a650a27bdb (patch) | |
| tree | f8d77975739b43bf7ffef0612579168cb9ec9474 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
| parent | 9c2f6c4bb805c7ac08c8925c96e429fcc322725e (diff) | |
Vendor import of llvm-project branch release/10.xvendor/llvm-project/llvmorg-10.0.0-rc2-0-g90c78073f73
llvmorg-10.0.0-rc2-0-g90c78073f73.
Notes
svn path=/vendor/llvm-project/release-10.x/; revision=357937
svn path=/vendor/llvm-project/llvmorg-10.0.0-rc2-0-g90c78073f73/; revision=357938; tag=vendor/llvm-project/llvmorg-10.0.0-rc2-0-g90c78073f73
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 3516f4a7b370..20cd9da31fbd 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -709,15 +709,21 @@ void AsmPrinter::EmitFunctionHeader() { // Emit M NOPs for -fpatchable-function-entry=N,M where M>0. We arbitrarily // place prefix data before NOPs. unsigned PatchableFunctionPrefix = 0; + unsigned PatchableFunctionEntry = 0; (void)F.getFnAttribute("patchable-function-prefix") .getValueAsString() .getAsInteger(10, PatchableFunctionPrefix); + (void)F.getFnAttribute("patchable-function-entry") + .getValueAsString() + .getAsInteger(10, PatchableFunctionEntry); if (PatchableFunctionPrefix) { CurrentPatchableFunctionEntrySym = OutContext.createLinkerPrivateTempSymbol(); OutStreamer->EmitLabel(CurrentPatchableFunctionEntrySym); emitNops(PatchableFunctionPrefix); - } else { + } else if (PatchableFunctionEntry) { + // May be reassigned when emitting the body, to reference the label after + // the initial BTI (AArch64) or endbr32/endbr64 (x86). CurrentPatchableFunctionEntrySym = CurrentFnBegin; } |
