blob: 1eae173519198619517aabb963d1141ba90e7d2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include "radeon_llvm_emit.h"
#include <llvm/Support/CommandLine.h>
#include <llvm/Support/IRReader.h>
#include <llvm/Support/SourceMgr.h>
#include <llvm/LLVMContext.h>
#include <llvm/Module.h>
#include <stdio.h>
#include <llvm-c/Core.h>
using namespace llvm;
static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
int main(int argc, char ** argv)
{
unsigned char * bytes;
unsigned byte_count;
std::auto_ptr<Module> M;
LLVMContext &Context = getGlobalContext();
SMDiagnostic Err;
cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
M.reset(ParseIRFile(InputFilename, Err, Context));
Module * mod = M.get();
radeon_llvm_compile(wrap(mod), &bytes, &byte_count, "SI", 1);
}
|