undecorated names as comment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

undecorated names as comment

Ivan Sorokin
Hi!

What do you think about possibility to write in .s files undecorated
names as comment before definition of function and call of function and
other references to function?

For example, instead of

define available_externally void @_ZNSt9basic_iosIcSt11char_traitsIcEED2Ev(%"class.std::basic_ios"* %this) nounwind align 2 {
entry:
  %0 = bitcast %"class.std::basic_ios"* %this to %"class.std::ios_base"* ; <%"class.std::ios_base"*> [#uses=1]
  call void @_ZNSt8ios_baseD2Ev(%"class.std::ios_base"* %0) nounwind
  ret void
}

write:

; std::basic_ios<char, std::char_traits<char> >::~basic_ios()
define available_externally void @_ZNSt9basic_iosIcSt11char_traitsIcEED2Ev(%"class.std::basic_ios"* %this) nounwind align 2 {
entry:
  %0 = bitcast %"class.std::basic_ios"* %this to %"class.std::ios_base"* ; <%"class.std::ios_base"*> [#uses=1]
  ; std::ios_base::~ios_base()
  call void @_ZNSt8ios_baseD2Ev(%"class.std::ios_base"* %0) nounwind
  ret void
}


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: undecorated names as comment

Chris Lattner

On Feb 8, 2010, at 12:51 PM, Ivan Sorokin wrote:

> Hi!
>
> What do you think about possibility to write in .s files undecorated
> names as comment before definition of function and call of function  
> and
> other references to function?

This would have to happen in the LLVM .ll printer which lives in  
VMCore, it is what prdouces this output.  I think a better solution is  
to just run the .ll file through c++filt, which will demangle them.

-Chris

>
> For example, instead of
>
> define available_externally void  
> @_ZNSt9basic_iosIcSt11char_traitsIcEED2Ev(%"class.std::basic_ios"*  
> %this) nounwind align 2 {
> entry:
>  %0 = bitcast %"class.std::basic_ios"* %this to  
> %"class.std::ios_base"* ; <%"class.std::ios_base"*> [#uses=1]
>  call void @_ZNSt8ios_baseD2Ev(%"class.std::ios_base"* %0) nounwind
>  ret void
> }
>
> write:
>
> ; std::basic_ios<char, std::char_traits<char> >::~basic_ios()
> define available_externally void  
> @_ZNSt9basic_iosIcSt11char_traitsIcEED2Ev(%"class.std::basic_ios"*  
> %this) nounwind align 2 {
> entry:
>  %0 = bitcast %"class.std::basic_ios"* %this to  
> %"class.std::ios_base"* ; <%"class.std::ios_base"*> [#uses=1]
>  ; std::ios_base::~ios_base()
>  call void @_ZNSt8ios_baseD2Ev(%"class.std::ios_base"* %0) nounwind
>  ret void
> }
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev