summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
* Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall2011-07-151-0/+1
| | | | | | | | to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
* Match llvm API change.Evan Cheng2011-07-142-1/+3
| | | | llvm-svn: 135220
* Clean up two lingering comments that mention 'instantiation' w.r.t.Chandler Carruth2011-07-141-3/+3
| | | | | | macros in libclang. llvm-svn: 135148
* NestedMacroInstantiations -> NestedMacroExpansionsChandler Carruth2011-07-142-6/+6
| | | | | | | | | | | | | | | | This is switches all the interfaces points (and most of the commenst / local variables I saw on my way through) regarding the NestedMacroInstantiations bit. The libclang enums corresponding to this state were renamed, but a legacy enum was added with the old name, and the same value to keep existing clients working. I've added a documentation blurb for it, but let me know if there is a canonical way to document legacy elemenst of the libclang interface. No functionality changed here, even in tests. llvm-svn: 135141
* Update all of the libclang code corresponding to the preprocessorChandler Carruth2011-07-142-10/+10
| | | | | | | | | | | | | | MacroInstantiation -> MacroExpansion rename. Internally, everything is switched. Introduce a new cursor kind enum with the new name, but retain the old name as an alias so that we don't break backwards compatibility. Also update the debug printing routine to use 'macro expansions' as its explicitly not guaranteed to be stable, and mechanically switch the test cases over to that. llvm-svn: 135140
* Move the rest of the preprocessor terminology from 'instantiate' andChandler Carruth2011-07-143-16/+16
| | | | | | | | | | | | | variants to 'expand'. This changed a couple of public APIs, including one public type "MacroInstantiation" which is now "MacroExpansion". The rest of the codebase was updated to reflect this, especially the libclang code. Two of the C++ (and thus easily changed) libclang APIs were updated as well because they pertained directly to the old MacroInstantiation class. No functionality changed. llvm-svn: 135139
* Fix CMake.Argyrios Kyrtzidis2011-07-111-1/+0
| | | | llvm-svn: 134918
* [arcmt] Move the remapping functions to clang-c/Index.h and change 'arcmt_' ↵Argyrios Kyrtzidis2011-07-114-31/+30
| | | | | | prefix to 'clang_'. llvm-svn: 134916
* Match createCodeEmitter change.Evan Cheng2011-07-111-7/+11
| | | | llvm-svn: 134885
* Fix ARCMT/migrate.m on MSVC. Francois Pichet2011-07-101-0/+5
| | | | | | Solution is to set output stdout to binary mode to prevent newline conversion (\n => \r\n). llvm-svn: 134879
* Unbreak -cc1as mode after MC subtarget changesJoerg Sonnenberger2011-07-101-0/+1
| | | | llvm-svn: 134877
* tools/c-arcmt-test/Makefile: Add clangARCMigrate.a clangRewrite.a to ↵NAKAMURA Takumi2011-07-101-1/+2
| | | | | | | USEDLIBS to satisfy linking on cygming. FIXME: tools/c-*.exe should be linked to clang.dll on cygming. llvm/Makefile.rules is not aware of bin/clang.dll. llvm-svn: 134871
* c-arcmt-test.c: MSVCRT does not have setenv. Use putenv instead.NAKAMURA Takumi2011-07-101-0/+5
| | | | llvm-svn: 134859
* Fix linker problem in buildbot.Argyrios Kyrtzidis2011-07-092-2/+2
| | | | llvm-svn: 134849
* Ugh, fix CMake.Argyrios Kyrtzidis2011-07-091-1/+1
| | | | llvm-svn: 134848
* [libclang] Fix linker error in buildbots.Argyrios Kyrtzidis2011-07-092-1/+3
| | | | llvm-svn: 134847
* [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.Argyrios Kyrtzidis2011-07-0911-4/+357
| | | | | | | | | | | | | | | | | | | | This is a new mode of migration, where we avoid modifying the original files but we emit temporary files instead. <path> will be used to keep migration process metadata. Currently the temporary files that are produced are put in the system's temp directory but we can put them in the <path> if is necessary. Also introduce new ARC migration functions in libclang whose only purpose, currently, is to accept <path> and provide pairs of original file/transformed file to map from the originals to the files after transformations are applied. Finally introduce the c-arcmt-test utility that exercises the new libclang functions, update arcmt-test, and add tests for the whole process. rdar://9735086. llvm-svn: 134844
* cc1 must initialize MC subtarget infos for inline asm parsing. Re-enable ↵Evan Cheng2011-07-091-0/+1
| | | | | | asm-errors.c llvm-svn: 134811
* createAsmParser API change.Evan Cheng2011-07-091-3/+6
| | | | llvm-svn: 134797
* Update the creation of the TargetAsmParser based on API change in r134678.Chandler Carruth2011-07-081-1/+3
| | | | llvm-svn: 134680
* Slightly improve the code to derive target from program name to notJoerg Sonnenberger2011-07-071-3/+5
| | | | | | fault if no arguments are given. llvm-svn: 134618
* Introduce a new libclang aPI function,Douglas Gregor2011-07-074-0/+272
| | | | | | | | | clang_codeCompleteGetContexts(), that provides the client with information about the context in which code completion has occurred and what kinds of entities make sense as completions at that point. Patch by Connor Wakamo! llvm-svn: 134615
* MSVC doesn't like mixing declarations and statements in a C file.Francois Pichet2011-07-061-2/+1
| | | | llvm-svn: 134550
* createMCInstPrinter doesn't need TargetMachine anymore.Evan Cheng2011-07-061-1/+1
| | | | llvm-svn: 134526
* libclang: Allow callers of clang_saveTranslationUnit() to distinguishDouglas Gregor2011-07-062-5/+29
| | | | | | | between different classes of errors. Addresses most of <rdar://problem/9660328>. llvm-svn: 134495
* Improve the Python bindings for libclang in a few ways, from EliDouglas Gregor2011-07-063-0/+6
| | | | | | | | | | | | | | | | | Bendersky. Specifically: * Implemented a new function in libclang: clang_isAttribute * Fixing TranslationUnit.get_includes to only go through the argument * buffer when it contains something. This fixed a crash on Windows * clang_getFileName returns CXString, not char*. Made appropriate * fixes in cindex.py - now the relevant tests pass and we can see the * full locations correctly again (previously there was garbage in * place of the file name) * Exposed clang_getCursorDisplayName to the python bindings llvm-svn: 134460
* Preserve that a TemplateName was arrived at by substitutingJohn McCall2011-06-301-0/+5
| | | | | | | | | | | for a template template parameter. Uses to follow. I've also made the uniquing of SubstTemplateTemplateParmPacks use a ContextualFoldingSet as a minor space efficiency. llvm-svn: 134137
* createTargetMachine now takes a CPU string.Evan Cheng2011-06-301-1/+2
| | | | llvm-svn: 134128
* [libclang] Introduce cxcursor::getCursorParentDecl(CXCursor Cursor) and use ↵Argyrios Kyrtzidis2011-06-293-1/+6
| | | | | | | | it at the appropriate place in CIndex.cpp No functionality change. llvm-svn: 134104
* Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no ↵Argyrios Kyrtzidis2011-06-291-2/+1
| | | | | | functionality change. llvm-svn: 134103
* Revert unintentional commit.Eli Friedman2011-06-281-0/+8
| | | | llvm-svn: 133971
* Merge some calls to FoldingSetNodeID::AddInteger; assuming my measurements ↵Eli Friedman2011-06-271-8/+0
| | | | | | aren't completely off, roughly a 1% speedup on SingleSource/UnitTests/ObjC/trivial-interface.m . llvm-svn: 133968
* [libclang] Avoid having the cursor of an expression replace the declaration ↵Argyrios Kyrtzidis2011-06-271-3/+27
| | | | | | | | | | | | | | | cursor when the expression source range overlaps the declaration range. This can happen for C++ constructor expressions whose range generally include the variable declaration, e.g.: MyCXXClass foo; // Make sure pointing at 'foo' returns a VarDecl cursor. rdar://9124499. llvm-svn: 133930
* [libclang] Avoid having the cursor of an expression "overwrite" the ↵Argyrios Kyrtzidis2011-06-271-0/+18
| | | | | | | | | | | | | | | annotation of the variable declaration that it belongs to. This can happen for C++ constructor expressions whose range generally include the variable declaration, e.g.: MyCXXClass foo; // Make sure we don't annotate 'foo' as a CallExpr cursor. rdar://9124499. llvm-svn: 133929
* Introduce a new AST node describing reference binding to temporaries.Douglas Gregor2011-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | MaterializeTemporaryExpr captures a reference binding to a temporary value, making explicit that the temporary value (a prvalue) needs to be materialized into memory so that its address can be used. The intended AST invariant here is that a reference will always bind to a glvalue, and MaterializeTemporaryExpr will be used to convert prvalues into glvalues for that binding to happen. For example, given const int& r = 1.0; The initializer of "r" will be a MaterializeTemporaryExpr whose subexpression is an implicit conversion from the double literal "1.0" to an integer value. IR generation benefits most from this new node, since it was previously guessing (badly) when to materialize temporaries for the purposes of reference binding. There are likely more refactoring and cleanups we could perform there, but the introduction of MaterializeTemporaryExpr fixes PR9565, a case where IR generation would effectively bind a const reference directly to a bitfield in a struct. Addresses <rdar://problem/9552231>. llvm-svn: 133521
* Remove more unnecessary dependencies now that the Frontend -> ARCMigrateChandler Carruth2011-06-182-4/+1
| | | | | | edge has been broken. llvm-svn: 133343
* tools/arcmt-test: Don't attempt to link redundant libclang (clang-c).NAKAMURA Takumi2011-06-182-2/+1
| | | | llvm-svn: 133342
* [arcmt] Fix the ARC migrator. -arcmt-modify requires running before the ↵Argyrios Kyrtzidis2011-06-181-4/+5
| | | | | | | | initialization of SourceManager because it is going to modify the input file. llvm-svn: 133323
* Remove ARCMigrate from more builds that it isn't needed in now that theChandler Carruth2011-06-163-4/+2
| | | | | | layering problem has been addressed. llvm-svn: 133217
* c-index-test also depends on ARCMigrate, oh boyJohn McCall2011-06-161-2/+3
| | | | llvm-svn: 133147
* ARCMigrate depends on libAnalysis, and on unhelpful linkers must appearJohn McCall2011-06-162-1/+2
| | | | | | before it on the link line. llvm-svn: 133145
* Grr. Of course libARCMigrate depends on libRewrite. This is a lot to beJohn McCall2011-06-162-2/+3
| | | | | | linking unnecessarily into libclang. llvm-svn: 133129
* [arcmt] Make arcmt-test accept cc1 options to make it more portable and ↵Argyrios Kyrtzidis2011-06-161-16/+13
| | | | | | hopefully fix MSVC failures. llvm-svn: 133119
* libFrontend depends on ARCMigrate, so link it into libclang.John McCall2011-06-162-1/+3
| | | | llvm-svn: 133116
* The ARC Migration Tool. All the credit goes to Argyrios and FariborzJohn McCall2011-06-158-12/+306
| | | | | | for this. llvm-svn: 133104
* Automatic Reference Counting.John McCall2011-06-153-3/+14
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Add support for builtin astype:Tanya Lattner2011-06-041-0/+1
| | | | | | | __builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types. Added test case. llvm-svn: 132612
* Expose @synthesize and @dynamic via their own cursor kinds inDouglas Gregor2011-06-031-1/+5
| | | | | | libclang. Fixes <rdar://problem/9537904>. llvm-svn: 132603
* Objective-C doesn't consider the use of incomplete types as methodDouglas Gregor2011-05-271-3/+4
| | | | | | | | | | | | | | parameter types to be ill-formed. However, it relies on the completeness of method parameter types when producing metadata, e.g., for a protocol, leading IR generating to crash in such cases. Since there's no real way to tighten down the semantics of Objective-C here without breaking existing code, do something safe but lame: suppress the generation of metadata when this happens. Fixes <rdar://problem/9123036>. llvm-svn: 132171
* A StringRef-ication of the DiagnosticIDs API and internals.Argyrios Kyrtzidis2011-05-251-1/+2
| | | | | | | | | Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static diagnostic data structures, which resulted in a huge global-var-init function. Depends on llvm commit r132046. llvm-svn: 132047
OpenPOWER on IntegriCloud