summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Make the static type of the exception variable in an Objective-CDouglas Gregor2010-04-262-2/+2
| | | | | | | @catch a VarDecl. The dynamic type is still a ParmVarDecl, but that will change soon. No effective functionality change. llvm-svn: 102341
* Switch this to new API.Nick Lewycky2010-04-241-1/+1
| | | | llvm-svn: 102280
* Add BasePath arguments to all cast expr constructors.Anders Carlsson2010-04-241-1/+1
| | | | llvm-svn: 102258
* NeXT: Clean up dispatch method policy selection.Daniel Dunbar2010-04-241-3/+23
| | | | | | | | | | - Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}. - Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp. - No intended functionality change. llvm-svn: 102255
* CastExpr should not hold a pointer to the base path. More cleanup.Anders Carlsson2010-04-241-1/+1
| | | | llvm-svn: 102249
* Update prototypes.Benjamin Kramer2010-04-241-3/+4
| | | | llvm-svn: 102241
* Recommit r102215, this time being more careful to only set the "principalJohn McCall2010-04-241-0/+5
| | | | | | | declaration" (i.e. the only which will actually be looked up) to have the non-member-operator bit. llvm-svn: 102231
* Teach clang -fixit to modify files in-place, or -fixit=suffix to create newNick Lewycky2010-04-243-137/+40
| | | | | | files with the additional suffix in the middle. llvm-svn: 102230
* Revert r102215. This causes clang crash while compiling a test case from gdb ↵Devang Patel2010-04-241-5/+0
| | | | | | testsuite. llvm-svn: 102224
* Improve the AST representation of Objective-C @try/@catch/@finallyDouglas Gregor2010-04-233-24/+36
| | | | | | | | | | statements. Instead of the @try having a single @catch, where all of the @catch's were chained (using an O(n^2) algorithm nonetheless), @try just holds an array of its @catch blocks. The resulting AST is slightly more compact (not important) and better represents the actual language semantics (good). llvm-svn: 102221
* Add an InheritancePath parameter to the ImplicitCastExpr constructor.Anders Carlsson2010-04-231-4/+4
| | | | llvm-svn: 102218
* Transition the last acceptable-result filter kind in LookupResult over to useJohn McCall2010-04-231-0/+5
| | | | | | a simple IDNS mask by introducing a namespace for non-member operators. llvm-svn: 102215
* More work toward implementingFariborz Jahanian2010-04-232-10/+7
| | | | | | NeXt's -fno-constant-cfstrings - wip. llvm-svn: 102189
* add GNU C++ include paths for Fedora 11,12 x86_64,Chris Lattner2010-04-231-1/+13
| | | | | | patch by mikem! llvm-svn: 102177
* Check for -fno-constant-cfstrings consistencyFariborz Jahanian2010-04-222-0/+4
| | | | | | in pch. llvm-svn: 102130
* Support for -fno-constant-cfstrings option - wip.Fariborz Jahanian2010-04-221-0/+4
| | | | llvm-svn: 102112
* Sink the _GNU_SOURCE definition down into the target configuration,Douglas Gregor2010-04-211-24/+0
| | | | | | | and only define it where we know we need it---Linux and Cygwin. Thanks to Chris for the prodding. llvm-svn: 101989
* Overhaul the AST representation of Objective-C message sendDouglas Gregor2010-04-213-229/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expressions, to improve source-location information, clarify the actual receiver of the message, and pave the way for proper C++ support. The ObjCMessageExpr node represents four different kinds of message sends in a single AST node: 1) Send to a object instance described by an expression (e.g., [x method:5]) 2) Send to a class described by the class name (e.g., [NSString method:5]) 3) Send to a superclass class (e.g, [super method:5] in class method) 4) Send to a superclass instance (e.g., [super method:5] in instance method) Previously these four cases where tangled together. Now, they have more distinct representations. Specific changes: 1) Unchanged; the object instance is represented by an Expr*. 2) Previously stored the ObjCInterfaceDecl* referring to the class receiving the message. Now stores a TypeSourceInfo* so that we know how the class was spelled. This both maintains typedef information and opens the door for more complicated C++ types (e.g., dependent types). There was an alternative, unused representation of these sends by naming the class via an IdentifierInfo *. In practice, we either had an ObjCInterfaceDecl *, from which we would get the IdentifierInfo *, or we fell into the case below... 3) Previously represented by a class message whose IdentifierInfo * referred to "super". Sema and CodeGen would use isStr("super") to determine if they had a send to super. Now represented as a "class super" send, where we have both the location of the "super" keyword and the ObjCInterfaceDecl* of the superclass we're targetting (statically). 4) Previously represented by an instance message whose receiver is a an ObjCSuperExpr, which Sema and CodeGen would check for via isa<ObjCSuperExpr>(). Now represented as an "instance super" send, where we have both the location of the "super" keyword and the ObjCInterfaceDecl* of the superclass we're targetting (statically). Note that ObjCSuperExpr only has one remaining use in the AST, which is for "super.prop" references. The new representation of ObjCMessageExpr is 2 pointers smaller than the old one, since it combines more storage. It also eliminates a leak when we loaded message-send expressions from a precompiled header. The representation also feels much cleaner to me; comments welcome! This patch attempts to maintain the same semantics we previously had with Objective-C message sends. In several places, there are massive changes that boil down to simply replacing a nested-if structure such as: if (message has a receiver expression) { // instance message if (isa<ObjCSuperExpr>(...)) { // send to super } else { // send to an object } } else { // class message if (name->isStr("super")) { // class send to super } else { // send to class } } with a switch switch (E->getReceiverKind()) { case ObjCMessageExpr::SuperInstance: ... case ObjCMessageExpr::Instance: ... case ObjCMessageExpr::SuperClass: ... case ObjCMessageExpr::Class:... } There are quite a few places (particularly in the checkers) where send-to-super is effectively ignored. I've placed FIXMEs in most of them, and attempted to address send-to-super in a reasonable way. This could use some review. llvm-svn: 101972
* change FullSourceLoc to have a *const* SourceManager&, eliminatingChris Lattner2010-04-201-1/+1
| | | | | | a const_cast. llvm-svn: 101940
* push some source location information down through the compiler,Chris Lattner2010-04-205-19/+11
| | | | | | | | into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. llvm-svn: 101939
* Keep proper source location information for the type in an Objective-CDouglas Gregor2010-04-202-2/+2
| | | | | | @encode expression. llvm-svn: 101907
* Introduce a limit on the depth of the template instantiation backtraceDouglas Gregor2010-04-202-0/+9
| | | | | | | | | | | | | | | | we will print with each error that occurs during template instantiation. When the backtrace is longer than that, we will print N/2 of the innermost backtrace entries and N/2 of the outermost backtrace entries, then skip the middle entries with a note such as: note: suppressed 2 template instantiation contexts; use -ftemplate-backtrace-limit=N to change the number of template instantiation entries shown This should eliminate some excessively long backtraces that aren't providing any value. llvm-svn: 101882
* Keep track of the actual storage specifier written on a variable orDouglas Gregor2010-04-193-19/+37
| | | | | | | | function declaration, since it may end up being changed (e.g., "extern" can become "static" if a prior declaration was static). Patch by Enea Zaffanella and Paolo Bolzoni. llvm-svn: 101826
* Fix -Wcast-qual warnings.Dan Gohman2010-04-193-4/+6
| | | | llvm-svn: 101786
* Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are notChandler Carruth2010-04-173-0/+15
| | | | | | | | implemented precisely the same as GCC, but the distinction GCC makes isn't useful to represent. This allows parsing code which uses GCC-specific keywords ('asm', etc.) without parsing in a fully GNU mode. llvm-svn: 101667
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-171-2/+2
| | | | llvm-svn: 101666
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-172-24/+24
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficientNick Lewycky2010-04-161-1/+1
| | | | | | | implementation today but is the right place if we want to make it faster some day. llvm-svn: 101521
* Remove this hard-coded buffer size. In some basic experiments preprocessingDan Gohman2010-04-161-2/+0
| | | | | | | | | | | large files, this doesn't seem significantly better than just letting raw_ostream pick a buffer size. This code predates raw-ostream's automatic buffer sizing; in fact, it was introduced as part of the code which would eventually become raw_ostream. llvm-svn: 101473
* Only predefine the macro _GNU_SOURCE in C++ mode when we're on aDouglas Gregor2010-04-161-2/+24
| | | | | | | platform that typically uses glibc. Fixes a Boost.Thread compilation failure. llvm-svn: 101450
* Fix a bug in caret-line-pruning logic that only happens when we have aDouglas Gregor2010-04-161-3/+10
| | | | | | | | source line wider than the terminal where the associated fix-it line is longer than the caret line. Previously, we would crash in this case, which was rather unfortunate. Fixes <rdar://problem/7856226>. llvm-svn: 101426
* clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.Daniel Dunbar2010-04-151-0/+9
| | | | llvm-svn: 101370
* Teach -fixit to modify all of its inputs instead of just the main file, unlessNick Lewycky2010-04-152-31/+76
| | | | | | -fixit-at specified a particular fixit to fix, or the -o flag was used. llvm-svn: 101359
* Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM ↵Daniel Dunbar2010-04-151-0/+5
| | | | | | | | option parser. - Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang. llvm-svn: 101354
* Once we've emitted a fatal diagnostic, keep counting errors but with aDouglas Gregor2010-04-141-1/+2
| | | | | | | | | | | | | | separate count of "suppressed" errors. This way, semantic analysis bits that depend on the error count to determine whether problems occured (e.g., some template argument deduction failures, jump-scope checking) will not get confused. The actual problem here is that a missing #include (which is a fatal error) could cause the jump-scope checker to run on invalid code, which it is not prepared to do. Trivial fix for both <rdar://problem/7775941> and <rdar://problem/7775709>. llvm-svn: 101297
* Improve line marker directive locations, patch by Jordy RoseChris Lattner2010-04-141-1/+1
| | | | llvm-svn: 101226
* make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."Chris Lattner2010-04-141-3/+6
| | | | | | when avoiding paste. Patch by David Peixotto! llvm-svn: 101218
* implement altivec.h and a bunch of support code, patch by Anton Yartsev!Chris Lattner2010-04-141-0/+4
| | | | llvm-svn: 101215
* Use ASTVector instead of std::vector for the Exprs in InitListExpr. PerformanceTed Kremenek2010-04-132-9/+11
| | | | | | | measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance change, but now the vector isn't leaked. llvm-svn: 101195
* make the rewriter add a #ifndef around the #define of __attribute__.Chris Lattner2010-04-131-0/+2
| | | | | | | Without it, there is no reason for a compiler that supports it to emit the dead static globals that the rewriter labels attribute(used). llvm-svn: 101149
* Add a cc1 option to specify the max number of nodes the analyzer can explore.Zhongxing Xu2010-04-132-1/+3
| | | | llvm-svn: 101120
* add frontend support for -fdata-sections and -ffunction-sections,Chris Lattner2010-04-132-0/+10
| | | | | | patch by Sylvere Teissier! llvm-svn: 101108
* cache the PP's SourceManager.Chris Lattner2010-04-131-5/+6
| | | | llvm-svn: 101099
* make the preprocessor listen to linemarker directives in -E mode,Chris Lattner2010-04-131-10/+14
| | | | | | PR6101. This is based on a patch and testcase by Jordy Rose! llvm-svn: 101097
* fix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic Chris Lattner2010-04-121-2/+7
| | | | | | | | actually turned it on. If a diag is produced by a warning which is an extension but defaults to on, and has no warning group, don't print any option info. llvm-svn: 101071
* add haiku support, patch by Paul Davey!Chris Lattner2010-04-111-0/+43
| | | | llvm-svn: 100982
* Rename -dump-record-layouts to -fdump-record-layouts now that the option ↵Anders Carlsson2010-04-101-1/+1
| | | | | | behaves like aa flag. llvm-svn: 100943
* Turn access control on by default in -cc1.John McCall2010-04-091-4/+3
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* On Windows, disable the modification-time check for files used inDouglas Gregor2010-04-091-2/+8
| | | | | | | | precompiled headers and/or when reading the contents of the file into memory. These checks seem to be causing spurious regression-test failures on Windows. llvm-svn: 100866
* Fixes a regression caused by implementing cstyle methods Fariborz Jahanian2010-04-091-1/+2
| | | | | | for objc. llvm-svn: 100865
OpenPOWER on IntegriCloud