summaryrefslogtreecommitdiff
path: root/tools/llvmc/examples/Hello/Hello.cpp
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-08-19 20:04:19 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-08-19 20:04:19 +0000
commitb57326c8aab6f6089b29e324c39811d494d6fc42 (patch)
treeaabf6674340d3302ccf75e8c951277de3f7139ce /tools/llvmc/examples/Hello/Hello.cpp
parent8f2766df7fe421dc4ae4aa03e461f802fe2ab7aa (diff)
downloadllvm-b57326c8aab6f6089b29e324c39811d494d6fc42.tar.gz
llvm-b57326c8aab6f6089b29e324c39811d494d6fc42.tar.bz2
llvm-b57326c8aab6f6089b29e324c39811d494d6fc42.tar.xz
llvmc: Update examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc/examples/Hello/Hello.cpp')
-rw-r--r--tools/llvmc/examples/Hello/Hello.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/llvmc/examples/Hello/Hello.cpp b/tools/llvmc/examples/Hello/Hello.cpp
new file mode 100644
index 0000000000..71f04fdd49
--- /dev/null
+++ b/tools/llvmc/examples/Hello/Hello.cpp
@@ -0,0 +1,29 @@
+//===- Hello.cpp - Example code from "Writing an LLVMC Plugin" ------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Shows how to write llvmc-based drivers without using TableGen.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/CompilerDriver/AutoGenerated.h"
+#include "llvm/CompilerDriver/Main.inc"
+
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvmc {
+namespace autogenerated {
+
+int PreprocessOptions () { return 0; }
+
+int PopulateLanguageMap (LanguageMap&) { llvm::outs() << "Hello!\n"; return 0; }
+
+int PopulateCompilationGraph (CompilationGraph&) { return 0; }
+
+}
+}