<div dir="ltr"><br><div>That works as a charm. Thanks a lot Michael!</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 26, 2018 at 3:59 PM Michael Kruse <<a href="mailto:llvm@meinersbur.de">llvm@meinersbur.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
you should be able to get an IndentifierInfo for "default" using<br>
IdentifierTable::get(StringRef). You get an IdentifierTable object<br>
from ASTContext::Idents (public field).<br>
<br>
Michael<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Am Mo., 26. Nov. 2018 um 10:04 Uhr schrieb Lingda Li via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>:<br>
><br>
> Hi!<br>
><br>
><br>
> I just encountered this problem when implementing a new feature in OpenMP 5.0, which is called user defined mapper (the details of this feature are irrelevant to this question).<br>
><br>
><br>
> I need to build a NamedDecl. In some cases, programs will provide a name. In these cases, I will use the token of the name to get the corresponding DeclarationName from ASTContect::DeclarationNames, which will be used to initiate the NamedDecl I want.<br>
><br>
> The code is like:<br>
><br>
> DeclarationName ID = Actions.getASTContext().DeclarationNames.getIdentifier(Tok.getIdentifierInfo());<br>
><br>
><br>
> In other cases, programs do not provide a name, and the name should be the keyword "default" in these cases. No "default" token is available from the preprocessor in these cases so the previous method does not work.<br>
><br>
><br>
> My question is, in the later cases, how do I create a DeclarationName with the name "default", so that I can create the NamedDecl later? Any feedback will be much appreciated!<br>
><br>
><br>
> Thanks a lot,<br>
><br>
><br>
> Lingda Li<br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>