[LLVMdev] hash_map issues with Visual Studio

Chris Lattner sabre at nondot.org
Mon Oct 25 12:29:05 PDT 2004


On Mon, 25 Oct 2004, Morten Ofstad wrote:
> I have spent some time examining the llvm code now, and it seems most of
>   the hash_maps are keyed with pointers, and a few with ints. There is
> also one place where the keys are std::string. All these are
> unproblematic with the Visual Studio std_ext::hash_map since it provides
> hash_value functions for all these types (note, it hashes char * as
> pointers, not as strings - but char * is not used as a key anywhere in
> LLVM).

Ok.

> This means that although the way of adding your own hashing
> functions is different, the default implementation works for 99% of all
> the cases and the ADT/HashExtras.h file is not necessary.

Cute. :)

> BUT there is one place where llvm defines it's own hashing function, in
> include/llvm/Target/TargetSchedInfo.h
...
> however, it seems the OpCodePair class is never used - and specifically
> never used for hash keys. Should this code be deleted?

Yes, it appears to be dead.  I nuked it here:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041025/019816.html

> I would like some input on these issues before submitting a patch. This
>   is the last issue remaining before the core of LLVM compiles
> unmodified with Visual C...

Very very nice!

-Chris

-- 
http://llvm.org/
http://nondot.org/sabre/




More information about the llvm-dev mailing list