Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index b78e9f5..f6aa264 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -1200,8 +1200,11 @@ unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc,
if (isInvalid(Loc, Invalid)) return 0;
return getPresumedLoc(Loc).getColumn();
}
-
-#ifdef __SSE2__
@dberlin
dberlin / main.cpp
Created February 4, 2016 23:15 — forked from leegao/main.cpp
quadtrees
// simple test run
#include "quadtree.h"
int main(){
quadtree<int>* tree = new quadtree(rectangle(0, 0, 100, 100)); // initialize a quadtree occupying the square with size 100
// blah blah tree->insert(integer, x, y);
// we need to get the list of all points in a particular region
std::list<qdatum<int>> list = tree->to_list(region);
static void
compute_dominance_frontiers_1 (bitmap_head *frontiers)
{
edge p;
edge_iterator ei;
basic_block b;
FOR_EACH_BB_FN (b, cfun)
{
if (EDGE_COUNT (b->preds) >= 2)
{
@dberlin
dberlin / probe.nc
Last active May 9, 2023 05:04
gcode for wincnc that finds the center of a circle
G90
G92
[X probing]
L210X [Switch low limit on X axis]
[The m28 and g31 on the next line make WinCNC stop when the limit switch is hit instead of aborting like it normally would)
l91 G1X-10 M28 G31 F30 [probe 10 inches in the negative X direction till we trigger the probe]
l212 [switch limits back]
l1 N28 V{AP0} [store current absolute position to register 28]
l91g0X0.05 [back off a little]
diff --git a/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h b/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h
index 4905a90..4a9849a 100644
--- a/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h
+++ b/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h
@@ -7,6 +7,9 @@
#ifndef RETDEC_LLVMIR2HLL_GRAPHS_CFG_CFG_TRAVERSAL_H
#define RETDEC_LLVMIR2HLL_GRAPHS_CFG_CFG_TRAVERSAL_H
+#include <unordered_map>
+#include <unordered_set>
diff --git a/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h b/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h
index 4905a90..4a9849a 100644
--- a/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h
+++ b/include/retdec/llvmir2hll/graphs/cfg/cfg_traversal.h
@@ -7,6 +7,9 @@
#ifndef RETDEC_LLVMIR2HLL_GRAPHS_CFG_CFG_TRAVERSAL_H
#define RETDEC_LLVMIR2HLL_GRAPHS_CFG_CFG_TRAVERSAL_H
+#include <unordered_map>
+#include <unordered_set>
@dberlin
dberlin / main.rs
Created March 20, 2023 13:38
Crashing example
#![feature(asm_experimental_arch)]
#![feature(naked_functions)]
#![feature(type_alias_impl_trait)]
#![no_std]
#![no_main]
use arr_macro::arr;
use esp32s3_hal::{
clock::{ClockControl, CpuClock},
peripherals::Peripherals,
< 1><0x0000626b> DW_TAG_typedef
DW_AT_type <0x0000627a>
DW_AT_name p_acc0_cpu0_impl_hid18_v5_t
DW_AT_decl_file 0x00000017 /AppleInternal/Library/BuildRoots/8a51e4ad-7e8b-11ee-8cd8-2a65a1af8551/Applications/Xcode
.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.Internal.sdk/usr/local/include/EmbeddedHeaders/soc/module/p_acc0_v5.h
DW_AT_decl_line 0x000775ab
< 1><0x0000627a> DW_TAG_union_type
DW_AT_name _p_acc0_cpu0_impl_hid18_v5
DW_AT_byte_size 8
DW_AT_decl_file 0x00000017 /AppleInternal/Library/BuildRoots/8a51e4ad-7e8b-11ee-8cd8-2a65a1af8551/Applications/Xcode
-- Define infinity.
local INF = math.huge
-- The Floyd–Warshall algorithm.
local function floydWarshall(dist)
local n = #dist
-- For each intermediate node k.
for k = 1, n do
local dk = dist[k] -- local reference to row k (for performance)
for i = 1, n do