llvm

clang and __float128 bug/error

痞子三分冷 提交于 2019-12-03 10:35:32
I've successfully compiled the current 3.3 branch of clang. But then C++ compilation of any file fails with the bug/error. Can that be fixed? In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/iostream:39: In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/ostream:39: In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/ios:40: In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/char_traits.h:40: In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../.

Is there Python Clang wrapper in the vein of pygccxml which wraps GCC-XML?

时光怂恿深爱的人放手 提交于 2019-12-03 10:34:35
For a long time now I've been using pygccxml to parse and introspect my C++ source code: it helps me to do some clever code-generation during our build process. Recently I've read a lot about the benefits of the LLVM stack, and especially the benefits that the LLVM Clang parser brings to C++ compilation. I am now wondering if there is any Python interface to Clang such that I could use it as the basis for some of my existing code generation tasks? After further digging I found that in the LLVM 2.7 release there could be the beginings of something useful: In the LLVM 2.7 time-frame, the Clang

CMake build of LLVM clang fails with “Unexpected failure executing llvm-build: Traceback (…) import llvmbuild”

送分小仙女□ 提交于 2019-12-03 10:29:05
I want to build LLVM clang compiler, but CMake ends up with the following error message: CMake Error at CMakeLists.txt:256 (message): Unexpected failure executing llvm-build: Traceback (most recent call last): File "C:/.../llvm/utils/llvm-build/llvm-build", line 3, in <module> import llvmbuild File "C:\...\llvm\utils\llvm-build\llvmbuild\__init__.py", line 1, in <module> from main import main ImportError: No module named main -- Configuring incomplete, errors occurred! I've got all needed tools installed. OS: Windows 7 x64 Python: 3.2.2 (x86-64) GnuWin32: 0.6.3 I've found the solution. I've

design suggestion: llvm multiple runtime contexts

妖精的绣舞 提交于 2019-12-03 10:24:18
问题 My application needs to run many separate contexts in the same (single-threaded) process. They all share a single LLVMContext . The process will run many contexts (in the thread sense); that is, each one runs a function in a continuation object based on boost::context (still on vault, pre-approved lib) it means that each context can yield, but they basically run in the same single-threaded process. Each one should run basically independent of the other, and more importantly, a compilation

Can C/C++ software be compiled into bytecode for later execution? (Architecture independent unix software.)

心已入冬 提交于 2019-12-03 09:59:03
问题 I would want to compile existing software into presentation that can later be run on different architectures (and OS). For that I need a (byte)code that can be easily run/emulated on another arch/OS (LLVM IR? Some RISC assemby?) Some random ideas: Compiling into JVM bytecode and running with java. Too restricting? C-compilers available? MS CIL. C-Compilers available? LLVM? Can Intermediate representation be run later? Compiling into RISC arch such as MMIX. What about system calls? Then there

Using gcc not llvm-gcc with Mac OS X Lion

无人久伴 提交于 2019-12-03 09:38:43
问题 gcc is symbolically linked to llvm-gcc on Mac OS X Lion. prosseek ~> ls -alF /usr/bin/gcc lrwxr-xr-x 1 root wheel 12 Nov 12 14:39 /usr/bin/gcc@ -> llvm-gcc-4.2 How can I setup to use gcc-4.2 when gcc is called? 回答1: As of Xcode 4.2 in Lion, Apple no longer ships its previous version of gcc-4.2 , which was in Xcode 4.1 and earlier versions. It now only ships llvm-gcc (gcc front-end with llvm code backend) and clang (clang front-end with llvm backend). While it is possible to install legacy

Which functionality/feature in Scala only exists as a concession to the underlying platform and should be removed if targeting something else?

那年仲夏 提交于 2019-12-03 09:32:47
A while ago I read about Scala for LLVM and I kept wondering which things in the Scala language/specification/library) only exist to make the JVM happy or improve interop with Java. Considering that running Scala on the LLVM provides much more freedoms and the plan is port the language (and not the whole Java ecosystem around it) which features won't make sense there? Guidance: I'm wondering about things like Object#finalize , the monitor stuff ( notify , wait ), clone vs. Cloneable , no 64-bit array indices, collection sizes limited to 32-bit, java.lang.String , Java reflection, ... The

llvm OCaml bindings

时光总嘲笑我的痴心妄想 提交于 2019-12-03 09:28:21
I'm working on llvm OCaml bindings. I installed llvm package through opam ( opam install llvm ), when I use llvm in utop, I get the following error: #require "llvm";; Error: The external function 'llvm_global_succ' is not available. The opam llvm version is 3.2. I also tried building llvm3.3 from the official site ( ./configure --with-ocaml-libdir='ocamlc -where' ), the build was successful (all the llvm command-line tools are working), but I got the same error in utop. I'm on Mac OS 10.7.5. Edit: I solved it.. ocamlmktop -o llvmtop llvm.cma -cc g++ Then launch llvmtop , you can use llvm

Integrating LLVM passes

瘦欲@ 提交于 2019-12-03 09:23:27
This maybe a rookie question but is there a way to integrate my LLVM modulepass to be called by default during the transformation phase? Right now I am using this syntax to load my pass and register it ~/llvm/llvm/build/Debug+Asserts/bin/clang -Xclang -load -Xclang ~/llvm/llvm/build/Debug+Asserts/lib/SOMEPASSLIB.so (The problem is when I want to build some package with this pass, the compiler accepts it when I say, pass the loading part as CFLAGS env variable, but some makefiles use CFLAGS for linking too, and the linker has no idea what it can do with this information and fails the build :\ )

Use Clang to convert C++ to C code

我们两清 提交于 2019-12-03 09:08:49
I know that llvm can be used to convert c++ into c code. I was wondering if clang could do the same thing (seeing as clang was derived from llvm ). So can I use clang to convert c++ code into c code? If you want to know why I want to do this here is my scenario: PIC, which is a micro controller manufacturer, does not make c++ compilers, but does make c compilers for most of their products. I want to write in c++ and then as part of my build process, convert the c++ code into a temporary c file, which is then fed into the PIC compiler, and viola I have written c++ code for a PIC micro. Clang