Commit Graph

33810 Commits

Author SHA1 Message Date
Chandler Carruth f470173e46 Fix Linux libc++ usage. Somehow this slipped through during the port.
Test cases for this and all the rest of the port are still in the works,
but will wait for a fixed computer and post 3.0 merging...

llvm-svn: 143916
2011-11-07 09:01:17 +00:00
Richard Smith bcb4eb2813 Fix 32-bit build bots and remove some casting-away-const warnings.
llvm-svn: 143914
2011-11-07 07:31:09 +00:00
David Blaikie 103a3a03a2 Colorize. (this is consistent with the coloring in diagnostics.html, but perhaps that's a bit out of date because it doesn't look like current clang behavior)
llvm-svn: 143913
2011-11-07 06:28:33 +00:00
Anna Zaks 82a5b7bd25 [analyzer] Add the Checker Developer Manual to the menu.
It's still under construction but has enough info to be useful.

llvm-svn: 143912
2011-11-07 05:40:51 +00:00
Anna Zaks 5259086b8e [analyzer] Add overview and checker registration to the checker developer manual.
llvm-svn: 143911
2011-11-07 05:36:29 +00:00
John McCall ffc8ca2d84 Rip out CK_GetObjCProperty.
llvm-svn: 143910
2011-11-07 05:09:54 +00:00
Richard Smith 8081560048 Constant expression evaluation: preserve subobject designator when flattening a
core constant value down to an APValue.

llvm-svn: 143909
2011-11-07 05:07:52 +00:00
John McCall c109a259d2 Rip the ObjCPropertyRef l-value kind out of IR-generation.
llvm-svn: 143908
2011-11-07 03:59:57 +00:00
David Blaikie 8c045bcf9d Remove duplicate word & unnecessary conditional.
llvm-svn: 143907
2011-11-07 03:30:03 +00:00
David Blaikie b06c68d320 Move tests to the appropriate directory to match the spec hierarchy.
llvm-svn: 143906
2011-11-07 03:27:58 +00:00
Richard Smith a08acd8588 Allow constexpr variables' initializers to be folded in C++11 mode. This
partially undoes the revert in r143491, but does not introduce any new instances
of the underlying issue (which is not yet fixed) in code which does not use
the 'constexpr' keyword.

llvm-svn: 143905
2011-11-07 03:22:51 +00:00
Chandler Carruth efad16ad6b Begin lifting some of the one-off checking logic into generic helper
routines on the base toolchain class.

llvm-svn: 143900
2011-11-06 23:39:37 +00:00
Chandler Carruth 4c90fba23e Move the GCC installation detection logic down into the Generic_GCC
toolchain. The logic is mostly generic already, and where possible
should be made more generic. Also, it has no impact other than to expose
a set of methods which each toolchain can then query to setup their
desired configuration. These should be available to toolchains beyond
just Linux.

llvm-svn: 143899
2011-11-06 23:39:34 +00:00
Chandler Carruth 0c0981ee47 Remove an old OpenSUSE hack that is no longer needed -- it is exactly
the same as a directory added further down in the new logic.

llvm-svn: 143897
2011-11-06 23:10:49 +00:00
Chandler Carruth d0b93d6daf Remove the HasMultilib check. It was essentially useless. The driver now
looks for evidence of a multilib installation, and adds the appropriate
bits to the search paths.

llvm-svn: 143896
2011-11-06 23:09:05 +00:00
David Blaikie 876657b9c8 Correcting grammar.
llvm-svn: 143894
2011-11-06 22:28:03 +00:00
Benjamin Kramer 44f91da8cc Use StringRef's case transformation methods.
llvm-svn: 143889
2011-11-06 20:36:48 +00:00
Argyrios Kyrtzidis f233dac67c [arcmt] In GC, error for __strong/__weak on non-objc pointers.
llvm-svn: 143887
2011-11-06 18:58:23 +00:00
Argyrios Kyrtzidis 0c233fa23e [arcmt] In GC, clear redundant __strong's.
llvm-svn: 143886
2011-11-06 18:58:17 +00:00
Argyrios Kyrtzidis b458ffb226 Make sure when setting AttributesAsWritten of a property that they do not
include ownership qualifiers from the type.

llvm-svn: 143885
2011-11-06 18:58:12 +00:00
Argyrios Kyrtzidis aa421ea8af [arcmt] Make PropertiesRewriter::getPropertyType return the unqualified type.
llvm-svn: 143884
2011-11-06 18:58:07 +00:00
Argyrios Kyrtzidis e43ae79038 [arcmt] Collect all the places where GC attributes __strong/__weak occur.
llvm-svn: 143883
2011-11-06 18:58:03 +00:00
Argyrios Kyrtzidis aaa999660b [arcmt] Refactor PropertiesRewriter to use MigrationContext.
llvm-svn: 143882
2011-11-06 18:57:57 +00:00
NAKAMURA Takumi 04d581665e test/Driver/crash-cleanup.c: Remove "XFAIL: mingw32" corresponding to r143876.
llvm-svn: 143877
2011-11-06 16:59:41 +00:00
Chandler Carruth 0ad080e720 The version objects need to actually store the version strings; they
aren't guaranteed to live long enough otherwise.

