Skip to content

Instantly share code, notes, and snippets.

View Bigcheese's full-sized avatar

Michael Spencer Bigcheese

View GitHub Profile
@Bigcheese
Bigcheese / gist:2772395
Created May 22, 2012 23:45
Clang/LLD tblegen option parser
class Parser;
class String<list<string> values> : Parser {
list<string> Values = values;
}
class Multiple<list<Parser> parsers> : Parser {
list<Parser> Parsers = parsers;
}
@Bigcheese
Bigcheese / Minecraft Login Protocol Version 14 ab
Created June 3, 2012 06:19 — forked from ShaRose/Minecraft Login Protocol Version 14 ab
My additions to: Old proposition for an update to the login handling system for Minecraft utilizing public key cryptography and user login certificates.
Roles: (They are all standard names for this kind of thing but why not)
Alice (The end user / the minecraft client software)
Bob (The Minecraft Server the user wants to connect to)
Trent (The Minecraft.net Server)
Eve (The hacker who is trying to impersonate Alice and connect to Bob)
Before anything happens, Alice generates an RSA Keypair and both Alice and Bob get a verified copy of Trent's public key wrapped in a certificate with full chain of trust signatures resolved which is also fully valid for login.minecraft.net.
Alice's public key will be known as APK.
class Tool {
// The list of all possible prefixes. Not every option in the tool has all
// prefixes. Any string that does not begin with one of these prefixes and is
// not an argument to a previous option is considered an input. A string that
// does begin with a prefix but is not a known option is eligeble for
// typo-correction.
}
def value;
def flag;
3>C:\Users\mspencer\Projects\llvm-project\llvm\tools\llvm-cltest\llvm-cltest.cpp(129): error C2678: binary '[' : no operator found which takes a left-hand operand of type 'const `anonymous-namespace'::Argument::ValueMap' (or there is no acceptable conversion)
3> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\map(173): could be 'std::basic_string<_Elem,_Traits,_Alloc> &std::map<_Kty,_Ty>::operator [](unsigned int &&)'
3> with
3> [
3> _Elem=char,
3> _Traits=std::char_traits<char>,
3> _Alloc=std::allocator<char>,
3> _Kty=unsigned int,
3> _Ty=std::string
3> ]
CompileC /Users/michael/Library/Developer/Xcode/DerivedData/Mumble-bqwivkngditwrxdqcqxbdkzyfpaz/Build/Intermediates/Mumble.build/Debug-iphoneos/Mumble.build/Objects-normal/armv7/MUWelcomeScreenPad.o Source/Classes/MUWelcomeScreenPad.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/michael/Projects/mumble-ios
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -gdwarf-2 -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribu
unsigned char BitReverse(unsigned char val, unsigned char bits) {
unsigned char result = 0;
unsigned char i;
for (i = 0; i < bits; ++i) {
result += ((val >> (bits - i - 1)) & 1) << i;
}
return result;
}
@Bigcheese
Bigcheese / gist:3125973
Created July 16, 2012 23:56
lld task deps
digraph G
{
Qualcom -> {"GNU ld" Hexagon ELF}
Apple -> {ld64 ARM X86 MachO}
Sony -> {"GNU ld" ARM ELF}
Google -> {"GNU ld" ARM X86 ELF}
FreeBSD -> {"GNU ld" X86 ELF}
Driver -> "Option Parser"
"GNU ld" -> {Driver "lld-core"}
LLVM Command Line Library
I'm proposing a heavy weight command line parsing and generating library for
LLVM to replace Clang's parser and provide one for lld.
The scope of this library is slightly larger than what Clang has now.
It is centered around the concept of a Tool. A Tool has a set of Options which
can be parsed to Arguments or rendered from Arguments. It also has a set of
Transformations that convert Arguments from another Tool to Arguments for
/*
* esm-format.bt
*
* Michael Spencer <[email protected]>
*
* This is a 010 Editor script for parsing Fallout 3 esm/esp files. It does not
* fully parse sub records or compressed records.
*
*/
struct SubRecord(uint32 size) {
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/usr/bin/gcc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/mspencer/Projects/llvm-project/build/llvm/release-ninja/CMakeFiles/CMakeTmp
Run Build Command:/usr/sbin/ninja cmTryCompileExec3862250347