[cfe-commits] r103716 - /cfe/trunk/tools/libclang/CIndex.cpp
Ted Kremenek
kremenek at apple.com
Thu May 13 08:38:38 PDT 2010
Author: kremenek
Date: Thu May 13 10:38:38 2010
New Revision: 103716
URL: http://llvm.org/viewvc/llvm-project?rev=103716&view=rev
Log:
Fold assertion into condition, as it does not hold all the time.
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=103716&r1=103715&r2=103716&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu May 13 10:38:38 2010
@@ -2489,10 +2489,9 @@
if (TypeSourceInfo *TI = DD->getTypeSourceInfo()) {
TypeLoc TL = TI->getTypeLoc();
SourceLocation TLoc = TL.getFullSourceRange().getBegin();
- if (TLoc.isValid()) {
- assert(SrcMgr.isBeforeInTranslationUnit(TLoc, L));
+ if (TLoc.isValid() &&
+ SrcMgr.isBeforeInTranslationUnit(TLoc, L))
cursorRange.setBegin(TLoc);
- }
}
}
}
More information about the cfe-commits
mailing list