Index: lib/Basic/ConvertUTF.c
===================================================================
--- lib/Basic/ConvertUTF.c	(revision 160751)
+++ lib/Basic/ConvertUTF.c	(working copy)
@@ -285,6 +285,7 @@
     *targetStart = target;
     return result;
 }
+#endif
 
 /* --------------------------------------------------------------------- */
 
@@ -339,8 +340,6 @@
     return result;
 }
 
-#endif
-
 /* --------------------------------------------------------------------- */
 
 /*
Index: lib/Basic/ConvertUTFWrapper.cpp
===================================================================
--- lib/Basic/ConvertUTFWrapper.cpp	(revision 160751)
+++ lib/Basic/ConvertUTFWrapper.cpp	(working copy)
@@ -51,4 +51,20 @@
   return result == conversionOK;
 }
 
+bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr) {
+  const UTF32 *SourceStart = &Source;
+  const UTF32 *SourceEnd = SourceStart + 1;
+  UTF8 *TargetStart = reinterpret_cast<UTF8 *>(ResultPtr);
+  UTF8 *TargetEnd = TargetStart + 4;
+  ConversionResult CR = ConvertUTF32toUTF8(&SourceStart, SourceEnd,
+                                           &TargetStart, TargetEnd,
+                                           strictConversion);
+  if (CR != conversionOK)
+    return false;
+
+  ResultPtr = reinterpret_cast<char*>(TargetStart);
+  return true;
 }
+
+} // end namespace clang
+
Index: include/clang/Basic/ConvertUTF.h
===================================================================
--- include/clang/Basic/ConvertUTF.h	(revision 160751)
+++ include/clang/Basic/ConvertUTF.h	(working copy)
@@ -110,6 +110,8 @@
 #define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
 #define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
 
+#define UNI_MAX_UTF8_BYTES_PER_CODE_POINT 4
+
 typedef enum {
   conversionOK,           /* conversion successful */
   sourceExhausted,        /* partial character in source, but hit end */
@@ -139,11 +141,13 @@
 ConversionResult ConvertUTF16toUTF8 (
   const UTF16** sourceStart, const UTF16* sourceEnd,
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
+#endif
 
 ConversionResult ConvertUTF32toUTF8 (
   const UTF32** sourceStart, const UTF32* sourceEnd,
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
 
+#ifdef CLANG_NEEDS_THESE_ONE_DAY
 ConversionResult ConvertUTF16toUTF32 (
   const UTF16** sourceStart, const UTF16* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
@@ -177,6 +181,18 @@
 bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source,
                        char *&ResultPtr);
 
+/**
+ * Convert an Unicode code point to UTF8 sequence.
+ *
+ * \param Source a Unicode code point.
+ * \param [in,out] ResultPtr pointer to the output buffer, needs to be at least
+ * \c UNI_MAX_UTF8_BYTES_PER_CODE_POINT bytes.  On success ResultPtr is updated
+ * one past end of the converted sequence.
+ *
+ * \returns true on success.
+ */
+bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr);
+
 }
 #endif
 
