summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2020-01-20 15:52:38 -0800
committerFangrui Song <maskray@google.com>2020-01-24 10:38:40 -0800
commit0e2eea29cc4f360fc95638fbfc8aca24cec3fc5f (patch)
tree569796329fbe8c6afc5c93f1a29a65cdac707cd4 /llvm/lib/CodeGen
parent6c1e479db225897cbbff7894ffe77824c03ab8fd (diff)
downloadbcm5719-llvm-0e2eea29cc4f360fc95638fbfc8aca24cec3fc5f.tar.gz
bcm5719-llvm-0e2eea29cc4f360fc95638fbfc8aca24cec3fc5f.zip
[AsmPrinter] Don't emit __patchable_function_entries entry if "patchable-function-entry"="0"
Add improve tests (cherry picked from commit d232c215669cb57f5eb4ead40a4a336220dbc429)
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 6f9aa4dd79f..e7a7ca79e33 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -3199,7 +3199,11 @@ void AsmPrinter::recordSled(MCSymbol *Sled, const MachineInstr &MI,
void AsmPrinter::emitPatchableFunctionEntries() {
const Function &F = MF->getFunction();
- if (!F.hasFnAttribute("patchable-function-entry"))
+ unsigned PatchableFunctionEntry = 0;
+ (void)F.getFnAttribute("patchable-function-entry")
+ .getValueAsString()
+ .getAsInteger(10, PatchableFunctionEntry);
+ if (!PatchableFunctionEntry)
return;
const unsigned PointerSize = getPointerSize();
if (TM.getTargetTriple().isOSBinFormatELF()) {
OpenPOWER on IntegriCloud