[llvm-bugs] [Bug 26359] New: missing call to CompilerInstance::setAuxTarget in ASTUnit::Parse

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 28 12:26:40 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26359

            Bug ID: 26359
           Summary: missing call to CompilerInstance::setAuxTarget in
                    ASTUnit::Parse
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jascha at jawset.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15743
  --> https://llvm.org/bugs/attachment.cgi?id=15743&action=edit
patch to add setAuxTarget call to ASTUnit::Parse

I'm using libclang to parse CUDA sources via clang_parseTranslationUnit2, which
ends up calling ASTUnit::Parse. Unlike CompilerInstance::ExecuteAction
ASTUnit::Parse does not call setAuxTarget for the secondary target for CUDA
compilation. This results in several undeclared __builtin_ptx_* errors. Adding
the call resolves this.
Attached is a small patch for ASTUnit::Parse.

There are several other callers of CompilerInstance::setTarget (mostly in
ASTUnit.cpp) that don't call setAuxTarget either. Maybe the
setTarget/setAuxTarget call pair could be factored out into some sort of
setAllTargets call that all callers could use.
I don't know enough about the codebase to restructure this properly, though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160128/ec789b56/attachment.html>


More information about the llvm-bugs mailing list