Stepan Dyatkovskiy
2011-Sep-08 11:23 UTC
[LLVMdev] [LLVM, llvm-mc, AsmParser] Symbol locations.
Hi everybody. I found that there are some problems with symbol location in AsmParser. 1. We need to know where symbol was declared. 2. We need to know where symbol was defined first time. There are two ways: 1. Add helper table to the parser with additional symbol info. But it takes additional memory consumption. 2. Add user tag (void*) for MCSymbol object. As I understood MCSymbol can live without asm sources, so we can't add info field directly. But the user tags is pretty common practice for this cases. So, what are you think about it? Stepan
Stepan Dyatkovskiy
2011-Sep-08 20:35 UTC
[LLVMdev] [LLVM, llvm-mc, AsmParser] Symbol locations.
Now I see, that its to so trivial as I thought before. There are a lots of parser extensions that creates the symbols. And in each place we need insert add its location info. I also found that MCContext has several create symbols methods, but all these methods uses CreateSymbol private method. So I see two possible ways here: 1. To aggregate all GetOrCreate-like symbol methods inside the AsmParser. So all asm parser extension like a COFFAsmParser should use aggregated methods instead of MCContext ones. And inside the aggregated methods we can add symbol location info. 2. Add create-symbol event to the MCContext. So each time when symbol will created by the MCContext::CreateSymbol this event will be fired. We can process this event by adding symbol location info to some AsmParser internal table for example. -- Stepan 08.09.2011, 15:23, "Stepan Dyatkovskiy" <STPWORLD at yandex.ru>:> Hi everybody. I found that there are some problems with symbol location in AsmParser. > 1. We need to know where symbol was declared. > 2. We need to know where symbol was defined first time. > > There are two ways: > 1. Add helper table to the parser with additional symbol info. But it takes additional memory consumption. > 2. Add user tag (void*) for MCSymbol object. As I understood MCSymbol can live without asm sources, so we can't add info field directly. But the user tags is pretty common practice for this cases. > > So, what are you think about it? > > Stepan > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Stepan Dyatkovskiy
2011-Sep-08 21:41 UTC
[LLVMdev] [LLVM, llvm-mc, AsmParser] Symbol locations.
I mean "not so trivial" sorry ) Stepan. 09.09.2011, 00:35, "Stepan Dyatkovskiy" <STPWORLD at narod.ru>:> Now I see, that its to so trivial as I thought before. There are a lots of parser extensions that creates the symbols. And in each place we need insert add its location info. I also found that MCContext has several create symbols methods, but all these methods uses CreateSymbol private method. > So I see two possible ways here: > 1. To aggregate all GetOrCreate-like symbol methods inside the AsmParser. So all asm parser extension like a COFFAsmParser should use aggregated methods instead of MCContext ones. And inside the aggregated methods we can add symbol location info. > 2. Add create-symbol event to the MCContext. So each time when symbol will created by the MCContext::CreateSymbol this event will be fired. We can process this event by adding symbol location info to some AsmParser internal table for example. > > -- > Stepan > > 08.09.2011, 15:23, "Stepan Dyatkovskiy" <STPWORLD at yandex.ru>: >> Hi everybody. I found that there are some problems with symbol location in AsmParser. >> 1. We need to know where symbol was declared. >> 2. We need to know where symbol was defined first time. >> >> There are two ways: >> 1. Add helper table to the parser with additional symbol info. But it takes additional memory consumption. >> 2. Add user tag (void*) for MCSymbol object. As I understood MCSymbol can live without asm sources, so we can't add info field directly. But the user tags is pretty common practice for this cases. >> >> So, what are you think about it? >> >> Stepan >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] [LLVM, llvm-mc, AsmParser] Symbol locations.
- [LLVMdev] make check-lit + grep escape characters
- [LLVMdev] How to force the creation of arrays with zeroes?
- [LLVMdev] make check-lit + grep escape characters
- [LLVMdev] Debug Info and MergeFunctions Transform