is at the first token but that the location's offset is not inside the token as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133800
91177308-0d34-0410-b5e6-
96231b3b80d8
bool SourceManager::isAtStartOfMacroInstantiation(SourceLocation loc) const {
assert(loc.isValid() && loc.isMacroID() && "Expected a valid macro loc");
- unsigned FID = getFileID(loc).ID;
+ std::pair<FileID, unsigned> infoLoc = getDecomposedLoc(loc);
+ if (infoLoc.second > 0)
+ return false; // Does not point at the start of token.
+
+ unsigned FID = infoLoc.first.ID;
assert(FID > 1);
std::pair<SourceLocation, SourceLocation>
instRange = getImmediateInstantiationRange(loc);