]> granicus.if.org Git - clang/commitdiff
Move ASTLocation and DeclReferenceMap from the AST library to the Index library.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Jul 2009 21:34:47 +0000 (21:34 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Jul 2009 21:34:47 +0000 (21:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74859 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/Utils.h
include/clang/Index/ASTLocation.h [moved from include/clang/AST/ASTLocation.h with 93% similarity]
include/clang/Index/DeclReferenceMap.h [moved from include/clang/AST/DeclReferenceMap.h with 92% similarity]
lib/Frontend/ResolveLocation.cpp
lib/Index/ASTLocation.cpp [moved from lib/AST/ASTLocation.cpp with 95% similarity]
lib/Index/DeclReferenceMap.cpp [moved from lib/AST/DeclReferenceMap.cpp with 95% similarity]
tools/index-test/index-test.cpp

index 3153e400ef5845dddef31b4838ef08c2154065b5..7845e8f7cf58956903711d8280595ec35a19589f 100644 (file)
@@ -36,7 +36,10 @@ class Decl;
 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.
@@ -103,7 +106,7 @@ void CacheTokens(Preprocessor& PP, llvm::raw_fd_ostream* OS);
 /// 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
 
similarity index 93%
rename from include/clang/AST/ASTLocation.h
rename to include/clang/Index/ASTLocation.h
index f6ace25ca7ce842719435ef7cdab6cdac71aa1a3..4404644e56285ba1b0555d15d623f3422db92046 100644 (file)
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#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>
 
@@ -24,6 +24,8 @@ namespace clang {
   class Decl;
   class Stmt;
 
+namespace idx {
+
 /// \brief Represents a Decl or a Stmt and its immediate Decl parent. It's
 /// immutable.
 class ASTLocation {
@@ -61,6 +63,8 @@ public:
   void print(llvm::raw_ostream &OS);
 };
 
+} // namespace idx
+
 } // namespace clang
 
 #endif
similarity index 92%
rename from include/clang/AST/DeclReferenceMap.h
rename to include/clang/Index/DeclReferenceMap.h
index 9dd5d47fef2cf7b16d057db353eeae97a7f6e86e..130ca387d5f42dc2f42550f83b1f88f4c144de6c 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#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.
 ///
@@ -76,6 +78,8 @@ public:
 private:
   mutable MapTy Map;
 };
+
+} // end idx namespace
   
 } // end clang namespace
 
index c2d32bbc90b46e6e45fe62cee9350c2749979709..9fbae30a485783f7a130685b0a096f6ed43623f6 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #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 {
 
similarity index 95%
rename from lib/AST/ASTLocation.cpp
rename to lib/Index/ASTLocation.cpp
index e72acf07935f8a0baea77a05ca69907108b6e03e..4b95d9d55429eea3576a1dd3acde4773ab1bdc82 100644 (file)
@@ -1,4 +1,4 @@
-//===--- 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");
similarity index 95%
rename from lib/AST/DeclReferenceMap.cpp
rename to lib/Index/DeclReferenceMap.cpp
index 41f53fdd524631175c57d218323a9b6b1f1c26e5..841d7fb2fb7914a8a3dd7d892bad53b41bb2da88 100644 (file)
@@ -1,4 +1,4 @@
-//===--- 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 {
 
index f44cd53b77f4cbe380b67d009257a12d33c04366..dd1ced45cefeafcdb9914e700be4fb0599572b33 100644 (file)
 #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"