|
32 | 32 | #include "llvm/MC/MCContext.h"
|
33 | 33 | #include "llvm/MC/MCObjectFileInfo.h"
|
34 | 34 | #include "llvm/MC/MCObjectWriter.h"
|
| 35 | +#include "llvm/MC/MCPseudoProbe.h" |
35 | 36 | #include "llvm/MC/MCSectionELF.h"
|
36 | 37 | #include "llvm/MC/MCSectionMachO.h"
|
37 | 38 | #include "llvm/MC/MCStreamer.h"
|
@@ -246,6 +247,9 @@ class BinaryContext {
|
246 | 247 | /// DWP Context.
|
247 | 248 | std::shared_ptr<DWARFContext> DWPContext;
|
248 | 249 |
|
| 250 | + /// Decoded pseudo probes. |
| 251 | + std::shared_ptr<MCPseudoProbeDecoder> PseudoProbeDecoder; |
| 252 | + |
249 | 253 | /// A map of DWO Ids to CUs.
|
250 | 254 | using DWOIdToCUMapType = std::unordered_map<uint64_t, DWARFUnit *>;
|
251 | 255 | DWOIdToCUMapType DWOCUs;
|
@@ -377,6 +381,15 @@ class BinaryContext {
|
377 | 381 | RtLibrary = std::move(Lib);
|
378 | 382 | }
|
379 | 383 |
|
| 384 | + const MCPseudoProbeDecoder *getPseudoProbeDecoder() const { |
| 385 | + return PseudoProbeDecoder.get(); |
| 386 | + } |
| 387 | + |
| 388 | + void setPseudoProbeDecoder(std::shared_ptr<MCPseudoProbeDecoder> Decoder) { |
| 389 | + assert(!PseudoProbeDecoder && "Cannot set pseudo probe decoder twice."); |
| 390 | + PseudoProbeDecoder = Decoder; |
| 391 | + } |
| 392 | + |
380 | 393 | /// Return BinaryFunction containing a given \p Address or nullptr if
|
381 | 394 | /// no registered function contains the \p Address.
|
382 | 395 | ///
|
@@ -431,6 +444,9 @@ class BinaryContext {
|
431 | 444 | return nullptr;
|
432 | 445 | }
|
433 | 446 |
|
| 447 | + /// Deregister JumpTable registered at a given \p Address and delete it. |
| 448 | + void deleteJumpTable(uint64_t Address); |
| 449 | + |
434 | 450 | unsigned getDWARFEncodingSize(unsigned Encoding) {
|
435 | 451 | if (Encoding == dwarf::DW_EH_PE_omit)
|
436 | 452 | return 0;
|
@@ -1436,10 +1452,7 @@ class BinaryContext {
|
1436 | 1452 | std::unique_ptr<MCObjectWriter> OW = MAB->createObjectWriter(OS);
|
1437 | 1453 | std::unique_ptr<MCStreamer> Streamer(TheTarget->createMCObjectStreamer(
|
1438 | 1454 | *TheTriple, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), std::move(OW),
|
1439 |
| - std::unique_ptr<MCCodeEmitter>(MCE), *STI, |
1440 |
| - /* RelaxAll */ false, |
1441 |
| - /* IncrementalLinkerCompatible */ false, |
1442 |
| - /* DWARFMustBeAtTheEnd */ false)); |
| 1455 | + std::unique_ptr<MCCodeEmitter>(MCE), *STI)); |
1443 | 1456 | return Streamer;
|
1444 | 1457 | }
|
1445 | 1458 |
|
|
0 commit comments