summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Seriously ugly hack, part 2Douglas Gregor2011-10-051-1/+7
| | | | llvm-svn: 141181
* Seriously ugly hack to try to get the Windows builders back onlineDouglas Gregor2011-10-051-2/+15
| | | | llvm-svn: 141180
* Introduce a simple file-based locking protocol for on-demand moduleDouglas Gregor2011-10-051-0/+259
| | | | | | | | | | | creation, so that only a single Clang instance will rebuild a given module at once (and the others will wait). We still don't clean up the lock files when we crash, which is a rather unfortunate problem. I'll handle that next, and there is certainly a *lot* of room for further improvements. llvm-svn: 141179
* Added a flag to identify resolved overloaded function references.Abramo Bagnara2011-10-0510-70/+160
| | | | llvm-svn: 141171
* Refactor the analysis of C++ cast expressions so that evenJohn McCall2011-10-054-212/+208
| | | | | | | | C-style and functional casts are built in SemaCXXCast.cpp. Introduce a helper class to encapsulate most of the random state being passed around, at least one level down. llvm-svn: 141170
* Use the InstalledDir correctly, and test it correctly as well. =/ ShouldChandler Carruth2011-10-051-1/+1
| | | | | | have noticed this previously, sorry. llvm-svn: 141167
* Fix doxygen comment.Eric Christopher2011-10-051-2/+2
| | | | llvm-svn: 141165
* Teach Clang to cope with GCC installations that have unusual patchChandler Carruth2011-10-051-3/+5
| | | | | | | "versions". Currently, these are just dropped on the floor, A concrete version number will always win out. llvm-svn: 141159
* Implement the feature I was originally driving toward when I startedChandler Carruth2011-10-051-0/+1
| | | | | | | | | | | | | | this saga. Teach the driver to detect a GCC installed along side Clang using the existing InstalledDir support in the Clang driver. This makes a lot of Clang's behavior more automatic when it is installed along side GCC. Also include the first test cases (more to come, honest) which test both the install directory behavior, and the version sorting behavior to show that we're actually searching for the best candidate GCC installation now. llvm-svn: 141145
* c: assignment/init of a function pointer whose function(s)Fariborz Jahanian2011-10-052-5/+8
| | | | | | | | return to one which does not return (has noreturn attribute) should warn as it is an unsafe assignment. // rdar://10095762 c++ already handles this. This is the c version. llvm-svn: 141141
* Don't allow an rvalue reference to bind to the result of a calling aDouglas Gregor2011-10-041-0/+23
| | | | | | | | | conversion function whose result type is an lvalue reference. The initialization code already handled this properly, but overload resolution was allowing the binding. Fixes PR11003 / <rdar://problem/10233078>. llvm-svn: 141137
* [analyzer] Removing more references to CheckerContext::getNodeBuilder(): ask ↵Anna Zaks2011-10-041-6/+2
| | | | | | CheckerContext to generate the nodes. llvm-svn: 141136
* Hoist the other messy part out of an inner loop and into a helperChandler Carruth2011-10-041-43/+45
| | | | | | function, cleaning up along the way. llvm-svn: 141134
* Hoist the first chunk of this into a helper function. No functionalityChandler Carruth2011-10-041-55/+68
| | | | | | change. llvm-svn: 141131
* [driver] Improve r141053 by only emitting the warning if the original inputChad Rosier2011-10-041-15/+1
| | | | | | | was assembly. Otherwise, something like -save-temps causes the integrated assembler to warn. llvm-svn: 141127
* Fix Windows+MinGW which introduces noise into path separators.Chandler Carruth2011-10-041-1/+5
| | | | | | | | | There should be a better solution to this; Michael and I are continuing to discuss exactly what it should be. The one solution I'm very uncomfortable with is making the FileCheck tests use a regex for each path separator. llvm-svn: 141126
* Now that multiple prefixes are much cheaper to search for GCCChandler Carruth2011-10-041-0/+1
| | | | | | | | | | | | | installations, support them when installed directly under the system root ('/lib/gcc/...' essentially). With this, Clang can correctly detect and use a cross-compiling GCC installation within a system root and use it. Again, test cases will be coming in later commits, as I'm going to write a few test cases that exercise nearly all of this logic. llvm-svn: 141121
* Rework the search for a GCC installation still further. This combinesChandler Carruth2011-10-041-50/+85
| | | | | | | | | | | | | | | | | | | | | | two fundamental changes, as they ended up being interrelated. The first is to walk from the root down through the filesystem so that we prune subtrees which do not exist early. This greatly reduces the filesystem traffic of this routine. We store the "best" GCC version we encounter, and look at all of the GCC installations available. Also, we look through GCC versions by scanning the directory rather than using a hard-coded list of versions. This has several benefits. It makes it much more efficient to locate a GCC installation even in the presence of a large number of different options by simply reading the directory once. It also future-proofs us as new GCC versions are released and installed. We no longer have a hard coded list of version numbers, and won't need to manually updated it. We can still filter out known-bad versions as needed. Currently I've left in filtering for all GCC installations prior to 4.1.1, as that was the first one supported previously. llvm-svn: 141120
* Basic/Diagnostics: Apparently, #pragma ... diagnostic is intended to overrideDaniel Dunbar2011-10-041-0/+7
| | | | | | | | the command line options (at least according to GCC's documentation). GCC 4.2 didn't appear to actually do this, but it seems like that has been fixed in later release, so we will follow the docs. llvm-svn: 141119
* [analyzer] Removing references to CheckerContext::getNodeBuilder(): checkers ↵Anna Zaks2011-10-045-13/+13
| | | | | | can obtain block count directly from the Context. llvm-svn: 141112
* Remove a nonsensical bit of code from ↵Eli Friedman2011-10-041-3/+0
| | | | | | | | InitListChecker::getStructuredSubobjectInit which was increasing the reserved size for an init list past its maximum possible size. Fixes PR11056, a case where we were reserving a bunch of memory for arrays that was never actually used. (No testcase because I don't think we have any way to actually write a testcase for this; the chosen value of NumElements has no effects on anything other than performance and memory usage.) llvm-svn: 141106
* objc: Turn diagnostic on property type mismatch inFariborz Jahanian2011-10-041-1/+1
| | | | | | continuation class into warning. // rdar://10231514 llvm-svn: 141100
* [analyzer] Remove unused methods, add comments to others.Anna Zaks2011-10-041-1/+1
| | | | llvm-svn: 141098
* Fix include path detection on Fedora 15 with GCC 4.6.1. Patch by Arthur Haas.Justin Holewinski2011-10-041-1/+6
| | | | llvm-svn: 141086
* Add bitmaps for strong / weak ivar layout (GNUstep runtime).David Chisnall2011-10-041-18/+102
| | | | llvm-svn: 141085
* Add a comment explaining that I have a better plan for implementing theChandler Carruth2011-10-041-0/+2
| | | | | | | | | | | | | GCC installation search that requires fewer filesystem operations. Planning to implement that next as the current approcah while thorough (and so far looks correct) does a very unfortunate number of filesystem operations. I'm motivated to fix this in no small part because I would like to support a much larger space of triples and GCC versions, which would explode the current algorithm. llvm-svn: 141073
* Invert the loop for detecting installed GCC trees. This make the loopChandler Carruth2011-10-041-36/+19
| | | | | | | | | | | | | | | | | | | find the newest GCC available, among other goodness. It makes the entire system much less prone to error from prefixes and/or system roots pruning early the set of triples and GCC versions available. Also, improve some comments and simplify the forms of some of the loops. This causes the driver to stat directories more often than is strictly necessary, but the alternatives which I looked at that still accomplished this goal needed quite a bit more code and were likely not much faster. Test cases for this, now that our behavior here is significantly more principled and predictable, should come tomorrow as I walk back through VMs looking for edge cases that are missed after this. llvm-svn: 141072
* Fuse the two halves of the GCC installation detection. This isChandler Carruth2011-10-041-54/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | significantly cleaner (IMO) and more principled. We now walk down each layer of the directory hierarchy searching for the GCC install. This change does in fact introduce a significant behavior change in theory, although in practice I don't know of any distro that will be impacted by it negatively, and Debian may (untested) get slightly better through it. Specifically, the logic now looks exhaustively for patterns such as: /usr/lib/<triple>/gcc/<triple> Previously, this would only be selected if there was *also* a '/usr/lib/gcc/<triple>' directory, or if '<triple>' were the excat DefaultHostTriple in the driver. There is a 4-deep nested loop here, but it doesn't do terribly many filesystem operations, as we skip at each layer of that layer's directory doesn't exist. There remains a significant FIXME in this logic: it would be much better to first build up a set of candidate components for each of the four layers with a bottom-up pruning such as this, but then select the final installation using a top-down algorithm in order to find the newest GCC installation available, regardless of which particular path leads to it. llvm-svn: 141071
* Mark calls to objc_retainBlock that don't result from castsJohn McCall2011-10-043-13/+52
| | | | | | to id so that we can still optimize them appropriately. llvm-svn: 141064
* Rip out flags for controlling C++ "production mode" separately.Bob Wilson2011-10-042-5/+2
| | | | | | | This is old leftover cruft from the days when C++ was not yet ready for prime time. llvm-svn: 141063
* Improve location fidelity of objc decls.Argyrios Kyrtzidis2011-10-046-43/+49
| | | | | | | | -Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl. -Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the class name, not the location of '@'. llvm-svn: 141061
* Factor the data apart from the logic of locating various GCCChandler Carruth2011-10-041-45/+63
| | | | | | | | | | | | | | | | | | | | | | | | | installations. This first selects a set of prefixes and a set of compatible triples for the current architecture. Once selected, we drive the search with a single piece of code. This code isn't particularly efficient as it stands, but its only executed once. I'm hoping as I clean up the users of this information, it will also slowly become both cleaner and more efficient. This also changes the behavior slightly. Previously, we had an ad-hoc list of prefixes and triples, and we only looked for some triples beneath specific prefixes and vice versa. This has led to lots of one-off patches to support triple X, or support lib dir Y. Even without going to a fully universal driver, we can do better here. This patch makes us always look first in either 'lib32' or 'lib64' on 32- or 64-bit hosts (resp.). However, we *always* look in 'lib'. Currently I have one lingering problem with this strategy. We might find a newer or better GCC version under a different (but equally compatible) triple. Fundamentally, this loop needs to be fused with the one below. That's my next patch. llvm-svn: 141056
* [driver] Improve r141053 by only emitting the warning if the original inputChad Rosier2011-10-041-2/+12
| | | | | | | was assembly. Otherwise, something like -save-temps causes the integrated assembler to warn. llvm-svn: 141055
* [driver] Emit a warning if the user has requested debug information and we'reChad Rosier2011-10-041-1/+5
| | | | | | | using the integrated assembler. rdar://10216353 llvm-svn: 141053
* When build a module on demand, run the module-building job on aDouglas Gregor2011-10-041-3/+21
| | | | | | | separate thread with the "suitably large" stack, so we don't blow the stack when building modules recursively. llvm-svn: 141051
* Make sure SourceManager::getFileIDLoaded doesn't hang in release build ↵Argyrios Kyrtzidis2011-10-031-0/+4
| | | | | | | | because of invalid passed parameter. rdar://10210140 llvm-svn: 141048
* [analyzer] Remove redundant state (AnalysisContext pointer for every ↵Anna Zaks2011-10-031-4/+9
| | | | | | BinaryOperator tracked) from IdempotentOperationChecker. llvm-svn: 141045
* objc arc: Suppress certain arc diagnostics on unavailableFariborz Jahanian2011-10-032-2/+15
| | | | | | functions. // rdar://10186536 llvm-svn: 141037
* [analyzer] In UndefBranchChecker, use a node generator which does not create ↵Anna Zaks2011-10-031-1/+1
| | | | | | an edge/branching. (ExprEngine should be in charge of generating edges. The checkers should examine the condition and generate PostCondition node if needed.) llvm-svn: 141034
* [analyzer] Cleanup in UndefBranchChecker:Anna Zaks2011-10-031-7/+4
| | | | | | | - Remove unused FindUndefExpr::ProgramStateManager. - The Condition parameter of the callback is the terminator of the block, no need to retrieve it again. llvm-svn: 141027
* Fixed source range for template implicit instantiations.Abramo Bagnara2011-10-033-10/+25
| | | | llvm-svn: 141018
* Fixed exapnsion range for # and ##.Abramo Bagnara2011-10-036-19/+39
| | | | llvm-svn: 141012
* Refactor the detection of a GCC installation into a helper class. ThisChandler Carruth2011-10-031-157/+191
| | | | | | | | | | | | | is designed to allow the detection to record more rich information about the installation than just a single path. Mostly, the functionality remains the same. This is primarily a factoring change. However, the new factoring immediately fixes one issue where on ubuntu we didn't walk up enough layers to reach the parent lib path. I'll have a test tree for that once I finish making the Ubuntu tree work reasonably. llvm-svn: 141011
* objc++: Accessing explicit property of reference type need Fariborz Jahanian2011-10-031-1/+7
| | | | | | not bind to a temporary. Fixes //rdar://10188258 llvm-svn: 141009
* PTX: Add some basic support for OpenCL address spacesJustin Holewinski2011-10-031-0/+6
| | | | llvm-svn: 141008
* Propagate __attribute__((returns_twice)) from C to IL.Rafael Espindola2011-10-033-1/+24
| | | | llvm-svn: 141002
* Enable generic multilib support on 32bit hosts. Previously this was onlyChandler Carruth2011-10-031-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | enabled for debian hosts, which is quite odd. I think all restriction on when Clang attempts to use a multilib installation should go away. Clang is fundamentally a cross compiler. It behaves more like GCC when built as a cross compiler, and so it should just use multilib installs when they are present on the system. However, there is a very specific exemption for Exherbo, which I can't test on, so I'm leaving that in place. With this, check in a generic test tree for multilib on a 32-bit host. This stubs out many directories that most distributions don't use but that uptsream GCC supports. This is intended to be an agnostic test that the driver behaves properly compared with the GCC driver it aims for compatibility with. Also, fix a bug in the driver that this testing exposed (see!) where it was incorrectly testing the target architecture rather than the host architecture. If anyone is having trouble with the tree-structure stubs I'm creating to test this, let me know and I can revisit the design. I chose this over (for example) a tar-ball in order to make tests run faster at the small, hopefully amortized VCS cost. llvm-svn: 140999
* Teach the logic for locating an installed GCC about the system root.Chandler Carruth2011-10-031-6/+12
| | | | | | | | | | | | | | | | | This requires fixing a latent bug -- if we used the default host triple instead of an autodetected triple to locate GCC's installation, we didn't go back and fix the GCC triple. Correct that with a pile of hacks. This entire routine needs a major refactoring which I'm saving for a subsequent commit. Essentially, the detection of the GCC triple should be hoisted into the same routine as we locate the GCC installation: the first is intrinsically tied to the latter. Then the routine will just return the triple and base directory. Also start to bring the rest of the library search path logic under test, including locating crtbegin.o. Still need to test the multilib and other behaviors, but there are also bugs in the way of that. llvm-svn: 140995
* Add initial support for applying the sysroot to library search paths.Chandler Carruth2011-10-031-5/+6
| | | | | | | | | | | | | | | | | | | | This is still very much a WIP, but sysroot was completely broken before this so we are moving closer to correctness. The crux of this is that 'ld' (on Linux, the only place I'm touching here) doesn't apply the sysroot to any flags given to it. Instead, the driver must translate all the paths it adds to the link step with the system root. This is easily observed by building a GCC that supports sysroot, and checking its driver output. This patch just fixes the non-multilib library search paths. We should also use this in many other places, but first things first. This also allows us to make the Linux 'ld' test independent of the host system. This in turn will allow me to check in test tree configurations based on various different distro's configuration. Again, WIP. llvm-svn: 140990
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-0316-31/+105
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
OpenPOWER on IntegriCloud