aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-05-31 20:19:23 +0000
committerAnders Carlsson <andersca@mac.com>2009-05-31 20:19:23 +0000
commit8c49911e6e52f490dcef7eb181f29cc95be8ba36 (patch)
tree2062ed77fa52942e4df60dde15b7e543089a2126 /lib/CodeGen/Mangle.cpp
parentfc27d268cb34cbb8d186c6ad7cc043d41581ce71 (diff)
Don't try to call getFileCharacteristic if the function declaration has an invalid source location (as is the case for the global allocation functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index c09a13a59f..6ee1223a00 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/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))