summaryrefslogtreecommitdiffstats
path: root/clang/AST/Decl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-21 23:09:50 +0000
committerChris Lattner <sabre@nondot.org>2007-01-21 23:09:50 +0000
commitec040b1d895c83d111185b766c02705db5367da2 (patch)
tree7ef04db88d4317b7d2e44f594aa460fffb90f557 /clang/AST/Decl.cpp
parent2e89ebbcc85541d0fa2c5896ad9d4879b8701483 (diff)
downloadbcm5719-llvm-ec040b1d895c83d111185b766c02705db5367da2.tar.gz
bcm5719-llvm-ec040b1d895c83d111185b766c02705db5367da2.zip
make Decl::getName() not crash if the decl is unnamed (e.g. an unnamed argument)
llvm-svn: 39260
Diffstat (limited to 'clang/AST/Decl.cpp')
-rw-r--r--clang/AST/Decl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/AST/Decl.cpp b/clang/AST/Decl.cpp
index ff19dd1f073..7bad5a1102b 100644
--- a/clang/AST/Decl.cpp
+++ b/clang/AST/Decl.cpp
@@ -21,7 +21,9 @@ Decl::~Decl() {
}
const char *Decl::getName() const {
- return getIdentifier()->getName();
+ if (const IdentifierInfo *II = getIdentifier())
+ return II->getName();
+ return "";
}
OpenPOWER on IntegriCloud