llvm

XCode 4.2 Compiler Error

纵饮孤独 提交于 2019-12-11 03:59:06
问题 When I create a new Project with XCode 4.2 (a Single View iOS App, for instance) the main.m-File in the "Supporting Files"-Folder looks like: #import <UIKit/UIKit.h> #import "iiiAppDelegate.h" int main(int argc, char *argv[]) { int retVal = 0; @autoreleasepool { retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([iiiAppDelegate class])); } return retVal; } The Compiler Setting (in Build Settings) is the Apple 3.0 LLVM. When I change it to GCC 4.2 or GCC4.2 LLVM it shown errors with

LLVM Kaleidoscope tutorial failing on local extern

寵の児 提交于 2019-12-11 03:52:29
问题 I am working through the LLVM Kaleidoscope tutorial. Everything is working fine except for local externs (as opposed to things like the math functions). [c34n10 kaleidoscope] ./toy ready> extern sin(x); sin(1); ready> Read extern: declare double @sin(double) ready> ready> Evaluated to 0.841471 ready> extern putchard(x); putchard(120); ready> Read extern: declare double @putchard(double) ready> ready> Failure value returned from cantFail wrapped call UNREACHABLE executed at /gpfs/loomis

Using llvm::Function::dump(), linker gives “undefined reference to `llvm::Value::dump() const'”

大城市里の小女人 提交于 2019-12-11 03:45:38
问题 I'm trying to generate LLVM IR code, which I have done successfully as part of the Kaleidoscope tutorial on this same machine, using these same compiler flags. My code compiles without errors in clang++ 3.4. However, at link time I'm getting: undefined reference to `llvm::Value::dump() const' The error is being triggered by the line: if (generator.code()) // returns llvm::Function*, or NULL generator.code()->dump(); If I remove the call to dump() , the linker is happy. Clang++ flags I'm using

In Xcode 4.5 “Show Live Issues” no longer works

早过忘川 提交于 2019-12-11 03:43:06
问题 I found it to be very useful that Xcode would show compiler warnings as I wrote code. For instance: if I wrote "ldksjfksdj" I'd expect to immediately see a red exclamation mark icon and the warning, use of undeclared identifier . But now with Xcode 4.5 I only see that warning after I compile the project. And then, after I've compiled it, see the error, and delete "ldksjfksdj", the warning doesn't disappear immediately the way it used to. It will only disappear after I compile it again. This

libcurl linker error on Xcode5 but working fine on Xcode 4.6

本小妞迷上赌 提交于 2019-12-11 03:18:20
问题 I have a project which uses libcurl.all.a . It builds, links and runs perfectly on Xcode 4.6.3. But in Xcode5, it throws linker errors on undefined symbols. The error log is as follows. Undefined symbols for architecture i386: "_SSLCopyPeerCertificates", referenced from: _darwinssl_connect_common in libcurl.all.a(libcurl_la-curl_darwinssl.o) "_SSLDisposeContext", referenced from: _Curl_darwinssl_close in libcurl.all.a(libcurl_la-curl_darwinssl.o) _Curl_darwinssl_shutdown in libcurl.all.a

When is libc++ sources needed when building Clang from sources?

混江龙づ霸主 提交于 2019-12-11 02:59:22
问题 I've been building Clang for years on Linux and OS X. From the LLVM Download page, I've always used the following sources: LLVM (LLVM source) Compiler Front End (Clang source) Compiler RT (Runtime source) Compiler Tools (Tools Extra sources) The recipe I am using to download, build and install Clang 3.5 can be found at Clang 3.5 download, build and install script. Its works great on OS X 10.7 and 10.8, and I've never needed the libc++ gear on OS X 10.7.x or 10.8.x (that's about 2010 or so

LLVM: Instruction does not dominate all uses

筅森魡賤 提交于 2019-12-11 02:48:01
问题 I'm splitting all Basic Blocks with minimum number of instructions (usually 3-5): llvm::SplitBlock(BasicBlock, &*BasicBlockiter, Pass); and trying to get object file from IR llc -filetype=obj 2.ll I got the following errors: Instruction does not dominate all uses! %1 = alloca i32 %mul = load i32* %1 Instruction does not dominate all uses! %1 = alloca i32 %99 = load i32* %1 and While deleting: i32 % Use still stuck around after Def is destroyed: %var = alloca i32 Assertion failed: use_empty()

How to Compile and Run llc-3.4 generated C++ code using native compiler(g++)?

妖精的绣舞 提交于 2019-12-11 02:26:55
问题 Note: Goal of this work is to use some of the c++11 features in non c++11 compiler Following steps are done, Generate llvm bit code, clang++ -emit-llvm -c test.cc -o test.o Convert llvm bitcode to c++ code, llc-3.4 test.o -o test.cpp -march=cpp Getting below error while compiling the llvm generated c++ code using GNU g++ arunprasadr@geekvm:~/works/myex/llvm$ g++ test.cpp test.cpp:3:23: fatal error: llvm/Pass.h: No such file or directory compilation terminated. I even tried adding llvm-dev

Built in Analyzer in Xcode 3.1.4

折月煮酒 提交于 2019-12-11 02:11:55
问题 I wonder if the built in Analyzer in Xcode 3.1.4 makes it redundant to use LLVM/Clang Static Analyzer separately? Please refer to the original article here: Finding memory leaks with the LLVM/Clang Static Analyzer Thanks. 回答1: Correct. (assuming there's a Build and Analyze option in 3.1.4, I thought it only made it to Snow Leopard). Of course, the builds available directly from LLVM are newer than the ones with Xcode, so they probably fix some issues that may exist with the one currently

Add LLVM to project using cmake

社会主义新天地 提交于 2019-12-11 02:07:59
问题 I'm trying to add LLVM to a cmake project, using cygwin as a compiler. I downloaded LLVM from cygwin's installer (just installed all of the llvm related packages). The files are there, however I cannot include LLVM in my project. I tried using the official guide for 3.5.2 (the version it installed) and my CMakeLists.txt looks like cmake_minimum_required(VERSION 3.2) project(Lang) find_package(LLVM REQUIRED CONFIG) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Using