llvm/clang/tools/libclang/CXSourceLocation.cpp

//===- CXSourceLocation.cpp - CXSourceLocations APIs ------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines routines for manipulating CXSourceLocations.
//
//===----------------------------------------------------------------------===//

#include "CXSourceLocation.h"
#include "CIndexer.h"
#include "CLog.h"
#include "CXFile.h"
#include "CXLoadedDiagnostic.h"
#include "CXString.h"
#include "CXTranslationUnit.h"
#include "clang/Basic/FileManager.h"
#include "clang/Frontend/ASTUnit.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Format.h"

usingnamespaceclang;
usingnamespaceclang::cxindex;

//===----------------------------------------------------------------------===//
// Internal predicates on CXSourceLocations.
//===----------------------------------------------------------------------===//

static bool isASTUnitSourceLocation(const CXSourceLocation &L) {}

//===----------------------------------------------------------------------===//
// Basic construction and comparison of CXSourceLocations and CXSourceRanges.
//===----------------------------------------------------------------------===//

CXSourceLocation clang_getNullLocation() {}

unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2) {}

unsigned clang_isBeforeInTranslationUnit(CXSourceLocation loc1,
                                         CXSourceLocation loc2) {}

CXSourceRange clang_getNullRange() {}

CXSourceRange clang_getRange(CXSourceLocation begin, CXSourceLocation end) {}

unsigned clang_equalRanges(CXSourceRange range1, CXSourceRange range2) {}

int clang_Range_isNull(CXSourceRange range) {}
  
  
CXSourceLocation clang_getRangeStart(CXSourceRange range) {}

CXSourceLocation clang_getRangeEnd(CXSourceRange range) {}

//===----------------------------------------------------------------------===//
//  Getting CXSourceLocations and CXSourceRanges from a translation unit.
//===----------------------------------------------------------------------===//

CXSourceLocation clang_getLocation(CXTranslationUnit TU,
                                   CXFile file,
                                   unsigned line,
                                   unsigned column) {}
  
CXSourceLocation clang_getLocationForOffset(CXTranslationUnit TU,
                                            CXFile file,
                                            unsigned offset) {}

//===----------------------------------------------------------------------===//
// Routines for expanding and manipulating CXSourceLocations, regardless
// of their origin.
//===----------------------------------------------------------------------===//

static void createNullLocation(CXFile *file, unsigned *line,
                               unsigned *column, unsigned *offset) {}

static void createNullLocation(CXString *filename, unsigned *line,
                               unsigned *column, unsigned *offset = nullptr) {}

int clang_Location_isInSystemHeader(CXSourceLocation location) {}

int clang_Location_isFromMainFile(CXSourceLocation location) {}

void clang_getExpansionLocation(CXSourceLocation location,
                                CXFile *file,
                                unsigned *line,
                                unsigned *column,
                                unsigned *offset) {}

void clang_getPresumedLocation(CXSourceLocation location,
                               CXString *filename,
                               unsigned *line,
                               unsigned *column) {}

void clang_getInstantiationLocation(CXSourceLocation location,
                                    CXFile *file,
                                    unsigned *line,
                                    unsigned *column,
                                    unsigned *offset) {}

void clang_getSpellingLocation(CXSourceLocation location,
                               CXFile *file,
                               unsigned *line,
                               unsigned *column,
                               unsigned *offset) {}

void clang_getFileLocation(CXSourceLocation location,
                           CXFile *file,
                           unsigned *line,
                           unsigned *column,
                           unsigned *offset) {}