From 0955f20473eb18528612ac63e71543fd6dd4c890 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 31 May 2009 20:19:23 +0000 Subject: 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 --- clang/lib/CodeGen/Mangle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/Mangle.cpp') diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index c09a13a59f3..6ee1223a005 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -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)) -- cgit v1.2.3