[cfe-dev] DeclarationName and the StringRef.

Umesh Kalappa via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 4 19:59:51 PST 2017


Thank you Eli for the your suggestion  and we are trying at clang AST level
,since we are supporting through pragma directive.

Umesh

On Dec 21, 2016 4:34 PM, "Umesh Kalappa" <umesh.kalappa0 at gmail.com> wrote:

Hi Guys ,

We have the function that accepts StringRef and construct
the DeclarationName instance .

Currenlty we are achieving the same as ,the code snap

void appendExtern(StringRef Sr)
{
 char *ExternChar = const_cast<char *> (Sr.data());
 *Ptr =reinterpret_cast<void *>(ExternChar);

  this->ExternName = DeclarationName::getFromOpaquePtr(Ptr);

}

There is, any better way of achieving this  ,because the above code is
crashing intermittently ?

Thank you  and any help here appreciated.
~Umesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170105/49955573/attachment.html>


More information about the cfe-dev mailing list