llvm-svn: 143875
2011-11-06 10:51:30 +00:00
Chandler Carruth f5d4df9e44 Throw the switch and move all Linux header search over to the GCC
detection system that is providing the library paths and crt object
files.

This, modulo any bugs that need to be shaken out, resolves numerous bugs
with how we handle header paths. Here are a few that I know of:
- We no longer need to enumerate all GCC versions searched.
- OpenSUSE searched GCC versions in the wrong order.
- There were typos when selecting various patterns, etc.
- We aren't stating quite some many directories now.
- SysRoot didn't always work in a reasonable way.

I'm working on tests for this, but the tests are making me and Lit sad.
The real testing for this type of driver change is to try it out on
various distributions. I'll hit the common ones right away, and start
more thorough testing tomorrow after some sleep.

llvm-svn: 143874
2011-11-06 10:31:01 +00:00
Chandler Carruth 7e62da2845 Add a missing triple spotted by inspecting and testing of the include
path triples. Also order the 32-bit triples a bit more reasonably.

llvm-svn: 143873
2011-11-06 10:30:58 +00:00
Benjamin Kramer 5c29d69588 Unbreak gcc build.
For some reason clang and msvc accept this, but gcc doesn't.

llvm-svn: 143872
2011-11-06 09:50:13 +00:00
Chandler Carruth d95843aa8a Lift the GCCVersion type into the header file and start persisting it in
the detected GCC installation. This allows us to expose another aspect
of what we detected: the GCC version. This will be used shortly.

llvm-svn: 143871
2011-11-06 09:39:46 +00:00
Benjamin Kramer 867e40135a Make format string 64 bit safe.
llvm-svn: 143870
2011-11-06 09:34:11 +00:00
Chandler Carruth 4be70dd963 Switch some of these interfaces from std::string to StringRef and Twine.
This will facilitate further use and recombinations of them.

llvm-svn: 143869
2011-11-06 09:21:54 +00:00
NAKAMURA Takumi aee36a196a test/Driver/crash-cleanup.c: Mark as XFAIL: mingw32, for investigating.
"XFAIL: msys" has no effect, due to XFAIL inspects triplet, and msys build does not use *-msys-* but *-mingw32.

llvm-svn: 143868
2011-11-06 09:11:35 +00:00
John McCall fe96e0b6be Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions.  It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST.  I've gone ahead and simplified the
ObjC rewriter's use of properties;  other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily.  Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.

llvm-svn: 143867
2011-11-06 09:01:30 +00:00
Chandler Carruth 5b77c6c618 Take a better approach to detecting and selecting multiarch include
directories. This way we stop at the first multiarch directory found on
the system. This achieves the real intended result of pruning
non-existent directories.

llvm-svn: 143866
2011-11-06 08:21:07 +00:00
Chandler Carruth 5da43e83d2 Revert r143864, as the problem I was actually looking at can be solved
a better way. The more I think about it the more worried I am that this
hammer is simply too large. We should only be reaching out to the
filesystem when doing interesting "detection" things, not gratuitously.

Original commit message:
Start pruning down the set of flags passed to CC1 for header search.
This cleans up the CC1 invocations, and reduces the overhead there.
We're still hammering the filesystem looking for the C++ standard
libraries though.

The only reservation I have about this policy is the case of virtualized
files inside of CC1, but it's not clear what the best way to solve that
is. The Driver consistently queries the actual filesystem to make its
decisions. Changing that would be a very large undertaking. It might be
worthwhile, but it's not an immediate goal.

llvm-svn: 143865
2011-11-06 08:21:04 +00:00
Chandler Carruth 28e39d4b17 Start pruning down the set of flags passed to CC1 for header search.
This cleans up the CC1 invocations, and reduces the overhead there.
We're still hammering the filesystem looking for the C++ standard
libraries though.

The only reservation I have about this policy is the case of virtualized
files inside of CC1, but it's not clear what the best way to solve that
is. The Driver consistently queries the actual filesystem to make its
decisions. Changing that would be a very large undertaking. It might be
worthwhile, but it's not an immediate goal.

llvm-svn: 143864
2011-11-06 07:31:36 +00:00
Chandler Carruth 996cb8ad84 This test was assuming that /usr/include was in the system header search
path. That assumption should never have been true, but it was until
I fixed it. Now that its fixed, add a triple here to get correct
behavior even on Windows.

