Skip to content

Commit

Permalink
[llvm-mca] Abort on parse error without -skip-unsupported-instructions
Browse files Browse the repository at this point in the history
Prior to this patch, llvm-mca would continue executing after parse
errors. These errors can lead to some confusion since some analysis
results are printed on the standard output, and they're printed after
the errors, which could otherwise be easy to miss.

However it is still useful to be able to continue analysis after errors;
so extend the recently added -skip-unsupported-instructions to support
this.

Two tests which have parse errors for some of the 'RUN' branches are
updated to use -skip-unsupported-instructions so they can remain as-is.

Add a description of -skip-unsupported-instructions to the llvm-mca
command guide, and add it to the llvm-mca --help output:

```
  --skip-unsupported-instructions=<value> - Force analysis to continue in the presence of unsupported instructions
    =none                                 -   Exit with an error when an instruction is unsupported for any reason (default)
    =lack-sched                           -   Skip instructions on input which lack scheduling information
    =parse-failure                        -   Skip lines on the input which fail to parse for any reason
    =any                                  -   Skip instructions or lines on input which are unsupported for any reason
```

Tests within this patch are intended to cover each of the cases.

Reason        | Flag | Comment
--------------|------|-------
none          | none | Usual case, existing test suite
lack-sched    | none | Advises user to use -skip-unsupported-instructions=lack-sched, tested in llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s
parse-failure | none | Advises user to use -skip-unsupported-instructions=parse-failure, tested in llvm/test/tools/llvm-mca/bad-input.s
any           | none | (N/A, covered above)
lack-sched    | any  | Continues, prints warnings, tested in llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s
parse-failure | any  | Continues, prints errors, tested in llvm/test/tools/llvm-mca/bad-input.s
lack-sched    | parse-failure | Advises user to use -skip-unsupported-instructions=lack-sched, tested in llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s
parse-failure | lack-sched    | Advises user to use -skip-unsupported-instructions=parse-failure, tested in llvm/test/tools/llvm-mca/bad-input.s
none          | * | This would be any test case with skip-unsupported-instructions, coverage added in llvm/test/tools/llvm-mca/X86/BtVer2/simple-test.s
any           | * | (Logically covered by the other cases)
  • Loading branch information
peterwaller-arm committed May 2, 2024
1 parent c32a4f8 commit a8893c1
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 36 deletions.
10 changes: 10 additions & 0 deletions llvm/docs/CommandGuide/llvm-mca.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,16 @@ option specifies "``-``", then the output will also be sent to standard output.
no extra information, and InstrumentManager never overrides the default
schedule class for a given instruction.

.. option:: -skip-unsupported-instructions=<reason>

Force :program:`llvm-mca` to continue in the presence of instructions which do
not parse or lack key scheduling information. Note that the resulting analysis
is impacted since those unsupported instructions are ignored as-if they are
not supplied as a part of the input.

The choice of `<reason>` controls the when mca will report an error.
`<reason>` may be `none` (default), `lack-sched`, `parse-failure`, `any`.

EXIT STATUS
-----------

Expand Down
8 changes: 8 additions & 0 deletions llvm/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ Changes to the LLVM tools
(`#89162 <https://github.com/llvm/llvm-project/pull/89162>`_)
``--raw-relr`` has been removed.

* llvm-mca now aborts by default if it is given bad input where previously it
would continue. Additionally, it can now continue when it encounters
instructions which lack scheduling information. The behaviour can be
controlled by the newly introduced
`--skip-unsupported-instructions=<none|lack-sched|parse-failure|any>`, as
documented in `--help` output and the command guide. (`#90474
<https://github.com/llvm/llvm-project/pull/90474>`)

