This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import lldb | |
def doit(dbg, cmd): | |
print('::', cmd) | |
dbg.HandleCommand(cmd) | |
def should_stop_stepping(process): | |
state = process.GetState() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Really doing llvm handler registration === | |
0 lldb 0x0000000107b0fe98 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 | |
1 lldb 0x0000000107b0f858 RegisterHandlers() + 328 | |
2 lldb 0x0000000107b04d3e llvm::EnablePrettyStackTrace() + 46 | |
3 lldb 0x0000000107b04103 llvm::InitLLVM::InitLLVM(int&, char const**&) + 147 | |
4 lldb 0x0000000107aeaa9f main + 47 | |
5 libdyld.dylib 0x00007fff722ba3d5 start + 1 | |
6 libdyld.dylib 0x000000000000000e start + 18446603338600700986 | |
=== (in lldb) Should have installed llvm handlers ^ === | |
=== (in lldb) Blocking SIGPIPE === |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OPT=$1 | |
shift 1 | |
TEST_FILE=$1 | |
shift 1 | |
strip_cmd() { | |
$OPT -disable-verify -strip -strip-dead-prototypes -strip-named-metadata -o - $* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test driver for https://reviews.llvm.org/D41149 | |
#include <cstdint> | |
#include <limits> | |
#include <iostream> | |
#include <vector> | |
// Instructions: | |
// - Compile this program with a baseline compiler and a patched compiler. | |
// - Check that the output of the two executables is the same. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void escape(void *p) { | |
asm volatile("" : : "g"(p) : "memory"); | |
} | |
static void clobber() { | |
asm volatile("" : : : "memory"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::mem; | |
use std::ops::{Deref, DerefMut}; | |
#[derive(Copy, Clone, Debug)] | |
struct Tagged<'a, T: 'a> { | |
pointer: &'a T | |
} | |
impl<'a, T> Tagged<'a, T> { | |
fn tag(&'a mut self) -> &'a mut Tagged<'a, T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
class AVLTree: | |
def __init__(self, data): | |
self.data = data | |
self.lhs = None | |
self.rhs = None | |
def insert(self, data): | |
if data == self.data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Find each struct's usage frequency in each subsystem. In each search, discard | |
# the files that have no matches, get rid of the directory prefix, only keep | |
# the subsystem, and then pipe the information out to a temporary file. Loop | |
# through every (Subsystem Of File, Count) tuple and sum up the contribution | |
# from each subsystem to that struct's frequency. | |
for line in $(cat structs.txt); do | |
echo ">"$line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define trigPin 13 | |
#define echoPin 12 | |
#define delayMilis 100 | |
/* 0: Noisy state. | |
* 1: You went below the low threshold. | |
* 2: You went above the low threshold. | |
* 3: You went above the high threshold. | |
* 4: You went below the high threshold, pushup done. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
void gray(int n, vector<string>& code) { | |
if (n == 1) { | |
code.push_back(string("0")); | |
code.push_back(string("1")); |
NewerOlder