[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
    Bushev Dmitry via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Jan 11 09:04:14 PST 2024
    
    
  
================
@@ -184,13 +205,59 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
     return getChar();
 
   // Handle pointers and references.
-  // TODO: Implement C++'s type "similarity" and consider dis-"similar"
-  // pointers distinct.
-  if (Ty->isPointerType() || Ty->isReferenceType())
-    return createScalarTypeNode("any pointer", getChar(), Size);
+  //
+  // In C11 for two pointer type to alias it is required for them to be
+  // compatible [section 6.5 p7].
----------------
dybv-sc wrote:
Great idea! Thanks for help with it. Added those comments.
https://github.com/llvm/llvm-project/pull/75177
    
    
More information about the llvm-commits
mailing list