llvm-svn: 143863
2011-11-06 06:59:15 +00:00
Peter Collingbourne ae6b2f44c3 XFAIL crash-cleanup.c only on Darwin and msys.
llvm-svn: 143858
2011-11-06 04:32:01 +00:00
Chad Rosier 7533488f62 XFAIL test until Peter has a chance to investigate.
llvm-svn: 143857
2011-11-06 03:42:36 +00:00
David Blaikie a54e9643ef Fixing -g break caused by a dead reference to a temporary introduced in r143732.
llvm-svn: 143856
2011-11-06 01:53:39 +00:00
Peter Collingbourne 9b515cb0ec Add the depfile as a result file so that it is deleted if we crash,
and prevent the diagnostic preprocessor run from writing a depfile.

llvm-svn: 143846
2011-11-06 00:40:05 +00:00
Chandler Carruth 34146d8ca7 Switch Lit to directly query the driver for the builtin inclue path.
Thanks to Peter for pointing out how easy this is to do. I'm now much
happier with this solution.

llvm-svn: 143842
2011-11-05 23:29:28 +00:00
Chandler Carruth bff1e8d53d Enhance the GCC version parsing and comparison logic to handle some more
edge cases and have better behavior. Specifically, we should actually
prefer the general '4.6' version string over the '4.6.1' string, as
'4.6.2' should be able to replace it without breaking rpaths or any
other place that these paths have been embedded. Debian-based
distributions are already using a path structure with symlinks to
achieve in-place upgrades for patch versions. Now our parsing reflects
this and we select the shorter paths instead of the longer paths.

A separate issue was that we would not parse a leading patch version
number even in the presence of a suffix. The above change makes this
more problematic as it would cause a suffix being added to make us treat
the entire thing as patch-version-agnostic, which it isn't. This changes
the logic to distinguish between '4.4.x' and 4.4.1-x', and retain that
the latter has *some* patch number information. Currently, we always
bias toward the shorter and more canonical version strings. If it
becomes important we can add more Debian like rules to produce sequences
such as '4.4.1b' > '4.4.1' > '4.4.1-rc3' > '4.4.1-rc2' > '4.4.1-pre5',
but I'm very doubtful this will ever matter or be desirable.

I've made the tests for this logic a bit more interesting, and added
some specific tests for logic that is now different.

llvm-svn: 143841
2011-11-05 23:24:30 +00:00
Chandler Carruth 4dfcf4ccf4 Remove a pointless member. I have no idea why I made this not a local
variable to begin with... As I'm planning to add include root
information to this object, this would have caused confusion. It didn't
even *actually* hold the include root by the time we were done with it.

llvm-svn: 143840
2011-11-05 22:23:14 +00:00
Chandler Carruth 2a750a0801 Remove a no-longer needed helper function. Thanks for implementing this
Michael!

llvm-svn: 143839
2011-11-05 22:23:11 +00:00
Chandler Carruth 14dd5ffcbf Move the GCC installation detection helper a member of the Linux
toolchain instead of merely using it in the constructor. This will allow
us to query it when building include paths as well as the file search
paths built in the constructor. I've lifted as little of it as I could
into the header file.

Eventually this will likely sink down into some of the Generic
toolchains and be used on more platforms, but I'm starting on Linux so
I can work out all the APIs needed there, where it is easiest to test
and we have the most pressing need.

llvm-svn: 143838
2011-11-05 22:07:51 +00:00
Chandler Carruth a95f344b3e Remove support for Gentoo subversion-ebuild installed llvm-gcc libstdc++
headers. As llvm-gcc is dead, and I have no idea if this ever really
worked, I think it's time for it to go. More importantly, it makes it
harder to generalize the include search logic. If someone really wants
these to work, they can set the CPLUS_INCLUDE_PATH environment variable.

llvm-svn: 143836
2011-11-05 21:26:18 +00:00
Chandler Carruth 2837f667e0 Teach lit to ask the Clang it is running what version string to use
rather than presuming that it is 3.0. This is extra important as the
version should be 3.1, but CMake hasn't caught up with the times.
That'll be fixed in a separate commit.

llvm-svn: 143823
2011-11-05 20:55:50 +00:00
Chandler Carruth a796f53821 Move the Linux header searching from the Frontend to the Driver. This is
the first (and diff-noisiest) step to making Linux header searching
tremendously more principled and less brittle. Note that this step
should have essentially no functional impact. We still search the exact
same set of paths in the exact same order. The only change here is where
the code implementing such a search lives.

This has one obvious negative impact -- we now pass a ludicrous number
of flags to the CC1 layer. That should go away as I re-base this logic
on the logic to detect a GCC installation. I want to do this in two
phases so the bots can tell me if this step alone breaks something, and
so that the diffs of the refactoring make more sense.

llvm-svn: 143822
2011-11-05 20:17:13 +00:00
Benjamin Kramer 6ff181ef3c Try to reduce the nastiness that creeps in through Windows.h a bit.
llvm-svn: 143816
2011-11-05 17:43:55 +00:00