aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-06 16:43:36 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-06 16:43:36 +0000
commit39c411fa229b2a6747b92f945d1702ee674d3470 (patch)
tree621b36eacc4db3fa450851563953e3267a90b501 /lib/Frontend
parent5d98994c7749312a43ce6adf45537979a98e7afd (diff)
libclang: Allow callers of clang_saveTranslationUnit() to distinguish
between different classes of errors. Addresses most of <rdar://problem/9660328>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/ASTUnit.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 86a9a351d2..8f61d6a8c2 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -2287,9 +2287,9 @@ void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column,
}
}
-bool ASTUnit::Save(llvm::StringRef File) {
+CXSaveError ASTUnit::Save(llvm::StringRef File) {
if (getDiagnostics().hasErrorOccurred())
- return true;
+ return CXSaveError_TranslationErrors;
// FIXME: Can we somehow regenerate the stat cache here, or do we need to
// unconditionally create a stat cache when we parse the file?
@@ -2297,11 +2297,11 @@ bool ASTUnit::Save(llvm::StringRef File) {
llvm::raw_fd_ostream Out(File.str().c_str(), ErrorInfo,
llvm::raw_fd_ostream::F_Binary);
if (!ErrorInfo.empty() || Out.has_error())
- return true;
+ return CXSaveError_Unknown;
serialize(Out);
Out.close();
- return Out.has_error();
+ return Out.has_error()? CXSaveError_Unknown : CXSaveError_None;
}
bool ASTUnit::serialize(llvm::raw_ostream &OS) {