From: Chris Lattner Date: Mon, 17 Dec 2007 08:22:46 +0000 (+0000) Subject: add headermap.cpp X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f441ab20ccd8d21fd3d034de866bfcaf6cb72b2;p=clang add headermap.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45095 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Lex/HeaderMap.cpp b/Lex/HeaderMap.cpp new file mode 100644 index 0000000000..5b9c4b0d23 --- /dev/null +++ b/Lex/HeaderMap.cpp @@ -0,0 +1,29 @@ +//===--- HeaderMap.cpp - A file that acts like dir of symlinks ------------===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Chris Lattner and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the HeaderMap interface. +// +//===----------------------------------------------------------------------===// + +#include "clang/Lex/HeaderMap.h" +using namespace clang; + +const HeaderMap *HeaderMap::Create(const FileEntry *FE, std::string &ErrorInfo){ + // FIXME: woot! + return 0; +} + +/// LookupFile - Check to see if the specified relative filename is located in +/// this HeaderMap. If so, open it and return its FileEntry. +const FileEntry *HeaderMap::LookupFile(const char *FilenameStart, + const char *FilenameEnd, + FileManager &FM) const { + // FIXME: this needs work. + return 0; +} diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index 649d1fd09e..cf12634213 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -83,6 +83,7 @@ DE6951C70C4D1F5D00A5826B /* RecordLayout.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE6951C60C4D1F5D00A5826B /* RecordLayout.h */; }; DE6954640C5121BD00A5826B /* Token.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE6954630C5121BD00A5826B /* Token.h */; }; DE704B260D0FBEBE009C7762 /* SemaDeclObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */; }; + DE704DD20D1668A4009C7762 /* HeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE704DD10D1668A4009C7762 /* HeaderMap.cpp */; }; DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE75ED280B044DC90020CF81 /* ASTContext.h */; }; DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE75EDF00B06880E0020CF81 /* Type.cpp */; }; DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B120C05659200231DA4 /* ModuleBuilder.cpp */; }; @@ -315,6 +316,7 @@ DE6954630C5121BD00A5826B /* Token.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = ""; }; DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclObjC.cpp; path = Sema/SemaDeclObjC.cpp; sourceTree = ""; }; DE704BD10D1647E7009C7762 /* HeaderMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderMap.h; sourceTree = ""; }; + DE704DD10D1668A4009C7762 /* HeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderMap.cpp; sourceTree = ""; }; DE75ED280B044DC90020CF81 /* ASTContext.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ASTContext.h; path = clang/AST/ASTContext.h; sourceTree = ""; }; DE75EDF00B06880E0020CF81 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = AST/Type.cpp; sourceTree = ""; }; DE928B120C05659200231DA4 /* ModuleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleBuilder.cpp; path = CodeGen/ModuleBuilder.cpp; sourceTree = ""; }; @@ -720,6 +722,7 @@ DED7D78C0A5242E6003AD0FB /* Lex */ = { isa = PBXGroup; children = ( + DE704DD10D1668A4009C7762 /* HeaderMap.cpp */, DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */, DED7D79E0A5242E6003AD0FB /* Lexer.cpp */, 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */, @@ -873,6 +876,7 @@ 3580CC0C0D072E5C00C5E4F4 /* LangOptions.cpp in Sources */, 353612DA0D075174002E3541 /* TranslationUnit.cpp in Sources */, DE704B260D0FBEBE009C7762 /* SemaDeclObjC.cpp in Sources */, + DE704DD20D1668A4009C7762 /* HeaderMap.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/include/clang/Lex/HeaderMap.h b/include/clang/Lex/HeaderMap.h index ffc665094e..48e00bf375 100644 --- a/include/clang/Lex/HeaderMap.h +++ b/include/clang/Lex/HeaderMap.h @@ -25,23 +25,19 @@ namespace clang { /// symlinks to files. Its advantages are that it is dense and more efficient /// to create and process than a directory of symlinks. class HeaderMap { + HeaderMap(const HeaderMap&); // DO NOT IMPLEMENT + void operator=(const HeaderMap&); // DO NOT IMPLEMENT public: /// HeaderMap::Create - This attempts to load the specified file as a header /// map. If it doesn't look like a HeaderMap, it gives up and returns null. /// If it looks like a HeaderMap but is obviously corrupted, it puts a reason /// into the string error argument and returns null. - static const HeaderMap *Create(const FileEntry *FE, std::string &ErrorInfo) { - // FIXME: woot! - return 0; - } + static const HeaderMap *Create(const FileEntry *FE, std::string &ErrorInfo); /// LookupFile - Check to see if the specified relative filename is located in /// this HeaderMap. If so, open it and return its FileEntry. const FileEntry *LookupFile(const char *FilenameStart,const char *FilenameEnd, - FileManager &FM) const { - // FIXME: this needs work. - return 0; - } + FileManager &FM) const; };