-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[NFC][SampleFDO] Re-apply "In text sample prof reader, report more concrete parsing errors for different line types" #155124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… errors for different line types
@llvm/pr-subscribers-pgo Author: Mingming Liu (mingmingl-llvm) ChangesRe-apply #154885 with a fix to initialize Full diff: https://github.com/llvm/llvm-project/pull/155124.diff 1 Files Affected:
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index d147222fe2ce6..12769a391286c 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -375,16 +375,23 @@ std::error_code SampleProfileReaderText::readImpl() {
StringRef FName;
DenseMap<StringRef, uint64_t> TargetCountMap;
uint32_t Depth, LineOffset, Discriminator;
- LineType LineTy;
+ LineType LineTy = LineType::BodyProfile;
uint64_t FunctionHash = 0;
uint32_t Attributes = 0;
bool IsFlat = false;
if (!ParseLine(*LineIt, LineTy, Depth, NumSamples, LineOffset,
Discriminator, FName, TargetCountMap, FunctionHash,
Attributes, IsFlat)) {
- reportError(LineIt.line_number(),
- "Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " +
- *LineIt);
+ switch (LineTy) {
+ case LineType::Metadata:
+ reportError(LineIt.line_number(),
+ "Cannot parse metadata: " + *LineIt);
+ break;
+ default:
+ reportError(LineIt.line_number(),
+ "Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " +
+ *LineIt);
+ }
return sampleprof_error::malformed;
}
if (LineTy != LineType::Metadata && Depth == DepthMetadata) {
|
Searching
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/14334 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/10248 Here is the relevant piece of the build log for the reference
|
Re-apply #154885 with a fix to initialize
LineTy
before callingParseLine
.