Just define it. After the class definition but before the end of the anonymous namespace add this line:
DenseMap<Function*, DenseMap<Instruction*,Invariant*> > Invariant::Invariants;
This will create the static member in every translation unit that includes this header (that's okay because it's in the anonymous namespace, which is unique to each translation unit). That's probably not what you want, but that follows from defining Invariant
in an anonymous namespace. If you use a named namespace instead, you can put the definition of Invariants
into a source file and have only one object shared by all the code.