Split out the Dwarf writer stuff into separate files. This is a much more
[llvm/msp430.git] / tools / llvmc / example / Hello / Hello.cpp
blob23a13a57c2b84844358892b087ddf37d76395400
1 //===- Hello.cpp - Example code from "Writing an LLVMC Plugin" ------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Test plugin for LLVMC. Shows how to write plugins without using TableGen.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/CompilerDriver/CompilationGraph.h"
15 #include "llvm/CompilerDriver/Plugin.h"
17 #include <iostream>
19 namespace {
20 struct MyPlugin : public llvmc::BasePlugin {
21 void PopulateLanguageMap(llvmc::LanguageMap&) const
22 { std::cout << "Hello!\n"; }
24 void PopulateCompilationGraph(llvmc::CompilationGraph&) const
28 static llvmc::RegisterPlugin<MyPlugin> RP("Hello", "Hello World plugin");