[cfe-commits] r39260 - /cfe/cfe/trunk/AST/Decl.cpp

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:42:06 PDT 2007


Author: sabre
Date: Wed Jul 11 11:42:06 2007
New Revision: 39260

URL: http://llvm.org/viewvc/llvm-project?rev=39260&view=rev
Log:
make Decl::getName() not crash if the decl is unnamed (e.g. an unnamed argument)

Modified:
    cfe/cfe/trunk/AST/Decl.cpp

Modified: cfe/cfe/trunk/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Decl.cpp?rev=39260&r1=39259&r2=39260&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Decl.cpp (original)
+++ cfe/cfe/trunk/AST/Decl.cpp Wed Jul 11 11:42:06 2007
@@ -21,7 +21,9 @@
 }
 
 const char *Decl::getName() const {
-  return getIdentifier()->getName();
+  if (const IdentifierInfo *II = getIdentifier())
+    return II->getName();
+  return "";
 }
 
 





More information about the cfe-commits mailing list