[LLVMdev] ValueSymbolTable's mutators are private?

Samuel Crow samuraileumas at yahoo.com
Fri Jul 9 13:18:56 PDT 2010


Hi Chris,

I was thinking that CreateValueName() was the way to add a symbol to a symbol 
table.  Perhaps I'm thinking about this wrong.  Here's what I've got:

I've got a string generated by the parser which is constant.  I need to add it 
to the symbol table so that, on starting the second pass of my compiler, I can 
dump all of the string constants to be generated as code.  I have a name, a type 
(ConstantStruct since the length is stored internally to the structure), and no 
place to put it.  I thought that since the Module created by my compiler has a 
symbol table, I could generate it as a global.  I already have a reverse-lookup 
StringMap allocated to get the name on the second pass.  Should I just make 
another StringMap for all of my variable names and declared constants?  That 
seems to me what a symbol table is used for though.

--Sam

----- Original Message ----
> From: Chris Lattner <clattner at apple.com>
> To: Samuel Crow <samuraileumas at yahoo.com>
> Cc: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu>
> Sent: Fri, July 9, 2010 3:03:50 PM
> Subject: Re: [LLVMdev] ValueSymbolTable's mutators are private?
> 
> 
> On Jul 9, 2010, at 12:02 PM, Samuel Crow wrote:
> 
> > Hello,
> > 
> > Why are ValueSymbolTable's mutators all private?  I can't seem to  find a way 
>to 
>
> > add a symbol to the table without using one of  them.  It looks like a bug to 
>me 
>
> > since there is no way to use it  otherwise.
> 
> The mutators are things like Value::setName()
> 
> -Chris


      



More information about the llvm-dev mailing list