[llvm-commits] [llvm] r167729 - /llvm/trunk/lib/Transforms/Instrumentation/BlackList.cpp

Alexey Samsonov samsonov at google.com
Mon Nov 12 06:47:00 PST 2012


Author: samsonov
Date: Mon Nov 12 08:47:00 2012
New Revision: 167729

URL: http://llvm.org/viewvc/llvm-project?rev=167729&view=rev
Log:
[ASan] fixup for r167725: Don't fetch name of StructType if it is literal

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/BlackList.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/BlackList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/BlackList.cpp?rev=167729&r1=167728&r2=167729&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/BlackList.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/BlackList.cpp Mon Nov 12 08:47:00 2012
@@ -97,8 +97,9 @@
   // Types of GlobalVariables are always pointer types.
   Type *GType = G.getType()->getElementType();
   // For now we support blacklisting struct types only.
-  if (GType->isStructTy()) {
-    return GType->getStructName();
+  if (StructType *SGType = dyn_cast<StructType>(GType)) {
+    if (!SGType->isLiteral())
+      return SGType->getName();
   }
   return "<unknown type>";
 }





More information about the llvm-commits mailing list