Index: include/llvm-c/Core.h
===================================================================
--- include/llvm-c/Core.h	(revision 112342)
+++ include/llvm-c/Core.h	(working copy)
@@ -284,6 +284,11 @@
 void LLVMDisposeMessage(char *Message);
 
 
+/*===-- Version -----------------------------------------------------------===*/
+
+const char* LLVMGetVersion(bool ShowRepositoryRevision);
+
+
 /*===-- Contexts ----------------------------------------------------------===*/
 
 /* Create and destroy contexts. */
Index: lib/VMCore/Core.cpp
===================================================================
--- lib/VMCore/Core.cpp	(revision 112342)
+++ lib/VMCore/Core.cpp	(working copy)
@@ -28,9 +28,11 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Config/config.h"
 #include <cassert>
 #include <cstdlib>
 #include <cstring>
+#include <stdio.h>
 
 using namespace llvm;
 
@@ -41,7 +43,19 @@
   free(Message);
 }
 
+/*===-- Version -----------------------------------------------------------===*/
 
+const char * LLVMGetVersion(bool ShowRepositoryRevision) {
+  char buf[64];
+  int pos = 0;
+  pos = sprintf(buf+pos, "%s", PACKAGE_VERSION);
+  if (ShowRepositoryRevision) {
+    const char *repository_revision = "$Rev: 112342 $";
+    pos = sprintf(buf+pos, " (rev.%u)", atoi(&repository_revision[6]));
+  }
+  return strdup(buf);
+}
+
 /*===-- Operations on contexts --------------------------------------------===*/
 
 LLVMContextRef LLVMContextCreate() {
