zcov: / include/clang/Frontend/HeaderSearchOptions.h


Files: 1 Branches Taken: 0.0% 0 / 0
Generated: 2010-02-10 01:31 Branches Executed: 0.0% 0 / 0
Line Coverage: 100.0% 9 / 9


Programs: 7 Runs 11951


       1                 : //===--- HeaderSearchOptions.h ----------------------------------*- C++ -*-===//
       2                 : //
       3                 : //                     The LLVM Compiler Infrastructure
       4                 : //
       5                 : // This file is distributed under the University of Illinois Open Source
       6                 : // License. See LICENSE.TXT for details.
       7                 : //
       8                 : //===----------------------------------------------------------------------===//
       9                 : 
      10                 : #ifndef LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H
      11                 : #define LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H
      12                 : 
      13                 : #include "llvm/ADT/StringRef.h"
      14                 : #include <vector>
      15                 : 
      16                 : namespace clang {
      17                 : 
      18                 : namespace frontend {
      19                 :   /// IncludeDirGroup - Identifiers the group a include entry belongs to, which
      20                 :   /// represents its relative positive in the search list.
      21                 :   enum IncludeDirGroup {
      22                 :     Quoted = 0,     ///< `#include ""` paths. Thing `gcc -iquote`.
      23                 :     Angled,         ///< Paths for both `#include ""` and `#include <>`. (`-I`)
      24                 :     System,         ///< Like Angled, but marks system directories.
      25                 :     After           ///< Like System, but searched after the system directories.
      26                 :   };
      27                 : }
      28                 : 
      29                 : /// HeaderSearchOptions - Helper class for storing options related to the
      30                 : /// initialization of the HeaderSearch object.
      31             2532: class HeaderSearchOptions {
      32                 : public:
      33               15:   struct Entry {
      34                 :     std::string Path;
      35                 :     frontend::IncludeDirGroup Group;
      36                 :     unsigned IsUserSupplied : 1;
      37                 :     unsigned IsFramework : 1;
      38                 : 
      39                 :     Entry(llvm::StringRef _Path, frontend::IncludeDirGroup _Group,
      40                5:           bool _IsUserSupplied, bool _IsFramework)
      41                 :       : Path(_Path), Group(_Group), IsUserSupplied(_IsUserSupplied),
      42                5:         IsFramework(_IsFramework) {}
      43                 :   };
      44                 : 
      45                 :   /// If non-empty, the directory to use as a "virtual system root" for include
      46                 :   /// paths.
      47                 :   std::string Sysroot;
      48                 : 
      49                 :   /// User specified include entries.
      50                 :   std::vector<Entry> UserEntries;
      51                 : 
      52                 :   /// A (system-path) delimited list of include paths to be added from the
      53                 :   /// environment following the user specified includes (but prior to builtin
      54                 :   /// and standard includes). This is parsed in the same manner as the CPATH
      55                 :   /// environment variable for gcc.
      56                 :   std::string EnvIncPath;
      57                 : 
      58                 :   /// Per-language environmental include paths, see \see EnvIncPath.
      59                 :   std::string CEnvIncPath;
      60                 :   std::string ObjCEnvIncPath;
      61                 :   std::string CXXEnvIncPath;
      62                 :   std::string ObjCXXEnvIncPath;
      63                 : 
      64                 :   /// The directory which holds the compiler resource files (builtin includes,
      65                 :   /// etc.).
      66                 :   std::string ResourceDir;
      67                 : 
      68                 :   /// Include the compiler builtin includes.
      69                 :   unsigned UseBuiltinIncludes : 1;
      70                 : 
      71                 :   /// Include the system standard include search directories.
      72                 :   unsigned UseStandardIncludes : 1;
      73                 : 
      74                 :   /// Whether header search information should be output as for -v.
      75                 :   unsigned Verbose : 1;
      76                 : 
      77                 : public:
      78             2532:   HeaderSearchOptions(llvm::StringRef _Sysroot = "/")
      79                 :     : Sysroot(_Sysroot), UseBuiltinIncludes(true),
      80             2532:       UseStandardIncludes(true), Verbose(false) {}
      81                 : 
      82                 :   /// AddPath - Add the \arg Path path to the specified \arg Group list.
      83                 :   void AddPath(llvm::StringRef Path, frontend::IncludeDirGroup Group,
      84                5:                bool IsUserSupplied, bool IsFramework) {
      85                5:     UserEntries.push_back(Entry(Path, Group, IsUserSupplied, IsFramework));
      86                5:   }
      87                 : };
      88                 : 
      89                 : } // end namespace clang
      90                 : 
      91                 : #endif

Generated: 2010-02-10 01:31 by zcov