class Stmt;
class ASTContext;
class SourceLocation;
+
+namespace idx {
class ASTLocation;
+}
/// ProcessWarningOptions - Initialize the diagnostic client and process the
/// warning options specified on the command line.
/// Pointing at '100' will return a <VarDecl 'foo', IntegerLiteral '100'> pair.
/// Pointing at '++foo' will return a <FunctionDecl 'f', UnaryOperator> pair.
///
-ASTLocation ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc);
+idx::ASTLocation ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc);
} // end namespace clang
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_AST_ASTLOCATION_H
-#define LLVM_CLANG_AST_ASTLOCATION_H
+#ifndef LLVM_CLANG_INDEX_ASTLOCATION_H
+#define LLVM_CLANG_INDEX_ASTLOCATION_H
#include <cassert>
class Decl;
class Stmt;
+namespace idx {
+
/// \brief Represents a Decl or a Stmt and its immediate Decl parent. It's
/// immutable.
class ASTLocation {
void print(llvm::raw_ostream &OS);
};
+} // namespace idx
+
} // namespace clang
#endif
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_AST_DECLREFERENCEMAP_H
-#define LLVM_CLANG_AST_DECLREFERENCEMAP_H
+#ifndef LLVM_CLANG_INDEX_DECLREFERENCEMAP_H
+#define LLVM_CLANG_INDEX_DECLREFERENCEMAP_H
-#include "clang/AST/ASTLocation.h"
+#include "clang/Index/ASTLocation.h"
#include <map>
namespace clang {
class ASTContext;
class NamedDecl;
+
+namespace idx {
/// \brief Maps NamedDecls with the ASTLocations that reference them.
///
private:
mutable MapTy Map;
};
+
+} // end idx namespace
} // end clang namespace
//===----------------------------------------------------------------------===//
#include "clang/Frontend/Utils.h"
-#include "clang/AST/ASTLocation.h"
+#include "clang/Index/ASTLocation.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Lex/Lexer.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/Support/Compiler.h"
using namespace clang;
+using namespace idx;
namespace {
-//===--- ASTLocation.h - A <Decl, Stmt> pair --------------------*- C++ -*-===//
+//===--- ASTLocation.cpp - A <Decl, Stmt> pair ------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#include "clang/AST/ASTLocation.h"
+#include "clang/Index/ASTLocation.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/Expr.h"
using namespace clang;
+using namespace idx;
static bool isContainedInStatement(Stmt *Node, Stmt *Parent) {
assert(Node && Parent && "Passed null Node or Parent");
-//===--- DeclReferenceMap.h - Map Decls to their references -----*- C++ -*-===//
+//===--- DeclReferenceMap.cpp - Map Decls to their references ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#include "clang/AST/DeclReferenceMap.h"
+#include "clang/Index/DeclReferenceMap.h"
+#include "clang/Index/ASTLocation.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Stmt.h"
-#include "clang/AST/ASTLocation.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include "llvm/Support/Compiler.h"
using namespace clang;
+using namespace idx;
namespace {
#include "clang/Index/IndexProvider.h"
#include "clang/Index/Entity.h"
#include "clang/Index/TranslationUnit.h"
+#include "clang/Index/ASTLocation.h"
+#include "clang/Index/DeclReferenceMap.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/Utils.h"
#include "clang/Frontend/CommandLineSourceLoc.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
-#include "clang/AST/ASTLocation.h"
-#include "clang/AST/DeclReferenceMap.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/Support/CommandLine.h"