cxloc::translateSourceLocation() (thus causing all clients of this
function to have the same behavior).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107101
91177308-0d34-0410-b5e6-
96231b3b80d8
static_cast<const FileEntry *>(file),
line, column);
- return SLoc.isInvalid() ?
- clang_getNullLocation() :
- cxloc::translateSourceLocation(CXXUnit->getASTContext(), SLoc);
+ return cxloc::translateSourceLocation(CXXUnit->getASTContext(), SLoc);
}
CXSourceRange clang_getNullRange() {
static inline CXSourceLocation
translateSourceLocation(const SourceManager &SM, const LangOptions &LangOpts,
SourceLocation Loc) {
+ if (Loc.isInvalid())
+ clang_getNullLocation();
+
CXSourceLocation Result = { { (void*) &SM, (void*) &LangOpts, },
Loc.getRawEncoding() };
return Result;