yaxunl added inline comments.

================
Comment at: tools/libclang/CXType.cpp:402
+  ASTContext &Ctx = cxtu::getASTUnit(GetTU(CT))->getASTContext();
+  return Ctx.getTargetAddressSpace(T);
 }
----------------
arichardson wrote:
> yaxunl wrote:
> > Is this function suppose to return AST address space or target address 
> > space?
> > 
> > Some targets e.g. x86 maps all AST address spaces to 0. Returning target 
> > address space will not let the client unable to differentiate different 
> > address spaces in the source language.
> I am not entirely sure what the correct return value is here because the 
> current implementation returns either the LanguageAS or `LangAS - 
> LangAS::FirstTargetAddressSpace` which can also overlap. So possibly it 
> should just always returning the AST address space?
> 
> I think for now I will just keep the current behaviour with a FIXME and 
> create a followup patch.
> 
That's fine. Thanks.


https://reviews.llvm.org/D38816



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to