2009-11-18 14:59:57 +00:00
|
|
|
//===--- HeaderSearchOptions.h ----------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H
|
|
|
|
#define LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H
|
|
|
|
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
|
|
|
namespace frontend {
|
|
|
|
/// IncludeDirGroup - Identifiers the group a include entry belongs to, which
|
|
|
|
/// represents its relative positive in the search list.
|
|
|
|
enum IncludeDirGroup {
|
|
|
|
Quoted = 0, ///< `#include ""` paths. Thing `gcc -iquote`.
|
|
|
|
Angled, ///< Paths for both `#include ""` and `#include <>`. (`-I`)
|
|
|
|
System, ///< Like Angled, but marks system directories.
|
|
|
|
After ///< Like System, but searched after the system directories.
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/// HeaderSearchOptions - Helper class for storing options related to the
|
|
|
|
/// initialization of the HeaderSearch object.
|
|
|
|
class HeaderSearchOptions {
|
|
|
|
public:
|
|
|
|
struct Entry {
|
|
|
|
std::string Path;
|
|
|
|
frontend::IncludeDirGroup Group;
|
|
|
|
unsigned IsUserSupplied : 1;
|
|
|
|
unsigned IsFramework : 1;
|
2010-09-17 15:54:40 +00:00
|
|
|
|
|
|
|
/// IsSysRootRelative - This is true if an absolute path should be treated
|
|
|
|
/// relative to the sysroot, or false if it should always be the absolute
|
|
|
|
/// path.
|
|
|
|
unsigned IsSysRootRelative : 1;
|
|
|
|
|
|
|
|
Entry(llvm::StringRef path, frontend::IncludeDirGroup group,
|
|
|
|
bool isUserSupplied, bool isFramework, bool isSysRootRelative)
|
|
|
|
: Path(path), Group(group), IsUserSupplied(isUserSupplied),
|
|
|
|
IsFramework(isFramework), IsSysRootRelative(isSysRootRelative) {}
|
2009-11-18 14:59:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/// If non-empty, the directory to use as a "virtual system root" for include
|
|
|
|
/// paths.
|
|
|
|
std::string Sysroot;
|
|
|
|
|
|
|
|
/// User specified include entries.
|
|
|
|
std::vector<Entry> UserEntries;
|
|
|
|
|
2011-02-20 13:06:31 +00:00
|
|
|
/// If non-empty, the list of C++ standard include paths to use.
|
|
|
|
std::vector<std::string> CXXSystemIncludes;
|
|
|
|
|
2009-11-18 14:59:57 +00:00
|
|
|
/// A (system-path) delimited list of include paths to be added from the
|
|
|
|
/// environment following the user specified includes (but prior to builtin
|
|
|
|
/// and standard includes). This is parsed in the same manner as the CPATH
|
|
|
|
/// environment variable for gcc.
|
|
|
|
std::string EnvIncPath;
|
|
|
|
|
|
|
|
/// Per-language environmental include paths, see \see EnvIncPath.
|
|
|
|
std::string CEnvIncPath;
|
|
|
|
std::string ObjCEnvIncPath;
|
|
|
|
std::string CXXEnvIncPath;
|
|
|
|
std::string ObjCXXEnvIncPath;
|
|
|
|
|
2009-12-15 18:49:47 +00:00
|
|
|
/// The directory which holds the compiler resource files (builtin includes,
|
|
|
|
/// etc.).
|
|
|
|
std::string ResourceDir;
|
|
|
|
|
|
|
|
/// Include the compiler builtin includes.
|
|
|
|
unsigned UseBuiltinIncludes : 1;
|
2009-11-18 14:59:57 +00:00
|
|
|
|
|
|
|
/// Include the system standard include search directories.
|
|
|
|
unsigned UseStandardIncludes : 1;
|
|
|
|
|
2010-04-02 08:55:10 +00:00
|
|
|
/// Include the system standard C++ library include search directories.
|
|
|
|
unsigned UseStandardCXXIncludes : 1;
|
|
|
|
|
2009-11-18 14:59:57 +00:00
|
|
|
/// Whether header search information should be output as for -v.
|
|
|
|
unsigned Verbose : 1;
|
|
|
|
|
|
|
|
public:
|
2009-11-19 09:00:00 +00:00
|
|
|
HeaderSearchOptions(llvm::StringRef _Sysroot = "/")
|
2009-12-15 18:49:47 +00:00
|
|
|
: Sysroot(_Sysroot), UseBuiltinIncludes(true),
|
2010-04-02 08:55:10 +00:00
|
|
|
UseStandardIncludes(true), UseStandardCXXIncludes(true),
|
|
|
|
Verbose(false) {}
|
2009-11-18 14:59:57 +00:00
|
|
|
|
|
|
|
/// AddPath - Add the \arg Path path to the specified \arg Group list.
|
|
|
|
void AddPath(llvm::StringRef Path, frontend::IncludeDirGroup Group,
|
2010-09-17 15:54:40 +00:00
|
|
|
bool IsUserSupplied, bool IsFramework, bool IsSysRootRelative) {
|
|
|
|
UserEntries.push_back(Entry(Path, Group, IsUserSupplied, IsFramework,
|
|
|
|
IsSysRootRelative));
|
2009-11-18 14:59:57 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace clang
|
|
|
|
|
|
|
|
#endif
|