[LLVMdev] More Encoding Ideas
Reid Spencer
reid at x10sys.com
Fri Aug 20 14:14:14 PDT 2004
I mis-spoke when I said ..
> I don't think that happens today. We handle string constants (as opposed
> to character constants) separately and they are always written as a
> length followed by the characters in the string.
Actually, they're written as a type slot number (from which the array length is
derived), followed by the character data in the string.
and another goof ..
> Again, I'm not sure what you're getting at here. Have a look at the
> function outputConstantStrings in lib/Bytecode/Writer/Writer.cpp.
> Strings currently occupy the "void" type plane, plane 0 (which is a bit
> of a hack), but we write out the type slot number (index), then the
> character data, then a terminating null (0) byte.
There's no terminating null byte. The length is inferred from the array type.
Sorry for the inaccuracies .. I shouldn't rely on memory so much :)
Reid.
More information about the llvm-dev
mailing list