<div dir="ltr">Hi to all,<br><br>Given the following code:<br><i><br>typedef struct {<br> int x;<br> int y;<br>} MyStruct;<br><br>....<br><br>int foo(MyStruct s) ...</i><br><br><br>I want to get the type of the parameter s.<br>
In case the typedef appears in the main file, I have no problem and paramVarDecl->getType().getAsString() return "MyStruct".<br>But when I put the typedef in a header and include it in the main file, paramVarDecl->getType().getAsString() returns "int" for some reason.<br>
<br>This is how I initialize the Header Search related objects:<br><br> <i> // Apply header search<br> _hsOpts->UseStandardIncludes = true;<br> _hsOpts->UseBuiltinIncludes = true;<br> _hsOpts->UseStandardCXXIncludes = true;<br>
<br> // TODO Add user header search directories (I_dirs) ???<br><br> llvm::Triple triple(_tarOpts.Triple);<br> ApplyHeaderSearchOptions(*_hs, *_hsOpts, _langOpts, triple);<br><br> // For searching and including Headers into the source files we are analyzing<br>
InitializePreprocessor(*_pp, *_ppOpts, *_hsOpts, *_fendOpts);<br></i><br><br clear="all">Am I missing something here?<br><br><br>Thanks in advance,<br>Ilya<br><br>-- <br><div dir="ltr">Best Regards,<br>Ilya Mirsky<br>
<a href="http://www.cs.bgu.ac.il/%7Emirskyil" target="_blank">www.cs.bgu.ac.il/~mirskyil</a><br></div><br>
</div>