aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite
AgeCommit message (Collapse)Author
2012-07-27clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-25objective-c modern translator. Provide declaration ofFariborz Jahanian
"memset' lazily when is needed in translation of struct-valued methods which require checkinf of nil receivers outside their bodies. // rdar://11847319 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160759 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16modern objective-c translator: conditionally includeFariborz Jahanian
<string.h>. // rdar://11847319 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160287 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko
very simple semantic analysis that just builds the AST; minor changes for lexer to pick up source locations I didn't think about before. Comments AST is modelled along the ideas of HTML AST: block and inline content. * Block content is a paragraph or a command that has a paragraph as an argument or verbatim command. * Inline content is placed within some block. Inline content includes plain text, inline commands and HTML as tag soup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29objective-c modern translator: synthesize argument typeFariborz Jahanian
correctly for blocks and function pointer arguments in the written constructor. // rdar://11359268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159456 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29modern objc translator: string.h is unavailable on some non-OSXFariborz Jahanian
platforms declare memset in rewritten code instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159454 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29objective-c modern translator: Translation into objc_msgSend_stretFariborz Jahanian
entry point which requires nil check before calling objc_msgSend_stret. // rdar://11359268 - wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159445 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28objective-c rewriter: refactoring of rewriting ofFariborz Jahanian
objc_msgSend_stret() API. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159379 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth
express library-level dependencies within Clang. This is no more verbose really, and plays nicer with the rest of the CMake facilities. It should also have no change in functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20Restructure how the driver communicates information about theJohn McCall
target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-15Documentation cleanup: Escaped backslashes in Doxygen comments.James Dennett
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-14Fix crash on missing header in -rewrite-includes.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158459 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-14Rename -rewrite-includes to -frewrite-includes.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158458 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-10PR13064: Store whether an in-class initializer uses direct or copyRichard Smith
initialization, and use that information to produce the right kind of initialization during template instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-09Replace a char counting helper function with std::count.Benjamin Kramer
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158272 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-08Convert comments to proper Doxygen comments.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158241 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-08Disable _Pragma during HTML macro rewriting to keep from crashing.Jordan Rose
The preprocessor's handling of diagnostic push/pops is stateful, so encountering pragmas during a re-parse causes problems. HTMLRewrite already filters out normal # directives including #pragma, so it's clear it's not expected to be interpreting pragmas in this mode. This fix adds a flag to Preprocessor to explicitly disable pragmas. The "right" fix might be to separate pragma lexing from pragma parsing so that we can throw away pragmas like we do preprocessor directives, but right now it's important to get the fix in. Note that this has nothing to do with the "hack" of re-using the input preprocessor in HTMLRewrite. Even if we someday copy the preprocessor instead of re-using it, the copy would (and should) include the diagnostic level tables and have the same problems. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158214 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie
value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06Add a -rewrite-includes option, which is similar to -rewrite-macros, but ↵David Blaikie
only expands #include directives. Patch contributed by Lubos Lunak (l.lunax@suse.cz). Review by Matt Beaumont-Gay (matthewbg@google.com). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. ↵NAKAMURA Takumi
Win32 doesn't allow rename/removing opened files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157528 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24cleanup some code.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23modern objc translation: Add translation of @autoreleasepoolFariborz Jahanian
statement. // rdar://11474836. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157359 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-22Adds a method overwriteChangedFiles to the Rewriter. This is implemented byManuel Klimek
first writing the changed files to a temporary location and then overwriting the original files atomically. Also adds a RewriterTestContext to aid unit testing rewrting logic in general. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157260 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-08Modern objective-c translation. Translating defaultFariborz Jahanian
synthesis of property getter/setters. // rdar://11374235 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156447 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-08modern objc translation. objc_getClass() and objc_getMetaClass()Fariborz Jahanian
prototypes should both return `struct objc_class *`. // rdar://11375495 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156418 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-07Revert r156097, which appears to be causing some breakage.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156304 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03objc modern translator: fix up attribute for dynamic property in a category.Fariborz Jahanian
// rdar://11095151 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156127 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03modern objc translator: support for default propertyFariborz Jahanian
synthesis translation. // rdar://11374235 - wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156125 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03modern objc translator: used size_t in coupleFariborz Jahanian
of places. // rdar://11375908 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156106 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03modern objc translation. objc_getClass() and objc_getMetaClass()Fariborz Jahanian
prototypes should both return `struct objc_class *`. // rdar://11375495 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156097 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02modern objective-c translator: Fix destructor def.Fariborz Jahanian
for __NSContainer_literal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156035 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02Modern objective-c translation: Fixing couple of bugsFariborz Jahanian
related to laying out ivar structs and accessing non-fragile-ivar in more compilated cases. // rdar://11323187 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156004 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01modern objective-c translation of private ivars.Fariborz Jahanian
// rdar://11351299 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155921 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-30modern objective-c translator. named aggregate typesFariborz Jahanian
defined inside the objc class belong to class's decl. scope. This is to conform to objective-c rules. // rdar://11351299 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155855 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-30minor refactoring of modern objc translator.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-30modern objective-c translation: de-virtualize allFariborz Jahanian
local rewriting functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-30Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie
filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-27objective-c modern translator: Correctly translateFariborz Jahanian
nonfragile ivar access code when ivar type is a locally defined struct/union type. // rdar://11323187 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155740 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-27modern objective-c translator: _OBJC_PROTOCOL_REFERENCE_* Fariborz Jahanian
symbols should be static. // rdar://11337074 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155736 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-26modern objective-c transltion: Fixes a translation bugFariborz Jahanian
of writing a __block variable being initialized with a constructed object. // rdar://11326988 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155673 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-25modern objc rewriter: fixes a bug writing Fariborz Jahanian
a const qualified static c-function. // rdar://11314329 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155564 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-24modern objc translator: Allow writing of multipleFariborz Jahanian
declaration of __block variables on same lines with initializers. // rdsr://7547630 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-24objc modern rewriter: allow translation ofFariborz Jahanian
multiple declaration of block variables (with no initializer) on the same line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155462 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-24objc modern rewriter: minor refactoring.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155449 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19objective-c modern translator: Further improving the lastFariborz Jahanian
patch fixing writing a spurious 'static' into the wrong place. // rdar://11275241 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19modern objective-c translator: Fix writing a spurious 'static'Fariborz Jahanian
into the wrong place when rewriting a static function which declares block literals. // rdar://11275241 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155084 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-17objective-c modern translation. Correct rewriting ofFariborz Jahanian
block meta-data of block literals declared inside of extern "C" functions. // rdar://1131490 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154939 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16Modern objective-c translator:'self' used insideFariborz Jahanian
block literal is imported. // rdar://11259664 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154876 91177308-0d34-0410-b5e6-96231b3b80d8