[cfe-commits] r116544 - /cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp

Douglas Gregor dgregor at apple.com
Thu Oct 14 17:05:18 PDT 2010


On Oct 14, 2010, at 5:01 PM, Dan Gohman wrote:

> Author: djg
> Date: Thu Oct 14 19:01:39 2010
> New Revision: 116544
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=116544&view=rev
> Log:
> Add a TBAA type for pointer types.
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp?rev=116544&r1=116543&r2=116544&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp Thu Oct 14 19:01:39 2010
> @@ -77,6 +77,10 @@
>     }
>   }
> 
> +  // For now, treat all pointers as equivalent to each other.
> +  if (Ty->isPointerType())
> +    return MetadataCache[Ty] = getTBAAInfoForNamedType("TBAA.pointer", Char);
> +

Basing TBAA info on strings seems... brittle. Perhaps you want to create a TBAA metedata builder of some sort, which has a simple C++ interface hiding the various strings behind it?

	- Doug





More information about the cfe-commits mailing list