[Sanitizer]: Introduce a common internal printf function. For now, also use tool-specific wrappers TsanPrintf (its output is controlled by TSan flags) and AsanPrintf (which copies its results to the ASan-private buffer). Supported formats: %[z]{d,u,x}, %s, %p. Re-write all format strings in TSan according to this format (this should have no effect on 64-bit platforms).

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158065 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_internal.h b/lib/asan/asan_internal.h
index d234a78..facc2df 100644
--- a/lib/asan/asan_internal.h
+++ b/lib/asan/asan_internal.h
@@ -157,11 +157,10 @@
 uptr ReadFileToBuffer(const char *file_name, char **buff,
                         uptr *buff_size, uptr max_len);
 
+void AppendToErrorMessageBuffer(const char *buffer);
 // asan_printf.cc
-void RawWrite(const char *buffer);
-int SNPrintf(char *buffer, uptr length, const char *format, ...);
-void Printf(const char *format, ...);
-void Report(const char *format, ...);
+void AsanPrintf(const char *format, ...) FORMAT(1, 2);
+void AsanReport(const char *format, ...) FORMAT(1, 2);
 
 // Don't use std::min and std::max, to minimize dependency on libstdc++.
 template<class T> T Min(T a, T b) { return a < b ? a : b; }