Displaying 3 results from an estimated 3 matches for "appendextern".
2016 Dec 21
2
DeclarationName and the StringRef.
...Question is ,
How do ,someone instantiate the DeclarationName instance using StringRef
,because in the current trunk code snap ,we see that the DeclarationName
can be constructed using the IdentifierInfo or Objc Selector or
CXXOperatorId etc as argument in the constructor .
The code i.e
void appendExtern(StringRef Sr)
{
char *ExternChar = const_cast<char *> (Sr.data());
*Ptr =reinterpret_cast<void *>(ExternChar);
this->ExternName = DeclarationName::getFromOpaquePtr(Ptr);
}
the above is kind of hack ,may result in dangling memory references ,Any
thoughts on this ?
we thought...
2016 Dec 21
0
DeclarationName and the StringRef.
...instantiate the DeclarationName instance using
> StringRef ,because in the current trunk code snap ,we see that
> the DeclarationName can be constructed using the IdentifierInfo or
> Objc Selector or CXXOperatorId etc as argument in the constructor .
>
> The code i.e
> void appendExtern(StringRef Sr)
> {
> char *ExternChar = const_cast<char *> (Sr.data());
> *Ptr =reinterpret_cast<void *>(ExternChar);
> this->ExternName = DeclarationName::getFromOpaquePtr(Ptr);
>
> }
>
> the above is kind of hack ,may result in dangling memory references...
2016 Dec 21
0
DeclarationName and the StringRef.
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 y...