summaryrefslogtreecommitdiff
path: root/include/clang/Serialization/GlobalModuleIndex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Serialization/GlobalModuleIndex.h')
-rw-r--r--include/clang/Serialization/GlobalModuleIndex.h31
1 files changed, 9 insertions, 22 deletions
diff --git a/include/clang/Serialization/GlobalModuleIndex.h b/include/clang/Serialization/GlobalModuleIndex.h
index 5791fc024a32..5f4812626224 100644
--- a/include/clang/Serialization/GlobalModuleIndex.h
+++ b/include/clang/Serialization/GlobalModuleIndex.h
@@ -1,9 +1,8 @@
//===--- GlobalModuleIndex.h - Global Module Index --------------*- C++ -*-===//
//
-// 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
//
//===----------------------------------------------------------------------===//
//
@@ -21,6 +20,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Error.h"
#include <memory>
#include <utility>
@@ -123,27 +123,14 @@ class GlobalModuleIndex {
public:
~GlobalModuleIndex();
- /// An error code returned when trying to read an index.
- enum ErrorCode {
- /// No error occurred.
- EC_None,
- /// No index was found.
- EC_NotFound,
- /// Some other process is currently building the index; it is not
- /// available yet.
- EC_Building,
- /// There was an unspecified I/O error reading or writing the index.
- EC_IOError
- };
-
/// Read a global index file for the given directory.
///
/// \param Path The path to the specific module cache where the module files
/// for the intended configuration reside.
///
/// \returns A pair containing the global module index (if it exists) and
- /// the error code.
- static std::pair<GlobalModuleIndex *, ErrorCode>
+ /// the error.
+ static std::pair<GlobalModuleIndex *, llvm::Error>
readIndex(llvm::StringRef Path);
/// Returns an iterator for identifiers stored in the index table.
@@ -195,9 +182,9 @@ public:
/// creating modules.
/// \param Path The path to the directory containing module files, into
/// which the global index will be written.
- static ErrorCode writeIndex(FileManager &FileMgr,
- const PCHContainerReader &PCHContainerRdr,
- llvm::StringRef Path);
+ static llvm::Error writeIndex(FileManager &FileMgr,
+ const PCHContainerReader &PCHContainerRdr,
+ llvm::StringRef Path);
};
}