[LLVMdev] source code for llvm

Zhongxing Xu xuzhongxing at gmail.com
Sun Dec 20 03:27:18 PST 2009


Cast -1 to a pointer to StringMapEntryBase. -1 is an integer with all
bits being 1.
I have to say if you don't even understand this, just DO NOT try to
rewrite clang in C.

2009/12/20 shines_tao <shines_tao at 126.com>:
>
> i don't understand the source code :
> static StringMapEntryBase *getTombstoneVal() {
>     return (StringMapEntryBase*)-1;
>   }     at "include\llvm\adt\stingmaph"  at line 116.
> "(StringMapEntryBase*)-1" is it the cast or something other? why there is a
> * after class StringMapEntryBase?
> thank you ~~
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list