summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenPGO.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-05-16 21:04:19 +0000
committerVedant Kumar <vsk@apple.com>2016-05-16 21:04:19 +0000
commitda9513fc3ca4e942951c0dafdffc2b3a4a52a084 (patch)
tree91b83169f6f0ca5bb1747c72a693ffa2393a9dbb /clang/lib/CodeGen/CodeGenPGO.cpp
parent85c973d3f06b86b099be39d3ac2dcb6b8c744955 (diff)
downloadbcm5719-llvm-da9513fc3ca4e942951c0dafdffc2b3a4a52a084.tar.gz
bcm5719-llvm-da9513fc3ca4e942951c0dafdffc2b3a4a52a084.zip
Revert "Reapply^2 "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC""
This reverts commit r269695. The llvm commit does not pass the MSVC bot. llvm-svn: 269701
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index c19321b5129..43bc37c49f7 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -800,21 +800,20 @@ void CodeGenPGO::loadRegionCounts(llvm::IndexedInstrProfReader *PGOReader,
bool IsInMainFile) {
CGM.getPGOStats().addVisited(IsInMainFile);
RegionCounts.clear();
- llvm::Expected<llvm::InstrProfRecord> RecordExpected =
+ llvm::ErrorOr<llvm::InstrProfRecord> RecordErrorOr =
PGOReader->getInstrProfRecord(FuncName, FunctionHash);
- if (auto E = RecordExpected.takeError()) {
- auto IPE = llvm::InstrProfError::take(std::move(E));
- if (IPE == llvm::instrprof_error::unknown_function)
+ if (std::error_code EC = RecordErrorOr.getError()) {
+ if (EC == llvm::instrprof_error::unknown_function)
CGM.getPGOStats().addMissing(IsInMainFile);
- else if (IPE == llvm::instrprof_error::hash_mismatch)
+ else if (EC == llvm::instrprof_error::hash_mismatch)
CGM.getPGOStats().addMismatched(IsInMainFile);
- else if (IPE == llvm::instrprof_error::malformed)
+ else if (EC == llvm::instrprof_error::malformed)
// TODO: Consider a more specific warning for this case.
CGM.getPGOStats().addMismatched(IsInMainFile);
return;
}
ProfRecord =
- llvm::make_unique<llvm::InstrProfRecord>(std::move(RecordExpected.get()));
+ llvm::make_unique<llvm::InstrProfRecord>(std::move(RecordErrorOr.get()));
RegionCounts = ProfRecord->Counts;
}
OpenPOWER on IntegriCloud