summaryrefslogtreecommitdiff
path: root/lib/Rewrite/Frontend/RewriteModernObjC.cpp
Commit message (Collapse)AuthorAge
* Removing an "if (this == nullptr)" check from two print methods. The conditionRichard Trieu2014-06-09
| | | | | | | | will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210498 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'.Craig Topper2014-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208163 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C rewriter. Use _WIN64 instead of __LLP64__Fariborz Jahanian2014-04-16
| | | | | | | | to conditinalize on 64bit length in a generated meta-data. // rdar://16489050 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206402 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C modern translator. Fix declaration ofFariborz Jahanian2014-04-01
| | | | | | | | __NSConstantStringImpl's length field to accomodate window's 64bit LLP64 mode. // rdar://16489050 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205353 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing FunctionProtoType iterators param_type_begin() and ↵Aaron Ballman2014-03-17
| | | | | | param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204045 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-15
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203999 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with ↵Aaron Ballman2014-03-14
| | | | | | iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203958 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and ↵Aaron Ballman2014-03-14
| | | | | | propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203930 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-14
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203922 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-13
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203863 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-13
| | | | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203842 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCContainerDecl iterators classmeth_begin() and ↵Aaron Ballman2014-03-13
| | | | | | classmeth_end() with iterator_range class_methods(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203840 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and ↵Aaron Ballman2014-03-13
| | | | | | instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203839 91177308-0d34-0410-b5e6-96231b3b80d8
* Renaming the recently-created (r203830) props() range API to properties() ↵Aaron Ballman2014-03-13
| | | | | | for clarity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203835 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() ↵Aaron Ballman2014-03-13
| | | | | | with iterator_range props(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203830 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203389 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-08
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203355 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() ↵Aaron Ballman2014-03-08
| | | | | | with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203353 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-07
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203255 91177308-0d34-0410-b5e6-96231b3b80d8
* RewriteObjC: Factor string literal creation into a helper and make sure it ↵Benjamin Kramer2014-02-25
| | | | | | | | gets a proper constant array type. No change in output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202146 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-25
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200082 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-20
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199686 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196510 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-05
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196466 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC modern translator. Fixes a translation bugFariborz Jahanian2013-11-22
| | | | | | | tranalation @protocol expression. // rdar://15517895 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195480 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC modern rewriter. Rewrite typedefsFariborz Jahanian2013-10-07
| | | | | | | | declared locally in ObjectiveC containers. // rdar://15143875 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192127 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my patch in r191155 to allow forwardFariborz Jahanian2013-09-24
| | | | | | | | | class/protocol decls in @implementation and fixup modern rewriter to handle that. // rdar://15066233 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191311 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC modern translator: Provide proper cast ofFariborz Jahanian2013-09-17
| | | | | | | | the ObjectiveC object of an @synchronized statement. // rdar://14993814 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190874 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused variable.Eli Friedman2013-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190445 91177308-0d34-0410-b5e6-96231b3b80d8
* Modern ObjectiveC translator. Fix translation of Fariborz Jahanian2013-09-09
| | | | | | | | | | message sent to aggregate-valued methods. Fix visibility of trampoline type used in translation of such expressions. // rdar://14932320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190341 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix constructor-related typos.Benjamin Kramer2013-09-09
| | | | | | Noticed by Roman Divacky. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190311 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC modern translator: fix up generated fast enumerationFariborz Jahanian2013-09-05
| | | | | | | | code to work for bit 32bit and 64bit APIs. // rdar://14913632 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190072 91177308-0d34-0410-b5e6-96231b3b80d8
* Split isFromMainFile into two functions.Eli Friedman2013-08-22
| | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188968 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-04
| | | | | | avoid specifying the vector size unnecessarily. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185610 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 178663 back.Rafael Espindola2013-04-03
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 178663.Rafael Espindola2013-04-03
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C modern rewriter. Fixes a bugFariborz Jahanian2013-04-03
| | | | | | | | | rewriting typedef for a qualified object type and also when two declarations happen to be on the same line. // rdar://13562505 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178680 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-03
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some assertions to appease the static analyzer.Jordan Rose2013-03-15
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177185 91177308-0d34-0410-b5e6-96231b3b80d8
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-08
| | | | | | No (intended) functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-C modern translator: Fixes a mistranslationFariborz Jahanian2013-02-11
| | | | | | | | of @throw statement by finding location of the ';' correctly. // rdar://13186010 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174898 91177308-0d34-0410-b5e6-96231b3b80d8
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-08
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-C modern translation: Fix another random translation bugFariborz Jahanian2013-02-08
| | | | | | | | involving property getter expressions on rhs of property setter. // rdar://13138459 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174729 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-C modern translator. Fixes a trivialFariborz Jahanian2013-02-08
| | | | | | | | rewriting bug where #ifdef ended up on the same line as the attribute declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174719 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-C modern translator. Generate #lineFariborz Jahanian2013-02-08
| | | | | | | | info in the translated code under -g only. // rdar://13138170 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174684 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-C modern translator. More fixups for Fariborz Jahanian2013-02-07
| | | | | | | | modern meta-data abi translation. Still wip. // rdar://13138459 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174672 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-C modern translator. Fix up the translatedFariborz Jahanian2013-02-07
| | | | | | | | metadata to handle ivar bitfields. This is wip. // rdar://13138459 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174573 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172665 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-12
| | | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8