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: unassignedclangb...@nondot.org
          Reporter: jas...@jawset.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to