Skip to content

Instantly share code, notes, and snippets.

@jensb1
jensb1 / gist:69340306768ef40caa3310c296acf552
Created March 19, 2021 01:04
LLVM Orc v2 - loading separate file
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/CodeGen/CommandFlags.h"
#include "llvm/CodeGen/LinkAllCodegenComponents.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/ExecutionEngine/ObjectCache.h"
@jensb1
jensb1 / jit.cpp
Last active March 17, 2021 07:48
A simple LLVM 12 JIT test with optimizations working
orc: jit.cpp
clang++ -g -o $@ $^ $(shell llvm-config-12 --cxxflags --ldflags --system-libs --libs core)
@jensb1
jensb1 / gist:f33c8512b66dfdf4d84f55603a654a05
Last active March 13, 2021 10:32
Simple indent parser in Clojure
(ns analyze (:require
[clojure.string :refer [split starts-with? trim]]
[clojure.core :refer [tree-seq re-find]]))
(defn line-param [line]
(trim (str (second (re-find #"\s*(.*?):" (str line))))))
(defn line-value [line]
(trim (str (second (re-find #".*:(.*)" (str line))))))
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title>Components development</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<link rel='stylesheet' href='/public/global.css'/>