<div dir="ltr">Hey all,<div><br></div><div>I've experienced some troubles using the Clang C++ API. If I am requesting assistance in the wrong place, if you could kindly point me to somewhere more appropriate, I'd appreciate it.</div>
<div><br></div><div>Firstly, I have been attempting to use the Sema class to perform name lookup. I have a very simple test case that declares one function, and then attempts to call it with the incorrect number of arguments. Clang emits the expected diagnostic, and even quotes the entire function declaration, so the name is clearly available, but the Sema instance insists that the name does not exist when I attempt to look it up.<div>
<br></div><div>I have pasted the relevant code here:</div><div><a href="http://pastebin.com/kFRdQF4M">http://pastebin.com/kFRdQF4M</a><br></div><div><br></div><div style>The IdentifierInfo, and the file and source information all check out in the debugger as far as I can tell. If you can identify any issues, I would much appreciate it.</div>
<div><br></div><div style>Secondly, I have been looking to produce files such as the main.cpp above as llvm::Module*. I intend to do things such as link it to other modules from other sources and add functions and such to this module. Whilst I have been able to cause Clang to write out the module in various formats to the drive, I was hoping instead to simply have the Module object. The public API doesn't appear to include such a function, so I was looking to use the CodeGenModule class from part of the implementation. Would this class be suitable for that purpose?</div>
</div><div style><br></div><div style>Thanks,</div><div style>DeadMG</div></div>