[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

Alex Voicu via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 17:57:28 PDT 2024


================
@@ -2216,7 +2216,7 @@ static llvm::Value *EmitTypeidFromVTable(CodeGenFunction &CGF, const Expr *E,
 }
 
 llvm::Value *CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) {
-  llvm::Type *PtrTy = llvm::PointerType::getUnqual(getLLVMContext());
+  llvm::Type *PtrTy = Int8PtrTy;
----------------
AlexVlx wrote:

It could be `GlobalsInt8PtrTy`, but the main roadblock would require something that @rjmccall suggested looking into, namely adding the ability to declare a default AS for a class type, which stdlib implementations could then re-use. Having said that, I've neither had the time to look into it, nor figured out if this would work in general, considering we need to compose with stdlib implementations other than libc++. Having said that, perhaps the TODO: should actually be at the end of the comment, and just say something along the lines of "investigate if it is possible to remove this limitation"?

https://github.com/llvm/llvm-project/pull/88182


More information about the llvm-commits mailing list