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 {
13631363 if (std::optional<uint32_t > Size = MIB->getSize (Inst))
13641364 return *Size;
13651365
1366+ if (MIB->isPseudo (Inst))
1367+ return 0 ;
1368+
1369+ if (std::optional<uint32_t > Size = MIB->getInstructionSize (Inst))
1370+ return *Size;
1371+
13661372 if (!Emitter)
13671373 Emitter = this ->MCE .get ();
13681374 SmallString<256 > Code;
Original file line number Diff line number Diff line change @@ -1204,6 +1204,11 @@ class MCPlusBuilder {
12041204 // / Get instruction size specified via annotation.
12051205 std::optional<uint32_t > getSize (const MCInst &Inst) const ;
12061206
1207+ // / Get target-specific instruction size.
1208+ virtual std::optional<uint32_t > getInstructionSize (const MCInst &Inst) const {
1209+ return std::nullopt ;
1210+ }
1211+
12071212 // / Set instruction size.
12081213 void setSize (MCInst &Inst, uint32_t Size) const ;
12091214
Original file line number Diff line number Diff line change @@ -1792,6 +1792,11 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
17921792 }
17931793
17941794 uint16_t getMinFunctionAlignment () const override { return 4 ; }
1795+
1796+ std::optional<uint32_t >
1797+ getInstructionSize (const MCInst &Inst) const override {
1798+ return 4 ;
1799+ }
17951800};
17961801
17971802} // end anonymous namespace
You can’t perform that action at this time.
0 commit comments