diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-19 09:00:00 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-19 09:00:00 +0000 |
commit | f5bd02d290ff15268853e0456c130a1afa15e907 (patch) | |
tree | c7f5a7b6fd212399d821b83b22c1e6a42e8c4a0d /include/clang/Frontend | |
parent | b3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (diff) |
Notes
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/CompileOptions.h | 77 | ||||
-rw-r--r-- | include/clang/Frontend/HeaderSearchOptions.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/InitHeaderSearch.h | 98 | ||||
-rw-r--r-- | include/clang/Frontend/InitPreprocessor.h | 79 | ||||
-rw-r--r-- | include/clang/Frontend/ManagerRegistry.h | 53 |
5 files changed, 2 insertions, 309 deletions
diff --git a/include/clang/Frontend/CompileOptions.h b/include/clang/Frontend/CompileOptions.h deleted file mode 100644 index ad53a8d592ba6..0000000000000 --- a/include/clang/Frontend/CompileOptions.h +++ /dev/null @@ -1,77 +0,0 @@ -//===--- CompileOptions.h ---------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the CompileOptions interface. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_FRONTEND_COMPILEOPTIONS_H -#define LLVM_CLANG_FRONTEND_COMPILEOPTIONS_H - -#include <string> -#include <vector> - -namespace clang { - -/// CompileOptions - Track various options which control how the code -/// is optimized and passed to the backend. -class CompileOptions { -public: - enum InliningMethod { - NoInlining, // Perform no inlining whatsoever. - NormalInlining, // Use the standard function inlining pass. - OnlyAlwaysInlining // Only run the always inlining pass. - }; - - unsigned OptimizationLevel : 3; /// The -O[0-4] option specified. - unsigned OptimizeSize : 1; /// If -Os is specified. - unsigned DebugInfo : 1; /// Should generate deubg info (-g). - unsigned UnitAtATime : 1; /// Unused. For mirroring GCC - /// optimization selection. - unsigned SimplifyLibCalls : 1; /// Should standard library calls be - /// treated specially. - unsigned UnrollLoops : 1; /// Control whether loops are unrolled. - unsigned VerifyModule : 1; /// Control whether the module - /// should be run through the LLVM Verifier. - unsigned TimePasses : 1; /// Set when -ftime-report is enabled. - unsigned NoCommon : 1; /// Set when -fno-common or C++ is enabled. - unsigned DisableRedZone : 1; /// Set when -mno-red-zone is enabled. - unsigned NoImplicitFloat : 1; /// Set when -mno-implicit-float is enabled. - unsigned MergeAllConstants : 1; // Merge identical constants. - - /// Inlining - The kind of inlining to perform. - InliningMethod Inlining; - - /// CPU - An optional CPU to target. - std::string CPU; - - /// Features - A list of subtarget features to pass to the code - /// generator. - std::vector<std::string> Features; - -public: - CompileOptions() { - OptimizationLevel = 0; - OptimizeSize = 0; - DebugInfo = 0; - UnitAtATime = 1; - SimplifyLibCalls = UnrollLoops = 0; - VerifyModule = 1; - TimePasses = 0; - NoCommon = 0; - Inlining = NoInlining; - DisableRedZone = 0; - NoImplicitFloat = 0; - MergeAllConstants = 1; - } -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Frontend/HeaderSearchOptions.h b/include/clang/Frontend/HeaderSearchOptions.h index 2edc7e1f4ab43..67129775ac8d0 100644 --- a/include/clang/Frontend/HeaderSearchOptions.h +++ b/include/clang/Frontend/HeaderSearchOptions.h @@ -72,8 +72,8 @@ public: unsigned Verbose : 1; public: - HeaderSearchOptions(llvm::StringRef _Sysroot = "") - : Sysroot(_Sysroot), UseStandardIncludes(true) {} + HeaderSearchOptions(llvm::StringRef _Sysroot = "/") + : Sysroot(_Sysroot), UseStandardIncludes(true), Verbose(false) {} /// AddPath - Add the \arg Path path to the specified \arg Group list. void AddPath(llvm::StringRef Path, frontend::IncludeDirGroup Group, diff --git a/include/clang/Frontend/InitHeaderSearch.h b/include/clang/Frontend/InitHeaderSearch.h deleted file mode 100644 index 48c4268252624..0000000000000 --- a/include/clang/Frontend/InitHeaderSearch.h +++ /dev/null @@ -1,98 +0,0 @@ -//===--- InitHeaderSearch.h - Initialize header search paths ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the InitHeaderSearch class. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_FRONTEND_INIT_HEADER_SEARCH_H_ -#define LLVM_CLANG_FRONTEND_INIT_HEADER_SEARCH_H_ - -#include "clang/Lex/DirectoryLookup.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/ADT/Triple.h" -#include <string> -#include <vector> - -namespace clang { - -class HeaderSearch; -class LangOptions; - -/// InitHeaderSearch - This class makes it easier to set the search paths of -/// a HeaderSearch object. InitHeaderSearch stores several search path lists -/// internally, which can be sent to a HeaderSearch object in one swoop. -class InitHeaderSearch { - std::vector<DirectoryLookup> IncludeGroup[4]; - HeaderSearch& Headers; - bool Verbose; - std::string isysroot; - -public: - /// InitHeaderSearch::IncludeDirGroup - Identifies the several search path - /// lists stored internally. - 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. - }; - - InitHeaderSearch(HeaderSearch &HS, - bool verbose = false, const std::string &iSysroot = "") - : Headers(HS), Verbose(verbose), isysroot(iSysroot) {} - - /// AddPath - Add the specified path to the specified group list. - void AddPath(const llvm::StringRef &Path, IncludeDirGroup Group, - bool isCXXAware, bool isUserSupplied, - bool isFramework, bool IgnoreSysRoot = false); - - /// AddEnvVarPaths - Add a list of paths from an environment variable to a - /// header search list. - void AddEnvVarPaths(const char *Name); - - /// AddGnuCPlusPlusIncludePaths - Add the necessary paths to suport a gnu - /// libstdc++. - void AddGnuCPlusPlusIncludePaths(const std::string &Base, const char *Dir32, - const char *Dir64, - const llvm::Triple &triple); - - /// AddMinGWCPlusPlusIncludePaths - Add the necessary paths to suport a MinGW - /// libstdc++. - void AddMinGWCPlusPlusIncludePaths(const std::string &Base, - const char *Arch, - const char *Version); - - /// AddDefaultEnvVarPaths - Adds list of paths from default environment - /// variables such as CPATH. - void AddDefaultEnvVarPaths(const LangOptions &Lang); - - // AddDefaultCIncludePaths - Add paths that should always be searched. - void AddDefaultCIncludePaths(const llvm::Triple &triple); - - // AddDefaultCPlusPlusIncludePaths - Add paths that should be searched when - // compiling c++. - void AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple); - - // AddDefaultFrameworkIncludePaths - Add the framework paths. Used on darwin. - void AddDefaultFrameworkIncludePaths(const llvm::Triple &triple); - - /// AddDefaultSystemIncludePaths - Adds the default system include paths so - /// that e.g. stdio.h is found. - void AddDefaultSystemIncludePaths(const LangOptions &Lang, - const llvm::Triple &triple); - - /// Realize - Merges all search path lists into one list and send it to - /// HeaderSearch. - void Realize(); -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Frontend/InitPreprocessor.h b/include/clang/Frontend/InitPreprocessor.h deleted file mode 100644 index 415acea79a26c..0000000000000 --- a/include/clang/Frontend/InitPreprocessor.h +++ /dev/null @@ -1,79 +0,0 @@ -//===--- InitPreprocessor.h - InitializePreprocessor function. --*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the clang::InitializePreprocessor function. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_FRONTEND_INIT_PREPROCESSOR_H_ -#define LLVM_CLANG_FRONTEND_INIT_PREPROCESSOR_H_ - -#include <string> -#include <vector> - -namespace clang { - -class Preprocessor; -class LangOptions; - -/// PreprocessorInitOptions - This class is used for passing the various -/// options used in preprocessor initialization to InitializePreprocessor(). -class PreprocessorInitOptions { - std::vector<std::pair<std::string, bool/*isUndef*/> > Macros; - std::vector<std::pair<std::string, bool/*isPTH*/> > Includes; - std::vector<std::string> MacroIncludes; - - unsigned UsePredefines : 1; /// Initialize the preprocessor with the compiler - /// and target specific predefines. - -public: - PreprocessorInitOptions() : UsePredefines(true) {} - - bool getUsePredefines() const { return UsePredefines; } - void setUsePredefines(bool Value) { - UsePredefines = Value; - } - - void addMacroDef(const std::string &Name) { - Macros.push_back(std::make_pair(Name, false)); - } - void addMacroUndef(const std::string &Name) { - Macros.push_back(std::make_pair(Name, true)); - } - void addInclude(const std::string &Name, bool isPTH = false) { - Includes.push_back(std::make_pair(Name, isPTH)); - } - void addMacroInclude(const std::string &Name) { - MacroIncludes.push_back(Name); - } - - typedef std::vector<std::pair<std::string, - bool> >::const_iterator macro_iterator; - macro_iterator macro_begin() const { return Macros.begin(); } - macro_iterator macro_end() const { return Macros.end(); } - - typedef std::vector<std::pair<std::string, - bool> >::const_iterator include_iterator; - include_iterator include_begin() const { return Includes.begin(); } - include_iterator include_end() const { return Includes.end(); } - - typedef std::vector<std::string>::const_iterator imacro_iterator; - imacro_iterator imacro_begin() const { return MacroIncludes.begin(); } - imacro_iterator imacro_end() const { return MacroIncludes.end(); } -}; - -/// InitializePreprocessor - Initialize the preprocessor getting it and the -/// environment ready to process a single file. -/// -void InitializePreprocessor(Preprocessor &PP, - const PreprocessorInitOptions& InitOptions); - -} // end namespace clang - -#endif diff --git a/include/clang/Frontend/ManagerRegistry.h b/include/clang/Frontend/ManagerRegistry.h deleted file mode 100644 index f05cfe6df6b8d..0000000000000 --- a/include/clang/Frontend/ManagerRegistry.h +++ /dev/null @@ -1,53 +0,0 @@ -//===-- ManagerRegistry.h - Pluggable analyzer module registry --*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the ManagerRegistry and Register* classes. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_FRONTEND_MANAGER_REGISTRY_H -#define LLVM_CLANG_FRONTEND_MANAGER_REGISTRY_H - -#include "clang/Analysis/PathSensitive/GRState.h" - -namespace clang { - -/// ManagerRegistry - This class records manager creators registered at -/// runtime. The information is communicated to AnalysisManager through static -/// members. Better design is expected. - -class ManagerRegistry { -public: - static StoreManagerCreator StoreMgrCreator; - static ConstraintManagerCreator ConstraintMgrCreator; -}; - -/// RegisterConstraintManager - This class is used to setup the constraint -/// manager of the static analyzer. The constructor takes a creator function -/// pointer for creating the constraint manager. -/// -/// It is used like this: -/// -/// class MyConstraintManager {}; -/// ConstraintManager* CreateMyConstraintManager(GRStateManager& statemgr) { -/// return new MyConstraintManager(statemgr); -/// } -/// RegisterConstraintManager X(CreateMyConstraintManager); - -class RegisterConstraintManager { -public: - RegisterConstraintManager(ConstraintManagerCreator CMC) { - assert(ManagerRegistry::ConstraintMgrCreator == 0 - && "ConstraintMgrCreator already set!"); - ManagerRegistry::ConstraintMgrCreator = CMC; - } -}; - -} -#endif |