開發平台(Platform): (Ex: Win10, Linux, ...)
Ubuntu
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
clang
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
llvm
問題(Question):
我在看llvm的附帶文件:
http://llvm.org/docs/WritingAnLLVMPass.html#running-a-pass-with-opt
裡面有段 Hello.cpp
然後我發現 clang++ Hello.cpp是無法成功編譯檔案的
(錯誤訊息有點多 所以我就不加上了
我也試著編譯 關於llvm/lib/Transform裡面 也是無法成功
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
p.s我付的網址裡面有這段code
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
namespace {
struct Hello : public FunctionPass {
static char ID;
Hello() : FunctionPass(ID) {}
bool runOnFunction(Function &F) override {
errs() << "Hello: ";
errs().write_escaped(F.getName()) << '\n';
return false;
}
}; // end of struct Hello
} // end of anonymous namespace
char Hello::ID = 0;
static RegisterPass<Hello> X("hello", "Hello World Pass",
false /* Only looks at CFG */,
false /* Analysis Pass */);