summaryrefslogtreecommitdiffstats
path: root/clang/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-16 18:05:08 +0000
committerChris Lattner <sabre@nondot.org>2006-07-16 18:05:08 +0000
commit351050bcf58f4d9b2b1006c146bc4ea56414b5de (patch)
tree515340784c9483f06e28b2c1bfaa43140f8625ea /clang/Basic/SourceManager.cpp
parente1954ac1a3da4e21306b8cfc41416301872cad01 (diff)
downloadbcm5719-llvm-351050bcf58f4d9b2b1006c146bc4ea56414b5de.tar.gz
bcm5719-llvm-351050bcf58f4d9b2b1006c146bc4ea56414b5de.zip
Add a check that the physloc for a macro instantiation is not another macro.
llvm-svn: 38722
Diffstat (limited to 'clang/Basic/SourceManager.cpp')
-rw-r--r--clang/Basic/SourceManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/Basic/SourceManager.cpp b/clang/Basic/SourceManager.cpp
index ce5e5f776d0..c37a2c36565 100644
--- a/clang/Basic/SourceManager.cpp
+++ b/clang/Basic/SourceManager.cpp
@@ -115,6 +115,10 @@ unsigned SourceManager::createFileID(const InfoRec *File,
/// InstantiationLoc.
SourceLocation SourceManager::getInstantiationLoc(SourceLocation PhysLoc,
SourceLocation InstantLoc) {
+ assert(getFIDInfo(PhysLoc.getFileID())->IDType !=
+ SrcMgr::FileIDInfo::MacroExpansion &&
+ "Location instantiated in a macro?");
+
// Resolve InstantLoc down to a real logical location.
InstantLoc = getLogicalLoc(InstantLoc);
OpenPOWER on IntegriCloud