diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-21 18:13:02 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-21 18:13:02 +0000 |
commit | 54db30ce18663e6c2991958f3b5d18362e8e93c4 (patch) | |
tree | 4aa6442802570767398cc83ba484e97b1309bdc2 /contrib/llvm/tools/llvm-cov/TestingSupport.cpp | |
parent | 35284c22e9c8348159b7ce032ea45f2cdeb65298 (diff) | |
parent | e6d1592492a3a379186bfb02bd0f4eda0669c0d5 (diff) |
Notes
Diffstat (limited to 'contrib/llvm/tools/llvm-cov/TestingSupport.cpp')
-rw-r--r-- | contrib/llvm/tools/llvm-cov/TestingSupport.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/contrib/llvm/tools/llvm-cov/TestingSupport.cpp b/contrib/llvm/tools/llvm-cov/TestingSupport.cpp index 16a1c2665299..3ee318c9c640 100644 --- a/contrib/llvm/tools/llvm-cov/TestingSupport.cpp +++ b/contrib/llvm/tools/llvm-cov/TestingSupport.cpp @@ -1,9 +1,8 @@ //===- TestingSupport.cpp - Convert objects files into test files --------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -70,9 +69,18 @@ int convertForTestingMain(int argc, const char *argv[]) { uint64_t ProfileNamesAddress = ProfileNames.getAddress(); StringRef CoverageMappingData; StringRef ProfileNamesData; - if (CoverageMapping.getContents(CoverageMappingData) || - ProfileNames.getContents(ProfileNamesData)) + if (Expected<StringRef> E = CoverageMapping.getContents()) + CoverageMappingData = *E; + else { + consumeError(E.takeError()); + return 1; + } + if (Expected<StringRef> E = ProfileNames.getContents()) + ProfileNamesData = *E; + else { + consumeError(E.takeError()); return 1; + } int FD; if (auto Err = sys::fs::openFileForWrite(OutputFilename, FD)) { |