Don't try to call getFileCharacteristic if the function declaration has an invalid source location (as is the case for the global allocation functions.

llvm-svn: 72671
This commit is contained in:
Anders Carlsson 2009-05-31 20:19:23 +00:00
parent 2418712039
commit 0955f20473
1 changed files with 3 additions and 2 deletions

View File

@ -93,8 +93,9 @@ bool CXXNameMangler::mangleFunctionDecl(const FunctionDecl *FD) {
!Context.getLangOptions().CPlusPlus ||
// "main" is not mangled in C++
FD->isMain() ||
// No mangling in an "implicit extern C" header.
Context.getSourceManager().getFileCharacteristic(FD->getLocation())
// No mangling in an "implicit extern C" header.
(FD->getLocation().isValid() &&
Context.getSourceManager().getFileCharacteristic(FD->getLocation()))
== SrcMgr::C_ExternCSystem ||
// No name mangling in a C linkage specification.
isInCLinkageSpecification(FD))