typedef long unsigned int size_t; extern "C" { extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlen (__const char *__s) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); } namespace std __attribute__ ((__visibility__ ("default"))) { template class allocator; template struct char_traits; template, typename _Alloc = allocator<_CharT> > class basic_string; typedef basic_string string; } namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { template class new_allocator { }; } namespace std __attribute__ ((__visibility__ ("default"))) { template class allocator: public __gnu_cxx::new_allocator<_Tp> { }; template class basic_string { private: struct _Rep_base { }; struct _Rep : _Rep_base { _CharT* _M_refdata() throw() { } }; struct _Alloc_hider : _Alloc { _Alloc_hider(_CharT* __dat, const _Alloc& __a) : _Alloc(__a), _M_p(__dat) { } _CharT* _M_p; }; private: mutable _Alloc_hider _M_dataplus; static _Rep& _S_empty_rep() { } public: basic_string() : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { } basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()); const _CharT* c_str() const { } }; } namespace llvm { class StringRef { private: const char *Data; size_t Length; public: StringRef() : Data(0), Length(0) { } StringRef(const char *Str) : Data(Str), Length(::strlen(Str)) { } bool equals(StringRef RHS) const { return (Length == RHS.Length && memcmp(Data, RHS.Data, RHS.Length) == 0); } }; inline bool operator==(StringRef LHS, StringRef RHS) { return LHS.equals(RHS); } inline bool operator!=(StringRef LHS, StringRef RHS) { return !(LHS == RHS); } class Triple; } namespace clang { class HeaderSearch; class HeaderSearchOptions; class LangOptions; void ApplyHeaderSearchOptions(HeaderSearch &HS, const HeaderSearchOptions &HSOpts, const LangOptions &Lang, const llvm::Triple &triple); class LangOptions { public: unsigned Trigraphs : 1; unsigned CPlusPlus : 1; }; } namespace std __attribute__ ((__visibility__ ("default"))) { template struct _Vector_base { }; template > class vector : protected _Vector_base<_Tp, _Alloc> { public: typedef _Tp value_type; typedef size_t size_type; size_type size() const { } }; } namespace clang { namespace frontend { enum IncludeDirGroup { Quoted = 0, Angled, System, After }; } class HeaderSearchOptions { public: struct Entry { }; std::string Sysroot; std::vector UserEntries; unsigned UseStandardIncludes : 1; unsigned Verbose : 1; }; } namespace llvm { class Triple { public: enum ArchType { UnknownArch, alpha, arm, bfin, cellspu, mips, mipsel, msp430, pic16, ppc, ppc64, sparc, sparcv9, systemz, tce, thumb, x86, x86_64, xcore, mblaze, InvalidArch }; private: std::string Data; mutable ArchType Arch; public: Triple() : Data(), Arch(InvalidArch) { } ArchType getArch() const { return Arch; } const std::string &str() const { } }; class Twine { enum NodeKind { NullKind, EmptyKind, TwineKind, CStringKind, StdStringKind, StringRefKind, DecUIKind, DecIKind, DecULKind, DecLKind, DecULLKind, DecLLKind, UHexKind }; private: const void *LHS; const void *RHS; unsigned char LHSKind; unsigned char RHSKind; private: explicit Twine(NodeKind Kind) : LHSKind(Kind), RHSKind(EmptyKind) { } explicit Twine(const void *_LHS, NodeKind _LHSKind, const void *_RHS, NodeKind _RHSKind) : LHS(_LHS), RHS(_RHS), LHSKind(_LHSKind), RHSKind(_RHSKind) { } bool isNull() const { return getLHSKind() == NullKind; } bool isNullary() const { } bool isUnary() const { return getRHSKind() == EmptyKind && !isNullary(); } NodeKind getLHSKind() const { return (NodeKind) LHSKind; } NodeKind getRHSKind() const { return (NodeKind) RHSKind; } public: Twine() : LHSKind(EmptyKind), RHSKind(EmptyKind) { } Twine(const char *Str) : RHSKind(EmptyKind) { } Twine(const StringRef &Str) : LHS(&Str), LHSKind(StringRefKind), RHSKind(EmptyKind) { } Twine(const StringRef &_LHS, const char *_RHS) : LHS(&_LHS), RHS(_RHS), LHSKind(StringRefKind), RHSKind(CStringKind) { } Twine concat(const Twine &Suffix) const; }; inline Twine Twine::concat(const Twine &Suffix) const { if (isNull() || Suffix.isNull()) return Twine(NullKind); const void *NewLHS = this, *NewRHS = &Suffix; NodeKind NewLHSKind = TwineKind, NewRHSKind = TwineKind; if (isUnary()) { NewLHS = LHS; } if (Suffix.isUnary()) { NewRHS = Suffix.LHS; } return Twine(NewLHS, NewLHSKind, NewRHS, NewRHSKind); } inline Twine operator+(const Twine &LHS, const Twine &RHS) { return LHS.concat(RHS); } inline Twine operator+(const StringRef &LHS, const char *RHS) { return Twine(LHS, RHS); } } using namespace clang; using namespace clang::frontend; namespace { class InitHeaderSearch { HeaderSearch& Headers; bool Verbose; std::string isysroot; public: InitHeaderSearch(HeaderSearch &HS, bool verbose = false, const std::string &iSysroot = "") : Headers(HS), Verbose(verbose), isysroot(iSysroot) { } void AddPath(const llvm::Twine &Path, IncludeDirGroup Group, bool isCXXAware, bool isUserSupplied, bool isFramework, bool IgnoreSysRoot = false); void AddGnuCPlusPlusIncludePaths(llvm::StringRef Base, llvm::StringRef ArchDir, llvm::StringRef Dir32, llvm::StringRef Dir64, const llvm::Triple &triple); void AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple); void AddDefaultSystemIncludePaths(const LangOptions &Lang, const llvm::Triple &triple); }; } void InitHeaderSearch::AddGnuCPlusPlusIncludePaths(llvm::StringRef Base, llvm::StringRef ArchDir, llvm::StringRef Dir32, llvm::StringRef Dir64, const llvm::Triple &triple) { llvm::Triple::ArchType arch = triple.getArch(); bool is64bit = arch == llvm::Triple::ppc64 || arch == llvm::Triple::x86_64; if (is64bit) AddPath(Base + "/" + ArchDir + "/" + Dir64, System, true, false, false); } void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) { llvm::StringRef CxxIncludeRoot(""); if (CxxIncludeRoot != "") { llvm::StringRef CxxIncludeArch(""); if (CxxIncludeArch == "") AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, triple.str().c_str(), "", "", triple); else AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, "", "", "", triple); } } void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, const llvm::Triple &triple) { if (Lang.CPlusPlus) AddDefaultCPlusPlusIncludePaths(triple); } void clang::ApplyHeaderSearchOptions(HeaderSearch &HS, const HeaderSearchOptions &HSOpts, const LangOptions &Lang, const llvm::Triple &Triple) { InitHeaderSearch Init(HS, HSOpts.Verbose, HSOpts.Sysroot); for (unsigned i = 0, e = HSOpts.UserEntries.size(); i != e; ++i) { } if (HSOpts.UseStandardIncludes) Init.AddDefaultSystemIncludePaths(Lang, Triple); }