[cfe-commits] r72671 - /cfe/trunk/lib/CodeGen/Mangle.cpp

Anders Carlsson andersca at mac.com
Sun May 31 13:19:23 PDT 2009


Author: andersca
Date: Sun May 31 15:19:23 2009
New Revision: 72671

URL: http://llvm.org/viewvc/llvm-project?rev=72671&view=rev
Log:
Don't try to call getFileCharacteristic if the function declaration has an invalid source location (as is the case for the global allocation functions.

Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=72671&r1=72670&r2=72671&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Sun May 31 15:19:23 2009
@@ -93,8 +93,9 @@
              !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))





More information about the cfe-commits mailing list