[asan] make sure that linker-initialized globals (non-extern) are not instrumented...
[oota-llvm.git] / lib / Transforms / Instrumentation / BlackList.cpp
index 5b65ea664951d4d4ddb58085ae2992d7fb21dab9..e02c631f7f7a1bcf6dd6f524d5fded900fa1ad32 100644 (file)
@@ -97,8 +97,9 @@ static StringRef GetGVTypeString(const GlobalVariable &G) {
   // 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>";
 }