diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-12-24 18:15:21 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-12-24 18:15:21 +0000 |
commit | a0be09f511c68a88ee95b73c8f0ebd78156a559e (patch) | |
tree | 678964cde398eea6351973aba975ccec327aad3b /include | |
parent | fa45cdf646572cf11b03cfdaa63f75fd74fc7d34 (diff) |
Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>
When the backend is used from clang, it should produce proper diagnostics
instead of just printing messages to errs(). Other clients may also want to
register their own error handlers with the LLVMContext, and the same handler
should work for warnings in the same way as the existing emitError methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/LLVMContext.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 5903e2e55e..a5a26946b7 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -89,6 +89,12 @@ public: void emitError(const Instruction *I, const Twine &ErrorStr); void emitError(const Twine &ErrorStr); + /// emitWarning - This is similar to emitError but it emits a warning instead + /// of an error. + void emitWarning(unsigned LocCookie, const Twine &ErrorStr); + void emitWarning(const Instruction *I, const Twine &ErrorStr); + void emitWarning(const Twine &ErrorStr); + private: LLVMContext(LLVMContext&) LLVM_DELETED_FUNCTION; void operator=(LLVMContext&) LLVM_DELETED_FUNCTION; |