Commit Graph

4 Commits

Author SHA1 Message Date
Ted Kremenek 5b8ad40664 [libclang] Workaround potential race condition with code completion AllocatedResults being freed after a CXTranslationUnit.
The Container USR's CXString had its underlying data owned by the CXTranslationUnit's string pool.  This
would result in trying to access freed memory.

llvm-svn: 137887
2011-08-17 22:19:53 +00:00
Chris Lattner 01cf8db38b now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector.  This cleans up the codebase
quite a bit.

llvm-svn: 135576
2011-07-20 06:58:45 +00:00
Ted Kremenek 915542850b Change CXTranslationUnit to not directly cast to an ASTUnit*,
but to wrap both an ASTUnit and a "string pool"
that will be used for fast USR generation.

This requires a bunch of mechanical changes, as
there was a ton of code that assumed that CXTranslationUnit
and ASTUnit* were the same.

Along with this change, introduce CXStringBuf,
which provides an llvm::SmallVector<char> backing
for repeatedly generating CXStrings without a huge
amount of malloc() traffic.  This requires making
some changes to the representation of CXString
by renaming a few fields (but keeping the size
of the object the same).

llvm-svn: 119337
2010-11-16 08:15:36 +00:00
Ted Kremenek 64dddfb39c Add CXString.cpp and CXString.h
llvm-svn: 119322
2010-11-16 02:03:55 +00:00