summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-27 01:32:48 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-27 01:32:48 +0000
commit89a56c561f7ea5970167695e86e2eaf4e0155d55 (patch)
tree36c628482b47e89a3e1d53874d0f222efbec1ea2 /clang/include/clang-c
parente7179e8b76e6133242b3bcecd7a5b8c2bfe83907 (diff)
downloadbcm5719-llvm-89a56c561f7ea5970167695e86e2eaf4e0155d55.tar.gz
bcm5719-llvm-89a56c561f7ea5970167695e86e2eaf4e0155d55.zip
When given unsaved files in clang_createTranslationUnitFromSourceFile,
copy the source buffers provided rather than referencing them directly, so that the caller can free those buffers immediately after calling clang_createTranslationUnitFromSourceFile(). Otherwise, we risk hitting those buffers later (when building source ranges, forming diagnostics, etc.). llvm-svn: 97296
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 6d1a02fb4f7..c1238e5d88e 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -87,14 +87,12 @@ struct CXUnsavedFile {
const char *Filename;
/**
- * \brief A null-terminated buffer containing the unsaved contents
- * of this file.
+ * \brief A buffer containing the unsaved contents of this file.
*/
const char *Contents;
/**
- * \brief The length of the unsaved contents of this buffer, not
- * counting the NULL at the end of the buffer.
+ * \brief The length of the unsaved contents of this buffer.
*/
unsigned long Length;
};
OpenPOWER on IntegriCloud