• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    C++
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Playing with Clang plugin system

ToyClangPlugin

Simple clang plugin. More details here

This plugin shows you a warning in case of class' name starts with lowercse letter and shows an error in case when class' name contains underscore (_).

As a bonus it proposes you a FixIt hints

Warning FixItHint Error FixItHint

Installation

Build llvm/clang from sources

cd /opt
sudo mkdir llvm
sudo chown `whoami` llvm
cd llvm
export LLVM_HOME=`pwd`

git clone -b release_33 https://github.com/llvm-mirror/llvm.git llvm
git clone -b release_33 https://github.com/llvm-mirror/clang.git llvm/tools/clang
git clone -b release_33 https://github.com/llvm-mirror/clang-tools-extra.git llvm/tools/clang/tools/extra
git clone -b release_33 https://github.com/llvm-mirror/compiler-rt.git llvm/projects/compiler-rt

mkdir llvm_build
cd llvm_build
cmake ../llvm -DCMAKE_BUILD_TYPE:STRING=Release
make -j`sysctl -n hw.logicalcpu`

Get the plugin copy

cd $LLVM_HOME
git clone https://github.com/AlexDenisov/ToyClangPlugin.git
cd ToyClangPlugin

Build the plugin

mkdir build; cd build
cmake -G Xcode ..
open ToyClangPlugin.xcodeproj

Download this archive, unzip and run following commands

sudo mv HackedClang.xcplugin `xcode-select -print-path`/../PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins
sudo mv HackedBuildSystem.xcspec `xcode-select -print-path`/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications

Open your project and pudate build settings:

  1. Select custom compiler

Custom compiler

  1. Disable modules

Disable modules

  1. Add OTHER_CFLAGS
-Xclang -load -Xclang /opt/llvm/toy_clang_plugin/build/lib/Debug/ToyClangPlugin.dylib -Xclang -add-plugin -Xclang ToyClangPlugin

Other C flags

That's it. Build and run you project.

More Repositories

1

FrameAccessor

Easy access to view's frame.
Objective-C
446
star
2

iActiveRecord

ActiveRecord for iOS without CoreData, only SQLite
C
355
star
3

FontasticIcons

ObjC wrapper for the iconic fonts.
Objective-C
299
star
4

bitcode_retriever

Retrieves Bitcode from Mach-O binaries
C
178
star
5

Vibro

Feel the network interaction
Objective-C
105
star
6

segment_dumper

Simple example of a Mach-O parser
C
103
star
7

xcconf

YAML-based configuration for ObjC projects
Objective-C
79
star
8

Fuzzer

Do not crash when your server lies
Objective-C
69
star
9

ModernStickies

Reverse Engineering Stickies.app
C
55
star
10

PrettyPasteboard

Converts plain JSON to a human readable format directly in pasteboard
Swift
39
star
11

Components

Systems are built from Components, not from Dependencies.
Makefile
26
star
12

cv

TeX
25
star
13

swift_llvm

How to use LLVM C API with Swift
Swift
24
star
14

sgl

SGL - Swift Generic Library. Highly inspired by C++ STL.
Swift
19
star
15

ToySwiftModule

Shows how to create and use pure Swift module
Swift
16
star
16

mutation-testing-poc

LLVM-based Mutation Testing System. Proof of concept
Objective-C
15
star
17

grape_doc

Ruby
13
star
18

LLVMTemplate

LLVM + Swift template Xcode project
Swift
12
star
19

SwiftKaleidoscope

Kaleidoscope language implemented in Swift.
Swift
8
star
20

mlir-tutorial

Terribly incorrect and incomplete AOT compiler for mRuby. Source code for the LLVM Social Berlin #20
C++
8
star
21

QuotePad

QuotePad that can be deployed on your server.
Ruby
7
star
22

QiOS

Set of Qt wrappers for native iOS stuff.
Objective-C
6
star
23

mbx

Supplementary material for my talk
LLVM
5
star
24

Tsuga

Set of helpers for pivotal/cedar
Objective-C
5
star
25

guard-calabash-ios

Guard gem for calabash-ios
Ruby
5
star
26

bm_lint

Playing with libclang
C
4
star
27

alexdenisov.github.io

Blog
HTML
4
star
28

mutation-lab

Some experiments related to https://github.com/mull-project/mull
C++
4
star
29

tdd_calc

Cedar/Calabash example for iOS.
Objective-C
3
star
30

LeafBridge

Madness!!1
Objective-C++
3
star
31

guard-frank

Guard gem for frank-cucumber
Ruby
3
star
32

ios_generate_settings

Generate settings manager Objective-C class from command ine
Ruby
3
star
33

Hasm

Assembler for http://www.nand2tetris.org
Objective-C
3
star
34

BindableTypes

Binding CocoaTouch controls to Foundation data types
Objective-C
2
star
35

dot_files

Vim Script
2
star
36

Cedar-installer

Useless from Aug 2012!!! Bash installation script for Cedar: BDD-style testing using Objective-C.
Shell
2
star
37

linux

Linux Kernel fork
C
1
star
38

articles

C
1
star