Changes to LLDB
---------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m3 -resource-pressure=false < %s | FileCheck %s -check-prefixes=ALL,EM3
# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m3 -resource-pressure=false -skip-unsupported-instructions=parse-failure < %s | FileCheck %s -check-prefixes=ALL,EM3
# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m4 -resource-pressure=false < %s | FileCheck %s -check-prefixes=ALL,EM4
# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m5 -resource-pressure=false < %s | FileCheck %s -check-prefixes=ALL,EM5

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/tools/llvm-mca/AArch64/Exynos/float-integer.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
# RUN: llvm-mca -mtriple=aarch64-linux-gnu -mcpu=exynos-m3 -resource-pressure=false < %s | FileCheck %s -check-prefixes=ALL,EM3
# RUN: llvm-mca -mtriple=aarch64-linux-gnu -mcpu=exynos-m3 -resource-pressure=false -skip-unsupported-instructions=parse-failure < %s | FileCheck %s -check-prefixes=ALL,EM3
# RUN: llvm-mca -mtriple=aarch64-linux-gnu -mcpu=exynos-m4 -resource-pressure=false < %s | FileCheck %s -check-prefixes=ALL,EM4
# RUN: llvm-mca -mtriple=aarch64-linux-gnu -mcpu=exynos-m5 -resource-pressure=false < %s | FileCheck %s -check-prefixes=ALL,EM5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
adc pc, r5, r6, ror #2
adc r4, r5, r6, ror #31
adc r6, r7, r8, lsl r9
adc pc, r7, r8, lsl r9
adc r6, r7, r8, lsr r9
adc r6, r7, r8, asr r9
adc r6, r7, r8, ror r9
Expand Down
27 changes: 23 additions & 4 deletions llvm/test/tools/llvm-mca/ARM/cortex-a57-thumb.s
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@
itett ne
cmpne r7, #243
addeq r7, r1, r2
addne r7, r1, r2
uxthne r7, r7
itttt lt
cmplt r7, #243
uxthlt r7, r1
strhlt r2, [r7, #22]
lsrlt r1, r6, #3
uxthne r7, r7
strh r2, [r7, #22]
asrs r1, r6, #7
lsrs r1, r6, #31
Expand Down Expand Up @@ -253,7 +254,7 @@
ldrd r0, r1, [r2, #-0]!
ldrd r0, r1, [r2, #0]!
ldrd r0, r1, [r2, #-0]
ldrd r1, r1, [r0], #0
ldrd r1, r2, [r0], #0
ldrex r1, [r4]
ldrex r8, [r4]
ldrex r2, [sp, #128]
Expand Down Expand Up @@ -648,7 +649,7 @@
str r10, [r11], #0
strd r1, r1, [r0], #0
strd r6, r3, [r5], #-8
strd r8, r5, [r5], #-0
strd r8, r5, [r6], #-0
strd r7, r4, [r5], #-4
strd r0, r1, [r2, #-0]!
strd r0, r1, [r2, #0]!
Expand Down Expand Up @@ -1010,6 +1011,13 @@
# CHECK-NEXT: 0 0 0.00 U itett ne
# CHECK-NEXT: 1 1 0.50 cmpne r7, #243
# CHECK-NEXT: 1 1 0.50 addeq r7, r1, r2
# CHECK-NEXT: 1 1 0.50 addne r7, r1, r2
# CHECK-NEXT: 1 1 0.50 uxthne r7, r7
# CHECK-NEXT: 0 0 0.00 U itttt lt
# CHECK-NEXT: 1 1 0.50 cmplt r7, #243
# CHECK-NEXT: 1 1 0.50 uxthlt r7, r1
# CHECK-NEXT: 1 1 1.00 * strhlt r2, [r7, #22]
# CHECK-NEXT: 1 1 0.50 lsrlt r1, r6, #3
# CHECK-NEXT: 1 1 1.00 * strh r2, [r7, #22]
# CHECK-NEXT: 1 2 1.00 asrs r1, r6, #7
# CHECK-NEXT: 1 2 1.00 lsrs r1, r6, #31
Expand Down Expand Up @@ -1162,6 +1170,7 @@
# CHECK-NEXT: 4 4 2.00 * ldrd r0, r1, [r2, #-0]!
# CHECK-NEXT: 4 4 2.00 * ldrd r0, r1, [r2, #0]!
# CHECK-NEXT: 2 4 2.00 * ldrd r0, r1, [r2, #-0]
# CHECK-NEXT: 4 4 2.00 * ldrd r1, r2, [r0], #0
# CHECK-NEXT: 0 0 0.00 * * U ldrex r1, [r4]
# CHECK-NEXT: 0 0 0.00 * * U ldrex r8, [r4]
# CHECK-NEXT: 0 0 0.00 * * U ldrex r2, [sp, #128]
Expand Down Expand Up @@ -1556,6 +1565,7 @@
# CHECK-NEXT: 2 1 1.00 * str r10, [r11], #0
# CHECK-NEXT: 2 1 1.00 * strd r1, r1, [r0], #0
# CHECK-NEXT: 2 1 1.00 * strd r6, r3, [r5], #-8
# CHECK-NEXT: 2 1 1.00 * strd r8, r5, [r6], #-0
# CHECK-NEXT: 2 1 1.00 * strd r7, r4, [r5], #-4
# CHECK-NEXT: 2 1 1.00 * strd r0, r1, [r2, #-0]!
# CHECK-NEXT: 2 1 1.00 * strd r0, r1, [r2, #0]!
Expand Down Expand Up @@ -1827,7 +1837,7 @@

# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1.0] [1.1] [2] [3] [4] [5] [6]
# CHECK-NEXT: 12.00 164.00 164.00 221.00 313.00 44.00 - -
# CHECK-NEXT: 12.00 168.00 168.00 223.00 313.00 46.00 - -

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1.0] [1.1] [2] [3] [4] [5] [6] Instructions:
Expand Down Expand Up @@ -1924,6 +1934,13 @@
# CHECK-NEXT: - - - - - - - - itett ne
# CHECK-NEXT: - 0.50 0.50 - - - - - cmpne r7, #243
# CHECK-NEXT: - 0.50 0.50 - - - - - addeq r7, r1, r2
# CHECK-NEXT: - 0.50 0.50 - - - - - addne r7, r1, r2
# CHECK-NEXT: - 0.50 0.50 - - - - - uxthne r7, r7
# CHECK-NEXT: - - - - - - - - itttt lt
# CHECK-NEXT: - 0.50 0.50 - - - - - cmplt r7, #243
# CHECK-NEXT: - 0.50 0.50 - - - - - uxthlt r7, r1
# CHECK-NEXT: - - - - - 1.00 - - strhlt r2, [r7, #22]
# CHECK-NEXT: - 0.50 0.50 - - - - - lsrlt r1, r6, #3
# CHECK-NEXT: - - - - - 1.00 - - strh r2, [r7, #22]
# CHECK-NEXT: - - - - 1.00 - - - asrs r1, r6, #7
# CHECK-NEXT: - - - - 1.00 - - - lsrs r1, r6, #31
Expand Down Expand Up @@ -2076,6 +2093,7 @@
# CHECK-NEXT: - 1.00 1.00 2.00 - - - - ldrd r0, r1, [r2, #-0]!
# CHECK-NEXT: - 1.00 1.00 2.00 - - - - ldrd r0, r1, [r2, #0]!
# CHECK-NEXT: - - - 2.00 - - - - ldrd r0, r1, [r2, #-0]
# CHECK-NEXT: - 1.00 1.00 2.00 - - - - ldrd r1, r2, [r0], #0
# CHECK-NEXT: - - - - - - - - ldrex r1, [r4]
# CHECK-NEXT: - - - - - - - - ldrex r8, [r4]
# CHECK-NEXT: - - - - - - - - ldrex r2, [sp, #128]
Expand Down Expand Up @@ -2470,6 +2488,7 @@
# CHECK-NEXT: - 0.50 0.50 - - 1.00 - - str r10, [r11], #0
# CHECK-NEXT: - 0.50 0.50 - - 1.00 - - strd r1, r1, [r0], #0
# CHECK-NEXT: - 0.50 0.50 - - 1.00 - - strd r6, r3, [r5], #-8
# CHECK-NEXT: - 0.50 0.50 - - 1.00 - - strd r8, r5, [r6], #-0
# CHECK-NEXT: - 0.50 0.50 - - 1.00 - - strd r7, r4, [r5], #-4
# CHECK-NEXT: - 0.50 0.50 - - 1.00 - - strd r0, r1, [r2, #-0]!
# CHECK-NEXT: - 0.50 0.50 - - 1.00 - - strd r0, r1, [r2, #0]!
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/tools/llvm-mca/X86/BtVer2/simple-test.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=100 < %s | FileCheck %s
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=100 -skip-unsupported-instructions=lack-sched < %s | FileCheck %s
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=100 -skip-unsupported-instructions=parse-failure < %s | FileCheck %s
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=100 -skip-unsupported-instructions=any < %s | FileCheck %s

add %edi, %eax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions %s 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions=lack-sched %s 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 %s 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-ERROR %s

# Test defends that if all instructions are skipped leaving an empty input, an error is printed.
Expand All @@ -7,7 +7,7 @@ bzhi %eax, %ebx, %ecx

# CHECK-ALL-NOT: error

# CHECK-ERROR: error: found an unsupported instruction in the input assembly sequence, use -skip-unsupported-instructions to ignore.
# CHECK-ERROR: error: found an unsupported instruction in the input assembly sequence, use -skip-unsupported-instructions=lack-sched to ignore these on the input.

# CHECK-SKIP: warning: found an unsupported instruction in the input assembly sequence, skipping with -skip-unsupported-instructions, note accuracy will be impacted:
# CHECK-SKIP: note: instruction: bzhil %eax, %ebx, %ecx
Expand Down
9 changes: 6 additions & 3 deletions llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions -timeline %s 2>&1 | FileCheck --check-prefix=CHECK-SKIP %s
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions=any -timeline %s 2>&1 | FileCheck --check-prefix=CHECK-SKIP %s
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions=lack-sched -timeline %s 2>&1 | FileCheck --check-prefix=CHECK-SKIP %s
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions=parse-failure -timeline %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR %s
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR %s

# Test checks that unsupported instructions exit with an error, unless -skip-unsupported-instructions is passed, in which case the remaining instructions should be analysed.
# Test checks that unsupported instructions exit with an error, unless -skip-unsupported-instructions=lack-sched is passed, in which case the remaining instructions should be analysed.
# Additionally check that -skip-unsupported-instructions=parse-failure continues to raise the lack of scheduling information.

# CHECK-SKIP: warning: found an unsupported instruction in the input assembly sequence, skipping with -skip-unsupported-instructions, note accuracy will be impacted:
# CHECK-ERROR: error: found an unsupported instruction in the input assembly sequence, use -skip-unsupported-instructions to ignore.
# CHECK-ERROR: error: found an unsupported instruction in the input assembly sequence, use -skip-unsupported-instructions=lack-sched to ignore these on the input.

bzhi %eax, %ebx, %ecx

Expand Down
14 changes: 14 additions & 0 deletions llvm/test/tools/llvm-mca/bad-input.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# RUN: not llvm-mca %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s
# RUN: not llvm-mca -skip-unsupported-instructions=none %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s
# RUN: not llvm-mca -skip-unsupported-instructions=lack-sched %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s
# RUN: not llvm-mca -skip-unsupported-instructions=parse-failure %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s
# RUN: not llvm-mca -skip-unsupported-instructions=any %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s

# Test checks that MCA does not produce a total cycles estimate if it encounters parse errors.

# CHECK-ALL-NOT: Total Cycles:

# CHECK: error: Assembly input parsing had errors, use -skip-unsupported-instructions=parse-failure to drop failing lines from the input.
# CHECK-SKIP: error: no assembly instructions found.

This is not a valid assembly file for any architecture (by virtue of this text.)
13 changes: 11 additions & 2 deletions llvm/tools/llvm-mca/CodeRegionGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace mca {
CodeRegionGenerator::~CodeRegionGenerator() {}

Expected<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions(
const std::unique_ptr<MCInstPrinter> &IP) {
const std::unique_ptr<MCInstPrinter> &IP, bool SkipFailures) {
MCTargetOptions Opts;
Opts.PreserveAsmComments = false;
CodeRegions &Regions = getRegions();
Expand Down Expand Up @@ -61,7 +61,16 @@ Expected<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions(
"This target does not support assembly parsing.",
inconvertibleErrorCode());
Parser->setTargetParser(*TAP);
Parser->Run(false);
// Parser->Run() confusingly returns true on errors, in which case the errors
// were already shown to the user. SkipFailures implies continuing in the
// presence of any kind of failure within the parser, in which case failing
// input lines are not represented, but the rest of the input remains.
if (Parser->Run(false) && !SkipFailures) {
const char *Message = "Assembly input parsing had errors, use "
"-skip-unsupported-instructions=parse-failure "
"to drop failing lines from the input.";
return make_error<StringError>(Message, inconvertibleErrorCode());
}

if (CCP->hadErr())
return make_error<StringError>("There was an error parsing comments.",
Expand Down
34 changes: 22 additions & 12 deletions llvm/tools/llvm-mca/CodeRegionGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ class CodeRegionGenerator {
CodeRegionGenerator(const CodeRegionGenerator &) = delete;
CodeRegionGenerator &operator=(const CodeRegionGenerator &) = delete;
virtual Expected<const CodeRegions &>
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP) = 0;
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) = 0;

public:
CodeRegionGenerator() {}
Expand All @@ -164,7 +165,8 @@ class AnalysisRegionGenerator : public virtual CodeRegionGenerator {
AnalysisRegionGenerator(llvm::SourceMgr &SM) : Regions(SM) {}

virtual Expected<const AnalysisRegions &>
parseAnalysisRegions(const std::unique_ptr<MCInstPrinter> &IP) = 0;
parseAnalysisRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) = 0;
};

/// Abstract CodeRegionGenerator with InstrumentRegionsRegions member
Expand All @@ -176,7 +178,8 @@ class InstrumentRegionGenerator : public virtual CodeRegionGenerator {
InstrumentRegionGenerator(llvm::SourceMgr &SM) : Regions(SM) {}

virtual Expected<const InstrumentRegions &>
parseInstrumentRegions(const std::unique_ptr<MCInstPrinter> &IP) = 0;
parseInstrumentRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) = 0;
};

/// This abstract class is responsible for parsing input ASM and
Expand All @@ -202,7 +205,8 @@ class AsmCodeRegionGenerator : public virtual CodeRegionGenerator {

unsigned getAssemblerDialect() const { return AssemblerDialect; }
Expected<const CodeRegions &>
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP) override;
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) override;
};

class AsmAnalysisRegionGenerator final : public AnalysisRegionGenerator,
Expand All @@ -222,17 +226,20 @@ class AsmAnalysisRegionGenerator final : public AnalysisRegionGenerator,
MCStreamerWrapper *getMCStreamer() override { return &Streamer; }

Expected<const AnalysisRegions &>
parseAnalysisRegions(const std::unique_ptr<MCInstPrinter> &IP) override {
Expected<const CodeRegions &> RegionsOrErr = parseCodeRegions(IP);
parseAnalysisRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) override {
Expected<const CodeRegions &> RegionsOrErr =
parseCodeRegions(IP, SkipFailures);
if (!RegionsOrErr)
return RegionsOrErr.takeError();
else
return static_cast<const AnalysisRegions &>(*RegionsOrErr);
}

Expected<const CodeRegions &>
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP) override {
return AsmCodeRegionGenerator::parseCodeRegions(IP);
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) override {
return AsmCodeRegionGenerator::parseCodeRegions(IP, SkipFailures);
}
};

Expand All @@ -254,17 +261,20 @@ class AsmInstrumentRegionGenerator final : public InstrumentRegionGenerator,
MCStreamerWrapper *getMCStreamer() override { return &Streamer; }

Expected<const InstrumentRegions &>
parseInstrumentRegions(const std::unique_ptr<MCInstPrinter> &IP) override {
Expected<const CodeRegions &> RegionsOrErr = parseCodeRegions(IP);
parseInstrumentRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) override {
Expected<const CodeRegions &> RegionsOrErr =
parseCodeRegions(IP, SkipFailures);
if (!RegionsOrErr)
return RegionsOrErr.takeError();
else
return static_cast<const InstrumentRegions &>(*RegionsOrErr);
}

Expected<const CodeRegions &>
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP) override {
return AsmCodeRegionGenerator::parseCodeRegions(IP);
parseCodeRegions(const std::unique_ptr<MCInstPrinter> &IP,
bool SkipFailures) override {
return AsmCodeRegionGenerator::parseCodeRegions(IP, SkipFailures);
}
};

Expand Down
Loading

0 comments on commit a8893c1

Please sign in to comment.