summaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/BlackList.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-11-12 14:47:00 +0000
committerAlexey Samsonov <samsonov@google.com>2012-11-12 14:47:00 +0000
commit1faf9be56923d4b877e52caeac3aabf6052962b1 (patch)
tree145fe9423161a6c50e9da72350f9141009c9ddfd /lib/Transforms/Instrumentation/BlackList.cpp
parent4c0ae9066fecbbd507162a880450641aa5c33098 (diff)
downloadllvm-1faf9be56923d4b877e52caeac3aabf6052962b1.tar.gz
llvm-1faf9be56923d4b877e52caeac3aabf6052962b1.tar.bz2
llvm-1faf9be56923d4b877e52caeac3aabf6052962b1.tar.xz
[ASan] fixup for r167725: Don't fetch name of StructType if it is literal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/BlackList.cpp')
-rw-r--r--lib/Transforms/Instrumentation/BlackList.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Instrumentation/BlackList.cpp b/lib/Transforms/Instrumentation/BlackList.cpp
index 5b65ea6649..e02c631f7f 100644
--- a/lib/Transforms/Instrumentation/BlackList.cpp
+++ b/lib/Transforms/Instrumentation/BlackList.cpp
@@ -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>";
}