llvm.org GIT mirror llvm / 6bad72c
[llvm-mca] Add an error handler for error from parseCodeRegions Summary: It's a bit tricky to add a test for the failing path right now, binary support will have an easier path to exercise the path here. * Ran clang-format. Reviewers: andreadb Reviewed By: andreadb Subscribers: tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D55803 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349659 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Davis 8 months ago
1 changed file(s) with 15 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
148148 cl::desc("If set, assume that loads and stores do not alias"),
149149 cl::cat(ToolOptions), cl::init(true));
150150
151 static cl::opt
152 LoadQueueSize("lqueue",
153 cl::desc("Size of the load queue"),
154 cl::cat(ToolOptions), cl::init(0));
155
156 static cl::opt
157 StoreQueueSize("squeue",
158 cl::desc("Size of the store queue"),
159 cl::cat(ToolOptions), cl::init(0));
151 static cl::opt LoadQueueSize("lqueue",
152 cl::desc("Size of the load queue"),
153 cl::cat(ToolOptions), cl::init(0));
154
155 static cl::opt StoreQueueSize("squeue",
156 cl::desc("Size of the store queue"),
157 cl::cat(ToolOptions), cl::init(0));
160158
161159 static cl::opt
162160 PrintInstructionTables("instruction-tables",
338336 // Parse the input and create CodeRegions that llvm-mca can analyze.
339337 mca::AsmCodeRegionGenerator CRG(*TheTarget, SrcMgr, Ctx, *MAI, *STI, *MCII);
340338 Expected RegionsOrErr = CRG.parseCodeRegions();
341 if (auto Err = RegionsOrErr.takeError()) {
342 WithColor::error() << Err << "\n";
339 if (!RegionsOrErr) {
340 if (auto Err =
341 handleErrors(RegionsOrErr.takeError(), [](const StringError &Err) {
342 WithColor::error() << Err.getMessage() << '\n';
343 })) {
344 // Default case.
345 WithColor::error() << toString(std::move(Err)) << '\n';
346 }
343347 return 1;
344348 }
345349 const mca::CodeRegions &Regions = *RegionsOrErr;