File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1363,6 +1363,12 @@ class BinaryContext {
1363
1363
if (std::optional<uint32_t > Size = MIB->getSize (Inst))
1364
1364
return *Size;
1365
1365
1366
+ if (MIB->isPseudo (Inst))
1367
+ return 0 ;
1368
+
1369
+ if (std::optional<uint32_t > Size = MIB->getInstructionSize (Inst))
1370
+ return *Size;
1371
+
1366
1372
if (!Emitter)
1367
1373
Emitter = this ->MCE .get ();
1368
1374
SmallString<256 > Code;
Original file line number Diff line number Diff line change @@ -1204,6 +1204,11 @@ class MCPlusBuilder {
1204
1204
// / Get instruction size specified via annotation.
1205
1205
std::optional<uint32_t > getSize (const MCInst &Inst) const ;
1206
1206
1207
+ // / Get target-specific instruction size.
1208
+ virtual std::optional<uint32_t > getInstructionSize (const MCInst &Inst) const {
1209
+ return std::nullopt;
1210
+ }
1211
+
1207
1212
// / Set instruction size.
1208
1213
void setSize (MCInst &Inst, uint32_t Size) const ;
1209
1214
Original file line number Diff line number Diff line change @@ -1792,6 +1792,11 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
1792
1792
}
1793
1793
1794
1794
uint16_t getMinFunctionAlignment () const override { return 4 ; }
1795
+
1796
+ std::optional<uint32_t >
1797
+ getInstructionSize (const MCInst &Inst) const override {
1798
+ return 4 ;
1799
+ }
1795
1800
};
1796
1801
1797
1802
} // end anonymous namespace
You can’t perform that action at this time.
0 commit comments