summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-212-22/+0
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. llvm-svn: 201842
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-252-35/+30
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-202-44/+58
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* Use the simpler version of llvm::sys::fs::remove when possible.Rafael Espindola2014-01-101-2/+1
| | | | llvm-svn: 198957
* Implement MSVC header search algorithm in MicrosoftMode.Will Wilson2013-12-271-1/+1
| | | | | | Follows algorithm described here: http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx llvm-svn: 198082
* Fix raw lex crash and -frewrite-includes noeol-at-eof failureAlp Toker2013-12-131-5/+5
| | | | | | Raw lexers don't have a preprocessor so we need to null check. llvm-svn: 197245
* [CMake] clang/lib: Prune redundant dependencies.NAKAMURA Takumi2013-12-102-2/+0
| | | | llvm-svn: 196864
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-092-3/+14
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. llvm-svn: 196800
* Check the initial line number without going through PresumedLocAlp Toker2013-12-051-3/+2
| | | | | | | No practical difference in this case and would return 1 either way, but this is more self-explanatory. llvm-svn: 196511
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-052-3/+3
| | | | llvm-svn: 196510
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-052-2/+2
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Add an assert to make it clear we're on the first lineAlp Toker2013-12-051-1/+3
| | | | | | A raw lexer in its initial state is guaranteed to be on line number one. llvm-svn: 196461
* Revert r196372, "do not warn about unknown pragmas in modes that do not ↵NAKAMURA Takumi2013-12-041-1/+7
| | | | | | | | handle them (pr9537)" It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes. llvm-svn: 196376
* do not warn about unknown pragmas in modes that do not handle them (pr9537)Lubos Lunak2013-12-041-7/+1
| | | | | | | And refactor to have just one place in code that sets up the empty pragma handlers. llvm-svn: 196372
* Rewriter: Output RewriteRope contents efficientlyAlp Toker2013-12-021-2/+5
| | | | | | | | | This avoids allocation of temporary std::strings for file contents, instead writing chunks directly to the output stream. The old character-based B-tree iterator remains intact for the time being. llvm-svn: 196119
* InclusionRewriter: Avoid duplicated BOM checkAlp Toker2013-11-281-7/+3
| | | | | | | The lexer already knows its position in the file, so use that instead of guessing it might be 3. llvm-svn: 195910
* strip UTF-8 BOM in -frewrite-includes (PR#15664)Lubos Lunak2013-11-271-0/+5
| | | | llvm-svn: 195877
* ObjectiveC modern translator. Fixes a translation bugFariborz Jahanian2013-11-221-6/+3
| | | | | | tranalation @protocol expression. // rdar://15517895 llvm-svn: 195480
* Fix typo: inccrementallyBenjamin Kramer2013-10-131-1/+1
| | | | llvm-svn: 192551
* ObjectiveC modern rewriter. Rewrite typedefsFariborz Jahanian2013-10-071-0/+15
| | | | | | | declared locally in ObjectiveC containers. // rdar://15143875 llvm-svn: 192127
* Revert my patch in r191155 to allow forwardFariborz Jahanian2013-09-241-9/+12
| | | | | | | | class/protocol decls in @implementation and fixup modern rewriter to handle that. // rdar://15066233 llvm-svn: 191311
* ObjectiveC modern translator: Provide proper cast ofFariborz Jahanian2013-09-171-1/+1
| | | | | | | the ObjectiveC object of an @synchronized statement. // rdar://14993814 llvm-svn: 190874
* Address review comment on r189557.Eli Friedman2013-09-171-1/+3
| | | | | | | | | We need to escape filenames the same way in InclusionRewriter whether UseLineDirective is true or false. Review comment from http://llvm.org/bugs/show_bug.cgi?id=17018#c2 llvm-svn: 190834
* Remove unused variable.Eli Friedman2013-09-101-1/+0
| | | | llvm-svn: 190445
* Modern ObjectiveC translator. Fix translation of Fariborz Jahanian2013-09-091-36/+26
| | | | | | | | message sent to aggregate-valued methods. Fix visibility of trampoline type used in translation of such expressions. // rdar://14932320 llvm-svn: 190341
* Fix constructor-related typos.Benjamin Kramer2013-09-092-28/+28
| | | | | | Noticed by Roman Divacky. llvm-svn: 190311
* ObjectiveC modern translator: fix up generated fast enumerationFariborz Jahanian2013-09-051-18/+23
| | | | | | | code to work for bit 32bit and 64bit APIs. // rdar://14913632 llvm-svn: 190072
* Properly escape filenames in line directives.Eli Friedman2013-08-291-1/+3
| | | | | | | Fixes PR17018. Only partial test coverage because I don't want to try to write a test which generates a file whose name contains a newline. llvm-svn: 189557
* Split isFromMainFile into two functions.Eli Friedman2013-08-223-3/+3
| | | | | | | | | Basically, isInMainFile considers line markers, and isWrittenInMainFile doesn't. Distinguishing between the two is useful when dealing with files which are preprocessed files or rewritten with -frewrite-includes (so we don't, for example, print useless warnings). llvm-svn: 188968
* [frontend] '-frewrite-includes' should not ignore headers included from ↵Argyrios Kyrtzidis2013-07-261-1/+12
| | | | | | | | command-line. rdar://14556182 llvm-svn: 187207
* avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)Lubos Lunak2013-07-201-0/+8
| | | | llvm-svn: 186764
* fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)Lubos Lunak2013-07-201-3/+30
| | | | | | | | Every #include is surrounded by #if 0 in order to comment it out, which adds lines. That is fixed up right after, but that all can be inside #if part that is not processed, so fix up also after every end of a conditional part. llvm-svn: 186763
* Update for llvm API change.Rafael Espindola2013-07-161-1/+1
| | | | llvm-svn: 186448
* Use llvm::sys::fs::createUniqueFile.Rafael Espindola2013-07-051-2/+1
| | | | | | | Include a test that clang now produces output files with permissions matching the umask. llvm-svn: 185727
* Use llvm::sys::fs::createTemporaryFile.Rafael Espindola2013-07-051-6/+4
| | | | llvm-svn: 185717
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-052-20/+20
| | | | llvm-svn: 185715
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-042-16/+16
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185610
* Port HTMLDiagnostics to PathV2. No intended functionality change.Benjamin Kramer2013-06-121-2/+1
| | | | llvm-svn: 183849
* Added Lexer::getBufferEnd().Alexander Kornienko2013-06-041-1/+1
| | | | | | | | | | | | | | | | | | Summary: There's Lexer::getBufferStart(), and we need getBufferEnd() to access the whole input buffer in clang::format::reformat. We don't want to rely on the fact that the Lexer::BufferEnd always points to '\0', as there can be embedded '\0's as well. Reviewers: jordan_rose Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D916 llvm-svn: 183236
* Use only explicit bool conversion operatorDavid Blaikie2013-05-151-1/+1
| | | | | | | | | | | | | | | | | | | The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. DiagnosticBuilder kept its implicit conversion operator owing to the prevalent use of it in return statements. One bug was found in ExprConstant.cpp involving a comparison of two PointerUnions (PointerUnion did not previously have an operator==, so instead both operands were converted to bool & then compared). A test is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix (adding operator== to PointerUnion in LLVM). llvm-svn: 181869
* Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the ↵Argyrios Kyrtzidis2013-05-071-1/+1
| | | | | | | | | | | FileID. This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location when the the FileID is for an empty file. rdar://13803893 llvm-svn: 181285
* Remove DiagnosticConsumer::clone(), a bad idea that is now unused.Douglas Gregor2013-05-031-5/+0
| | | | llvm-svn: 181070
* rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.Benjamin Kramer2013-04-161-1/+119
| | | | | | | | | | | | | | This broke e.g. compiling a crash report from a glibc system on Darwin. Sadly, the implementation had to game the lexer a lot as we're not using a real preprocessor here. It also doesn't handle special cases like arbitrary macros in __has_include, but since this macro isn't common outside of clang's headers we can get away with that. Fixes PR14422. Differential Revision: http://llvm-reviews.chandlerc.com/D594 llvm-svn: 179616
* [frontend] -frewrite-includes: turn implicit module imports into @imports.Argyrios Kyrtzidis2013-04-101-15/+24
| | | | | | rdar://13610250 llvm-svn: 179145
* [frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo ↵Argyrios Kyrtzidis2013-04-101-3/+8
| | | | | | that indicates return from another file. llvm-svn: 179143
* Add 178663 back.Rafael Espindola2013-04-032-31/+31
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-032-31/+31
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Objective-C modern rewriter. Fixes a bugFariborz Jahanian2013-04-031-3/+9
| | | | | | | | rewriting typedef for a qualified object type and also when two declarations happen to be on the same line. // rdar://13562505 llvm-svn: 178680
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-032-31/+31
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* Add some assertions to appease the static analyzer.Jordan Rose2013-03-151-2/+1
| | | | | | No functionality change. llvm-svn: 177185
OpenPOWER on IntegriCloud