llvm

llvm OCaml bindings

旧巷老猫 提交于 2019-12-21 03:13:39
问题 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.

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

点点圈 提交于 2019-12-21 03:13:12
问题 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

Use Clang to convert C++ to C code

对着背影说爱祢 提交于 2019-12-21 02:36:13
问题 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

LLVM 2.0 can't build for iPhone simulator. GCC 4.2 works fine

删除回忆录丶 提交于 2019-12-21 02:34:18
问题 When I build my project (any project, really - I tried creating a new empty project with the same results), it builds fine with GCC 4.2 under either Xcode4 or Xcode 3.2.4. If I build using LLVM 2.0 under Xcode4 or with LLVM 1.5 under Xcode3, I get compile-time build failures, but only when building for the Simulator. The build errors that I get under LLVM are all in headers over which I have no control, such as UIView.h, UIDevice.h, UIApplication.h, UITextView.h and UIWebView.h in UIKit and

STL/Boost equivalent of LLVM SmallVector?

♀尐吖头ヾ 提交于 2019-12-20 17:33:08
问题 I have been trying to see if I can optimize the case when having many small vectors of data. In my use case there may be 100,000+ of these vectors so the size of the vector storage is critical. Each may only have 1 or 2 elements at times but may grow larger capacities in many cases. I have tried using a simple std::vector but this is incredibly slow as it allocates N small buffers on the heap which wastes memory and takes far too long in a time-critical environment. Effectively a small-buffer

How to use Clang as a compiler with Qt Creator on Windows?

梦想的初衷 提交于 2019-12-20 12:04:32
问题 I've installed Qt SDK with Qt Creator on my Windows 7. LLVM & Clang installed as well. CMake was already installed. Afterwards added Clang as a compiler into: Tools -> Options... -> Build & Run -> Compilers Then I've created Clang kit. However while creating new project (simple console application) I've no ability to choose Clang kit. There are only autodetected MSVC kits. Maybe the problem is that "Qt version" in Clang kit is empty. But where to get qmake for it? 回答1: You should also have an

How to use cscope for a project which has .c , .cpp and .h files?

…衆ロ難τιáo~ 提交于 2019-12-20 10:47:02
问题 I am working on a project which requires the understanding of llvm compiler source-code. To browse source code of llvm, I tried to use cscope with following command in the root directory of the source: cscope -R * But it doesn't work. As there are mainly .cpp and .h files but some .c files are also there. So now I don't have a clue how to make cscope work? Can someone please help? 回答1: You can use following commands to do the required task from the root directory of llvm source tree: touch

lldb: Breakpoint on exceptions (equivalent of gdb's catch throw)

孤街浪徒 提交于 2019-12-20 09:56:55
问题 I am trying to use lldb for c++ debugging and I want to halt if an exception is thrown, like gdb's catch throw , and I cannot find an equivalent in the lldb documentation. 回答1: In Xcode, you can set an Exception breakpoint (View > Navigators > Show Breakpoint Navigator, hit the + button in the bottom of the breakpoint list window to add a new breakpoint). If you're using command line lldb, put a breakpoint on __cxa_throw for C++ exception throws, objc_exception_throw for Objective-C exception

How to affect Delphi XEx code generation for Android/ARM targets?

a 夏天 提交于 2019-12-20 08:00:17
问题 Update 2017-05-17. I no longer work for the company where this question originated, and do not have access to Delphi XEx. While I was there, the problem was solved by migrating to mixed FPC+GCC (Pascal+C), with NEON intrinsics for some routines where it made a difference. (FPC+GCC is highly recommended also because it enables using standard tools, particularly Valgrind.) If someone can demonstrate, with credible examples, how they are actually able to produce optimized ARM code from Delphi

Error in Compiling haskell .ll file with llvm backend

让人想犯罪 __ 提交于 2019-12-20 03:14:34
问题 I want to compile haskell using ghc front-end and llvm back-end. I have following code in my haskell hello.hs file: main = putStrLn "Hello World!" I compile hello.hs with ghc using following command ghc -fllvm -keep-llvm-files -force-recomp -hello.hs which generate a hello.ll file along with other files. I then try to compile this .ll file into a .bc file. llvm-as hello.ll -o hello.bc and then this .bc file to executable file llc hello.bc -o hello which generate an executable file. The