Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
package funsets | |
import common._ | |
/** | |
* 2. Purely Functional Sets. | |
*/ | |
object FunSets { | |
/** | |
* We represent a set by its characteristic function, i.e. |
To remove a submodule you need to:
#include <iostream> | |
#include <sstream> | |
#include <functional> | |
#include <vector> | |
template <typename T, typename U> | |
U foldLeft(const std::vector<T>& data, | |
const U& initialValue, | |
const std::function<U(U,T)>& foldFn) { | |
typedef typename std::vector<T>::const_iterator Iterator; |
if(GlobalVariable* GA = M.getGlobalVariable("llvm.global.annotations")) { | |
// the first operand holds the metadata | |
for (Value *AOp : GA->operands()) { | |
// all metadata are stored in an array of struct of metadata | |
if (ConstantArray *CA = dyn_cast<ConstantArray>(AOp)) { | |
// so iterate over the operands | |
for (Value *CAOp : CA->operands()) { | |
// get the struct, which holds a pointer to the annotated function | |
// as first field, and the annotation as second field | |
if (ConstantStruct *CS = dyn_cast<ConstantStruct>(CAOp)) { |
Author: Chris Lattner
What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.
In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.
Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th
What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.
In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.
Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th
var LABEL_NAME = 'inbox-holding' | |
// Each time must have the format 'HOUR:MINUTE' | |
var schedule = [['13:00', '17:00'], // Sunday | |
['9:30', '13:00', '17:00'], // Monday | |
['9:30', '13:00', '17:00'], // Tuesday | |
['9:30', '13:00', '17:00'], // Wednesday | |
['9:30', '13:00', '17:00'], // Thursday | |
['9:30', '13:00', '17:00'], // Friday | |
['8:00', '13:00', '17:00']]; // Saturday |