[PATCH] D82094: ARC: Enforce function alignment at code emission time
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 18 07:02:45 PDT 2020
arsenm updated this revision to Diff 271705.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82094/new/
https://reviews.llvm.org/D82094
Files:
llvm/lib/Target/ARC/ARCAsmPrinter.cpp
llvm/lib/Target/ARC/ARCMachineFunctionInfo.h
Index: llvm/lib/Target/ARC/ARCMachineFunctionInfo.h
===================================================================
--- llvm/lib/Target/ARC/ARCMachineFunctionInfo.h
+++ llvm/lib/Target/ARC/ARCMachineFunctionInfo.h
@@ -33,10 +33,7 @@
explicit ARCFunctionInfo(MachineFunction &MF)
: ReturnStackOffsetSet(false), VarArgsFrameIndex(0),
- ReturnStackOffset(-1U), MaxCallStackReq(0) {
- // Functions are 4-byte aligned.
- MF.setAlignment(Align(4));
- }
+ ReturnStackOffset(-1U), MaxCallStackReq(0) {}
~ARCFunctionInfo() {}
Index: llvm/lib/Target/ARC/ARCAsmPrinter.cpp
===================================================================
--- llvm/lib/Target/ARC/ARCAsmPrinter.cpp
+++ llvm/lib/Target/ARC/ARCAsmPrinter.cpp
@@ -42,6 +42,8 @@
StringRef getPassName() const override { return "ARC Assembly Printer"; }
void emitInstruction(const MachineInstr *MI) override;
+
+ bool runOnMachineFunction(MachineFunction &MF) override;
};
} // end anonymous namespace
@@ -61,6 +63,12 @@
EmitToStreamer(*OutStreamer, TmpInst);
}
+bool ARCAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ // Functions are 4-byte aligned.
+ MF.ensureAlignment(Align(4));
+ AsmPrinter::runOnMachineFunction(MF);
+}
+
// Force static initialization.
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCAsmPrinter() {
RegisterAsmPrinter<ARCAsmPrinter> X(getTheARCTarget());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82094.271705.patch
Type: text/x-patch
Size: 1423 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200618/925dbfd0/attachment.bin>
More information about the llvm-commits
mailing list