diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-01-21 23:09:50 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-01-21 23:09:50 +0000 |
| commit | ec040b1d895c83d111185b766c02705db5367da2 (patch) | |
| tree | 7ef04db88d4317b7d2e44f594aa460fffb90f557 /clang/AST/Decl.cpp | |
| parent | 2e89ebbcc85541d0fa2c5896ad9d4879b8701483 (diff) | |
| download | bcm5719-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.cpp | 4 |
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 ""; } |

