llvm

clang/clang++ doesn't find C/C++ headers in windows?

守給你的承諾、 提交于 2019-12-18 04:34:30
问题 1 hour ago I downloaded llvm-3.6.0-rc4-win32.exe from http://llvm.org/pre-releases/3.6.0/ . I tried to compile simple C code that just print "hello" , but it didn't compile , because clang.exe can't find stdio.h. when I use clang-cl.exe with the same code , it worked . I also have the same problem with clang++ even with iostream , I add -I flag to GCC (4.9.1) C++ headers , the result: C:\Users\One\Desktop>clang++ -I c:\MinGW\x86_64-w64-mingw32\include\c++ main.cpp -lib=libstdc++ In file

What is GCC_NO_COMMON_BLOCKS used for?

回眸只為那壹抹淺笑 提交于 2019-12-18 03:49:08
问题 I found that my project sets GCC_NO_COMMON_BLOCKS = NO under Apple LLVM Compiler 3.1 - Code Generation settings, as "No Common Blocks" I would like to know: what is that flag used for? Thanks a lot 回答1: From Xcode's quick help: In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without extern ) in two different compilations, you will get an error

What is GCC_NO_COMMON_BLOCKS used for?

别等时光非礼了梦想. 提交于 2019-12-18 03:49:04
问题 I found that my project sets GCC_NO_COMMON_BLOCKS = NO under Apple LLVM Compiler 3.1 - Code Generation settings, as "No Common Blocks" I would like to know: what is that flag used for? Thanks a lot 回答1: From Xcode's quick help: In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without extern ) in two different compilations, you will get an error

Using #pragma to suppress “Instance method not found” warnings in Xcode

拈花ヽ惹草 提交于 2019-12-18 02:54:11
问题 I want to use #pragma (in Xcode) to suppress the warning: warning: instance method '-someMethod' not found (return type defaults to 'id') I've tried: #pragma GCC diagnostic ignored "-Wmissing-declarations" And several others, but nothing works. What warning causes the "instance method not found"? Edit As requested here is the actual code: ... if (sampleRate > 0 && ![self isFinishing]) //<--- Warning here { return self.progress; } ... And the build log output: /Users/User1/Documents/Project

xcode LLVM 5.1 clang error

允我心安 提交于 2019-12-18 01:17:12
问题 I am having no luck the last few days since Xcode 5.1 came out. I keep getting this error on an old project that supports iOS 6.0: ERROR: clang: error: unknown argument: '-fno-obj-arc' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to a warning) in the future Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1 There are not many posts about this on the

Is there a llvm java front end that converts java source to llvm's intermediate form?

本秂侑毒 提交于 2019-12-17 23:30:01
问题 From what I've read, there is a llvm program that converts java bytecode to llvm's intermediate form called class2llvm. My question is, how do I access this. What front end do I have to install in order to access this. VMkit is their implementation of a JVM, but I am looking for how to compile the java source code with llvm, not how to run it. 回答1: The Java frontend translates Java bytecode (.class files) into LLVM bytecode. Take a look at this link: https://llvm.org/svn/llvm-project/java

Parsing and Modifying LLVM IR code

只谈情不闲聊 提交于 2019-12-17 22:43:03
问题 I want to read (parse) LLVM IR code (which is saved in a text file) and add some of my own code to it. I need some example of doing this, that is, how this is done by using the libraries provided by LLVM for this purpose. So basically what I want is to read in the IR code from a text file into the memory (perhaps the LLVM library represents it in AST form, I dont know), make modifications, like adding some more nodes in the AST and then finally write back the AST in the IR text file. Although

Call LLVM Jit from c program

允我心安 提交于 2019-12-17 22:08:20
问题 I have generated a bc file with the online compiler on llvm.org, and I would like to know if it is possible to load this bc file from a c or c++ program, execute the IR in the bc file with the llvm jit (programmatically in the c program), and get the results. How can I accomplish this? 回答1: Here's some working code based on Nathan Howell's: #include <string> #include <memory> #include <iostream> #include <llvm/LLVMContext.h> #include <llvm/Target/TargetSelect.h> #include <llvm/Bitcode

Include object file or assembler file in C Project?

风格不统一 提交于 2019-12-17 21:35:21
问题 I am playing around a bit bit with Microsofts ELL library/compiler to deploy a simple learning algorithm to a micro controller. But my knowledge regarding embedded development has been better in the past. The Problem is the following: ELL creates an LLVM IR file and a C Header file from a CNTK machine learning model (There are no pure c/c++ files). So far so good. Now I can use the IR to tell llc to make an assembler or object file for the desired target from it (ARM Cortex M4 in my case). So

Does LLVM convert Objective-C methods to inline functions?

强颜欢笑 提交于 2019-12-17 19:38:03
问题 Does LLVM automatically convert Objective-C methods to inline functions when possible? (I.e., is it just as performant to create an Objective-C method for a block of code that you could otherwise paste inline?) If LLVM doesn't perform this optimization, why not? If it does, (a) are there certain build settings I must set for this to happen? (b) How can I tell if an Objective-C method will be inlined? 回答1: No, because its impossible to know in the context of the Obj-C runtime if those kind of