diff options
author | Anders Carlsson <andersca@mac.com> | 2009-05-31 20:19:23 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-05-31 20:19:23 +0000 |
commit | 0955f20473eb18528612ac63e71543fd6dd4c890 (patch) | |
tree | fd7701caec8d49365980dfde755a1f1e1353faf3 /clang/lib/CodeGen/Mangle.cpp | |
parent | 24187120396136f3d61b14433b75e3c5fe44a316 (diff) | |
download | bcm5719-llvm-0955f20473eb18528612ac63e71543fd6dd4c890.tar.gz bcm5719-llvm-0955f20473eb18528612ac63e71543fd6dd4c890.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/Mangle.cpp')
-rw-r--r-- | clang/lib/CodeGen/Mangle.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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)) |