diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /tools/libclang/CXString.h | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'tools/libclang/CXString.h')
-rw-r--r-- | tools/libclang/CXString.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tools/libclang/CXString.h b/tools/libclang/CXString.h new file mode 100644 index 0000000..f03a6b2 --- /dev/null +++ b/tools/libclang/CXString.h @@ -0,0 +1,53 @@ +//===- CXString.h - Routines for manipulating CXStrings -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines routines for manipulating CXStrings. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_CXSTRING_H +#define LLVM_CLANG_CXSTRING_H + +#include "clang-c/Index.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/SmallString.h" + +namespace clang { +namespace cxstring { + +struct CXStringBuf { + llvm::SmallString<128> Data; + CXTranslationUnit TU; + CXStringBuf(CXTranslationUnit tu) : TU(tu) {} +}; + +/// \brief Create a CXString object from a C string. +CXString createCXString(const char *String, bool DupString = false); + +/// \brief Create a CXString object from a StringRef. +CXString createCXString(llvm::StringRef String, bool DupString = true); + +/// \brief Create a CXString object that is backed by a string buffer. +CXString createCXString(CXStringBuf *buf); + +/// \brief Create an opaque string pool used for fast geneneration of strings. +void *createCXStringPool(); + +/// \brief Dispose of a string pool. +void disposeCXStringPool(void *pool); + +CXStringBuf *getCXStringBuf(CXTranslationUnit TU); + +void disposeCXStringBuf(CXStringBuf *buf); + +} +} + +#endif + |