aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2011-11-21Create the clang++ symlink as a POST_BUILD custom command on clang.Peter Collingbourne
This saves us from re-creating the symlink on every build even if we didn't rebuild clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145017 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-18c-index-test.c: Fix syntax according to C.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-18Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continueArgyrios Kyrtzidis
parsing or false to abort parsing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-18[libclang] Indexing API:Argyrios Kyrtzidis
-For indexDeclaration, also pass the declaration attributes as an array of cursors. -Rename CXIndexOpt_OneRefPerFile -> CXIndexOpt_SuppressRedundantRefs, and only pass a reference if a declaration/definition does not exist in the file. -Other fixes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144942 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-18[libclang] Indexing API: make sure we don't pass declarations/references ↵Argyrios Kyrtzidis
without USR or location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144941 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-17Make 'LangOptions' in CompilerInvocation a heap-allocated, reference counted ↵Ted Kremenek
object. I discovered that llvm::RefCountedBase<T> has a bug where the reference count is copied in the copy constructor, which means that there were cases when the CompilerInvocation objects created by ASTUnit were actually leaked. When I fixed that bug locally, it showed that a whole bunch of code assumed that the LangOptions object that was part of CompilerInvocation was still alive. By making it heap-allocated and reference counted, we can keep it around after the CompilerInvocation object goes away. As part of this change, change CompilerInvocation:getLangOptions() to return a pointer, acting as another clue that this object may outlive the CompilerInvocation object. This commit doesn't fix the CompilerInvocation leak itself. That will come when I commit the fix to llvm::RefCountedBase<T> to mainline LLVM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144930 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16[libclang] Add a comment in lazyCreateDiags to explain why the check and ↵Argyrios Kyrtzidis
reset of diagnostic set is necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16[libclang] Make clang_annotateTokens use "file-targeted" deserialization and ↵Argyrios Kyrtzidis
avoid unnecessary deserializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16[libclang] Make clang_findReferencesInFile use "file-targeted" ↵Argyrios Kyrtzidis
deserialization and avoid unnecessary deserializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16Teach ccc-analyzer about -fobjc-arc.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16[libclang] Indexing API: fill the objc category info for a category ↵Argyrios Kyrtzidis
implementation and do not crash if no client container is registered for a declaration context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16[libclang] Indexing API: make sure we do not try to index local declarations.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16[libclang] Indexing API: if the CXIndexOpt_OneRefPerFile option is set, only ↵Argyrios Kyrtzidis
report one reference per file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144763 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16[libclang] In lazyCreateDiags, recreate the diagnostic set if the number of ↵Argyrios Kyrtzidis
diagnostics in the ASTUnit changed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144762 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15[libclang] Indexing API: Pass an implicit ObjCInterfaceDecl (@implementation ↵Argyrios Kyrtzidis
without @interface) in a separate indexing callback than its implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144625 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15[libclang] Introduce a new function to apply the indexing callbacks on an ↵Argyrios Kyrtzidis
existing CXTranslationUnit, mainly to be used for indexing a PCH. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-14Fix potential memory leak for clients of clang_getOverriddenCursors(). If ↵Ted Kremenek
the number of overriden cursors is 0, do not allocate an array of CXCursors. This fixes a memory leak in c-index-test, and clients who use this API in a similar way. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-14[libclang] Slight changes to the indexing API and bigger internal changes ↵Argyrios Kyrtzidis
for it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-13[libclang] Move the check for errors in c-index-test before the TU gets ↵Argyrios Kyrtzidis
disposed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144514 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-13[libclang] for c-index-test, check for CINDEXTEST_FAILONERROR when doing ↵Argyrios Kyrtzidis
-test-load-source-reparse git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144509 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-12[libclang] Further simplify the indexing API.Argyrios Kyrtzidis
That stuff can be added later on if we need them. Also add some const goodness. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144446 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11Tweak CXLoadedDiagnosticSetImpl::makeString() to include an extra null ↵Ted Kremenek
character, and change the creation of the FixIT's string to again just rely on this string (instead of duplicating it when calling createCXString). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144389 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11Silence compiler warning.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144386 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11libclang/CXLoadedDiagnostic.cpp: Work around not to miss the string ↵NAKAMURA Takumi
terminator on fixit. FixIts might be exposed as C string via clang_getCString(), though the zero terminator is not allocated in CXLoadedDiagnosticSetImpl::makeString. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11[serialized diagnostics]: add test cases for serialized diagnostics, ↵Ted Kremenek
including a test case for no issues, multiple issues, and a single issue. Along the way, tweak c-index-test -read-diagnostics output so it is easier to tell what diagnostics are child diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144349 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11[libclang] Simplify the indexing API.Argyrios Kyrtzidis
Cut down the number of callbacks to more generic ones. Clients can check an enum to find out what kind of declaration it is and they can call functions to get more specific information than the generic provided info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144343 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10c-index-test.c: Fix a comment style. /* It is C source. */NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144274 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10c-index-test.c: Fix syntax. It is C source.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10serialized diagnostics: implement full deserialization of clang diagnostics ↵Ted Kremenek
via the libclang API. I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08Sort contents of exports file. No functionality change.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-07[analyzer] Make sure scan-build catches all clang failures.Anna Zaks
scan-build ignores clang failures in some cases, which might lead to silent failure suppression. For example, if clang command line argument is wrong. (Addresses radar://10406598) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144029 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06Change the AST representation of operations on Objective-CJohn McCall
property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05[libclang] For "c-index-test -index-file", print out the names of the callbacks.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143779 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04[arcmt] In GC, transform NSMakeCollectable to CFBridgingRelease.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143698 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03[libclang] Move CursorVisitor to its own header.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03[libclang] Use CursorVisitor::Visit instead of invoking the visitor directly.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03[libclang] Add missing return in clang_getExpansionLocation that resulted in ↵Argyrios Kyrtzidis
that function always returning a null file/line/column. Also add at least one use of clang_getExpansionLocation inside c-index-test that would have made the tests to catch that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03[libclang] Add infrastructure to be able to only deserialize decls in a file ↵Argyrios Kyrtzidis
region and use it for clang_getCursor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03[libclang] For c-index-test disable caching of code completion results ifArgyrios Kyrtzidis
the CINDEXTEST_COMPLETION_NO_CACHING environment variable is present. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143604 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01Add missing export. Spotted by Leandro Melo.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143508 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01rename getHostTriple into getDefaultTargetTriple in clangSebastian Pop
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143503 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01[libclang] For a class extension, give it a unique USR but for any property ↵Argyrios Kyrtzidis
or ivar it contains give it a USR based on its semantic context, which is the interface. This follows what we already did for objc methods. rdar://10371669 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143464 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01Add LinkAllPasses to clangTobias Grosser
This patch ensures that no passes are deleted from clang, such that the loading of plugins does not fail because of passes being unavailable. This increases the size of the clang binary from 43029853 to 43915291 bytes (around 2%). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01Rework the AST for the initializer of a delegating constructor, soDouglas Gregor
that it retains source location information for the type. Aside from general goodness (being able to walk the types described in that information), we now have a proper representation for dependent delegating constructors. Fixes PR10457 (for real). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143410 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31[libclang] Tweak internals of CXSourceLocation to allow an alternate ↵Ted Kremenek
implementation if the lowest bit of ptr_data[0] is not 0. This is prep for work on serialized diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31[libclang] Move implementation of functions for manipulation ↵Ted Kremenek
CXSourceLocations and CXSourceRanges into a separate file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31[libclang] Add CXDiagnosticImpl to represent a super class for the ↵Ted Kremenek
implementation backing a CXDiagnostic. This allows CXStoredDiagnostic to be just one possible implementation of a CXDiagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143368 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31[libclang] Rename VisitIncludedPreprocessingEntries -> VisitIncludedEntitiesArgyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143337 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-30Add support for lazily linking bitcode files (using a newPeter Collingbourne
-mlink-bitcode-file flag), and more generally llvm::Modules, before running optimisations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143314 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-29Use LIBCLANG_NOTHREADS instead of CINDEXTEST_NOTHREADS inside libclang,Argyrios Kyrtzidis
so the c-index-test one can be enabled without affecting libclang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143288 91177308-0d34-0410-b5e6-96231b3b80d8