llvm

Is it possible to use NSArray, NSDictionary, and NSNumber “literals” in Xcode 4.3? (LLVM 4.0)

↘锁芯ラ 提交于 2019-12-01 05:26:18
Apparently, the new Objective-C literals have landed into the clang trunk , and thus lifted the shadowy veil of any NDA's. My question … HOW can I, in God's name , use these constructs (see below) in Xcode ⋜ v4.3. If not, and I'm stuck waiting for the XCode 4.4 / OSX 10.8 / LLVM 4.0 trifecta, could the same functionality be jerry-rigged somehow - via some clever categories, etc.? (For all y'all that don't know… these new syntaxes mean that there will be the much-appreciated additional constructs for creating NSArray, NSDictionary, and NSNumber .) I found a non-official way to do this… Using

Convert to ARC - LLVM compiler 3.0 Error

旧街凉风 提交于 2019-12-01 05:25:51
I opened up an older project of mine and chose Convert to Objective-C ARC from the Edit/Refactor menu. I am getting the following error: Apple LLVM compiler 3.0 Error Error in format of file: /Users/myUserName/Library/Developer/Xcode/DerivedData/ProjectName-fkjvtdsoypoyrdcedtarbtypupor/Build/Intermediates/ProjectName.build/Debug-iphoneos/ProjectName.build/ProjectName-arc.migrate/remap Is this one of those situations where I need to manually delete some files/folders in Finder and then try it again? I just deleted everything in the "Build" folder of the project, then did Product/Clean and tried

Call Python code from LLVM JIT

爱⌒轻易说出口 提交于 2019-12-01 05:14:29
I write a language lexer/parser/compiler in python, that should run in the LLVM JIT-VM (using llvm-py ) later. The first two steps are quite straightforward for now, but (even if I didn't start the compile-task yet) I see a problem, when my code wants to call Python-Code (in general), or interact with the Python lexer/parser/compiler (in special) respectively. My main concern is, that the code should be able to dynamically load additional code into the VM at runtime and thus it must trigger the whole lexer/parser/compiler-chain in Python from within the VM. First of all: Is this even possible,

Building and using a pass for LLVM 3.8 on OSX

不想你离开。 提交于 2019-12-01 04:56:47
问题 I'm trying to build and apply a pass on OSX using llvm 3.8. I installed llvm 3.8 using brew with this formula: $brew install llvm38 Inside the pass I have the following: static RegisterPass<SwiftPass> X("pass", "My Pass"); My Makefile to build the pass looks like this: LIB_NAME = pass$(SUFIX) LDFLAGS = $(shell $(LLVM_PATH)llvm-config --ldflags) CXXFLAGS = -g -Wall -fno-rtti -fPIC -std=c++11 -shared -dynamiclib $(shell $(LLVM_PATH)llvm-config --cxxflags --system-libs --libs core

Is it possible to use NSArray, NSDictionary, and NSNumber “literals” in Xcode 4.3? (LLVM 4.0)

怎甘沉沦 提交于 2019-12-01 04:40:22
问题 Apparently, the new Objective-C literals have landed into the clang trunk, and thus lifted the shadowy veil of any NDA's. My question … HOW can I, in God's name , use these constructs (see below) in Xcode ⋜ v4.3. If not, and I'm stuck waiting for the XCode 4.4 / OSX 10.8 / LLVM 4.0 trifecta, could the same functionality be jerry-rigged somehow - via some clever categories, etc.? (For all y'all that don't know… these new syntaxes mean that there will be the much-appreciated additional

Difference in stringstream behavior for void* type using libc++ and libstdc++

自古美人都是妖i 提交于 2019-12-01 04:25:46
The following test program returns different results depending on whether I'm using libc++ or libstdc++. #include <sstream> #include <iostream> int main() { int a = 0; void* optr = &a; void* iptr; std::stringstream ss; ss << optr; std::cout << ss.str() << '\n'; ss >> iptr; std::cout << iptr << '\n'; return 0; } I'm using the following version of clang from Xcode 5 on OSX 10.9.2 $ xcrun clang++ --version Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.1.0 Thread model: posix Here's the output of the test when built with libstdc++ and libc++ $ xcrun

What is proper LLVM header guard style?

家住魔仙堡 提交于 2019-12-01 04:17:40
问题 In clang tidy, the check [llvm-header-guard] looks for LLVM style header guards, but I can't find any examples of proper LLVM header guard style, specifically the structure of the name given to the define, the coding standards pages does not mention anything. 回答1: Looking at the unit tests: https://github.com/llvm-mirror/clang-tools-extra/blob/master/unittests/clang-tidy/LLVMModuleTest.cpp it seems to accept a few variations on the commonly used patterns. For a file named include/llvm/ADT/foo

Xcode 7 command failed due to signal: illegal instruction 4

时间秒杀一切 提交于 2019-12-01 04:07:10
I just used Xcode 7's migration tool to migrate a project from Swift 1.2 to 2. After fixing up errors missed and such, all is well except for an error which prevents me from even building: Command failed due to signal: illegal instruction 4. I have tried the help in these articles ( Xcode 7 and Swift 2.0 : Command failed due to signal: Abort trap: 6 , and Command failed due to signal: Abort trap: 6 ) which are not identical issues to mine, but nevertheless they were not able to fix the issue. I have cleaned the build and removed the derived data folder. I have up to date CocoaPods installation

LLVM - Run Own Pass automatically with clang

老子叫甜甜 提交于 2019-12-01 04:03:15
I wrote a few own passes for llvm, in order to use them with clang. I integrated them in llvm (not dynamically loaded). They are even listed in the Optimizations available: section when I type: opt --help-hidden I want to run one of own my passes now automatically as the last one when I call clang: clang ./hello.bc -o ./hello or even with c-code: clang ./hello.c -o ./hello When I run my pass with opt manually, the modified ByteCode is generated and written to a new .bc file: opt -my-pass < ./hello.bc > ./hello_optimized.bc When I compile the modified .bc with clang, normal clang Optimizations

Convert to ARC - LLVM compiler 3.0 Error

不问归期 提交于 2019-12-01 03:55:14
问题 I opened up an older project of mine and chose Convert to Objective-C ARC from the Edit/Refactor menu. I am getting the following error: Apple LLVM compiler 3.0 Error Error in format of file: /Users/myUserName/Library/Developer/Xcode/DerivedData/ProjectName-fkjvtdsoypoyrdcedtarbtypupor/Build/Intermediates/ProjectName.build/Debug-iphoneos/ProjectName.build/ProjectName-arc.migrate/remap Is this one of those situations where I need to manually delete some files/folders in Finder and then try it