llvm

Is self.iVar necessary for strong properties with ARC?

丶灬走出姿态 提交于 2019-11-27 17:28:14
问题 If I declare a property strong, like so: @property (strong, nonatomic) UIView *iVar; When I'm setting it, does it matter if I do iVar = ... or self.iVar = ... ? It seems that with ARC, they do the same thing. If I only declare the instance variable (not the @property), e.g., BOOL selected , does that mean it's inferred to be __unsafe_unretained (since there's no property specifying it to be strong), or must I explicitly specify that? It seems like I may have answered my own questions above in

any C/C++ refactoring tool based on libclang? (even simplest “toy example” ) [closed]

被刻印的时光 ゝ 提交于 2019-11-27 16:59:51
As I've pointed out - here - it seems clang's libclang should be great for implementing the hard task that is C/C++ code analysis and modifications ( check out video presentation and slides ). Do you know of any C/C++ refactoring tool based on libclang ? "Any" includes even simple alpha state project, with support of one refactoristation technique. It can be without preprocessor support. As an example of the functionally about which I'm talking: changing method names, whether it supports multiple files or only one file at a time. You might be wondering what the goal is of asking for even small

How to embed LLVM assembly or intrinsics in C program with Clang?

核能气质少年 提交于 2019-11-27 16:26:51
问题 C compilers allows to embed assembly code in a C program. I am pretty sure that Clang should allow embedding LLVM assembly or intrinsic code in C program. How can I embed LLVM assembly in C code? 回答1: Right now you can't. You can, however, write an LLVM assembly function separately in its own file, mark it as alwaysinline , then compile it with the rest of your files - this should get you the same result. See this related question on how to first compile your C files to IR and then link them

llvm, clang 和 scan-build 的安装和使用

喜夏-厌秋 提交于 2019-11-27 15:56:49
使用 clang 编译 简单使用 clang 编译 clang 的 选项是 和 gcc 兼容的。所以最简单的用法就是: clang main.c 在 Makefile 中使用 clang 编译。 使用 $(CC) 或者 $(CXX) 可以通过 环境变量来选择 编译器。 这样可以方便的指定编译器。 main.c 内容: 用于测试 的 C 程序。 # include <stdio.h> int main ( int argc , char * * argv ) { int i ; i = 10 ; printf ( "%d\n" , i ) ; return 0 ; } Makefile 内容: 注意: Makefile 中,不用要 指定 CC 的具体实现。也就是说不要使用包含 CC=gcc , CC:=gcc 等的指令。 all: $(CC) main.c 设置 环境变量,指定编译器: 不设置 CC 。默认使用 cc 也就是 gcc: # compiling with cc (gcc) unset CC unset CXX make > cc main.c 设置 CC=gcc 。使用 gcc: # compiling with gcc export CC=gcc export CXX=g++ make > gcc main.c 设置 CC=clang 。使用 clang: #

iOS XCode compile error: unable to execute command: Segmentation fault: 11

只谈情不闲聊 提交于 2019-11-27 13:55:42
问题 I have a project which compiled perfectly in the past, but after the last xcode update (6.3.2) I get a compile error whenever I try to run it directly on a device. Building and Running it in the simulator works fine. The Archive function works fine as well. But no matter what device I connect or what iOS version the device is running, I always get the same compile error: Stack dump: 0. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System

Why am I getting the error: command 'llvm-gcc-4.2' failed with exit status 1

旧时模样 提交于 2019-11-27 13:13:11
问题 I am setting up os X 10.7. I am using the default install of Python: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ I use a Python based package manager called easy_install. Easy_install seems to not be able to find the compiler. EDIT: When I tried to install MySQL-python I got this error: $ sudo easy_install MySQL-python Password: Searching for MySQL-python Reading http://pypi.python.org/simple/MySQL-python/ Reading http://sourceforge.net/projects/mysql-python/ Reading http

Is it possible to debug a gcc-compiled program using lldb, or debug a clang-compiled program using gdb?

别说谁变了你拦得住时间么 提交于 2019-11-27 11:06:52
问题 (Preface: I'm pretty new to C/C++ and I don't really know how debugging in native code actually works.) Some sources say that gdb and lldb can debug any program compiled to machine code. Others say that to debug with gdb you must compile in gcc with the -g flag. The documentation for gcc itself suggests this is optional, and that in fact if you use it, it can cause problems for debuggers other than gdb. Clang also has a -g flag and the documentation basically just says "Generate debug

llvm ir back to human-readable source language?

隐身守侯 提交于 2019-11-27 10:51:40
问题 Is there an easy way of going from llvm ir to working source code? Specifically, I'd like to start with some simple C++ code that merely modifies PODs (mainly arrays of ints, floats, etc), convert it to llvm ir, perform some simple analysis and translation on it and then convert it back into C++ code? It don't really mind about any of the names getting mangled, I'd just like to be able to hack about with the source before doing the machine-dependent optimisations. 回答1: There is an issue here.

What can make C++ RTTI undesirable to use?

流过昼夜 提交于 2019-11-27 10:43:25
Looking at the LLVM documentation, they mention that they use "a custom form of RTTI" , and this is the reason they have isa<> , cast<> and dyn_cast<> templated functions. Usually, reading that a library reimplements some basic functionality of a language is a terrible code smell and just invites to run. However, this is LLVM we're talking of: the guys are working on a C++ compiler and a C++ runtime. If they don't know what they're doing, I'm pretty much screwed because I prefer clang to the gcc version that ships with Mac OS. Still, being less experienced than them, I'm left wondering what

Clang on Windows

二次信任 提交于 2019-11-27 10:34:02
问题 First of all, I've followed "Getting Started: Building and Running Clang". In particular, I've built it according to "Using Visual Studio" section. In other words, I've built it using Visual Studio 2010. Secondly, I've manually set include and library paths to MinGW distribution: The simple program I'm trying to compile: #include <iostream> using namespace std; int main() { cout << "Hello, World!" << endl; return 0; } I get the following feedback from the compiler: In file included from C: