Commit Graph

120997 Commits

Author SHA1 Message Date
Chandler Carruth 143f2f6e37 Try to unbreak the FreeBSD toolchain's detection of 32-bit targets
inside a 64-bit freebsd machine with the 32-bit compatibility layer
installed. The FreeBSD image always has the /usr/lib32 directory, so
test for the more concrete existence of crt1.o. Also enhance the tests
for freebsd to clarify what these trees look like and exercise the new
code.

Thanks to all the FreeBSD folks for helping me understand what caused
the failure and how we might fix it. =] That helps a lot. Also, yay
build bots.

llvm-svn: 148981
2012-01-25 21:32:31 +00:00
Kaelyn Uhrain 9afaf793b3 Allow typo correction to be disabled in BuildOverloadedCallExpr variant.
This suppresses typo correction for auto-generated call expressions such
as to 'begin' or 'end' within a C++0x for-range statement.

llvm-svn: 148979
2012-01-25 21:11:35 +00:00
Chandler Carruth cf705b21e2 Restore a tiny bit of functionality that I completely overlooked in the
Linux toolchain selection -- sorry folks. =] This should fix the Hexagon
toolchain.

However, I would point out that I see why my testing didn't catch this
-- we have no tests for Hexagon. ;]

llvm-svn: 148977
2012-01-25 21:03:58 +00:00
Johnny Chen 11c00fc7b2 Move argument checking/manipulation into the front of the function.
llvm-svn: 148974
2012-01-25 20:50:21 +00:00
Kaelyn Uhrain 77e21fca3c Avoid correcting unknown identifiers to types where types aren't allowed.
Pass a typo correction callback object from ParseCastExpr to
Sema::ActOnIdExpression to be a bit more selective about what kinds of
corrections will be allowed for unknown identifiers.

llvm-svn: 148973
2012-01-25 20:49:08 +00:00
Johnny Chen 8d24390cad Clearify some comment.
llvm-svn: 148972
2012-01-25 20:29:26 +00:00
Johnny Chen 78e49e7fee Cleanup docstring and remove dead code.
llvm-svn: 148971
2012-01-25 20:25:38 +00:00
Argyrios Kyrtzidis be6d89d255 [driver] Do emit the diagnostics when CompilerInvocation::CreateFromArgs() fails.
llvm-svn: 148970
2012-01-25 20:00:43 +00:00
Jim Grosbach 82f76d1275 ARM assemly parsing and validation of IT instruction.
"Although a Thumb2 instruction, the IT mnemonic shall be permitted in
ARM mode, and the condition verified to match the condition code(s)
on the following instruction(s)."

PR11853

llvm-svn: 148969
2012-01-25 19:52:01 +00:00
Howard Hinnant 113cf60e0b These commits are intended to be temporary in nature and are to facilitate the testing of libc++abi.dylib at this point in time.
llvm-svn: 148967
2012-01-25 19:27:42 +00:00
Howard Hinnant db97064263 Add comment documenting extension behavior of __cxa_get_globals_fast().
llvm-svn: 148966
2012-01-25 19:19:13 +00:00
Howard Hinnant 5d6b9d28f7 cxa_guard.cpp didn't quite make it on the last commit: Restricted headers to cxa_guard.cpp and abort_messsage.h, and added a comment regarding reentrancy brought up by John McCall. Thanks John.
llvm-svn: 148965
2012-01-25 19:02:40 +00:00
Nick Lewycky 0e496cddf0 Use precomputed BB size instead of BB->size().
llvm-svn: 148964
2012-01-25 18:54:13 +00:00
Howard Hinnant 2449538500 Restricted headers to cxa_guard.cpp and abort_messsage.h, and added a comment regarding reentrancy brought up by John McCall. Thanks John.
llvm-svn: 148963
2012-01-25 18:50:55 +00:00
Kaelyn Uhrain 8edb17d753 Add custom callback object for typo correction in BuildRecoveryCallExpr.
The new callback, in addition to limiting which keywords to include in
the pool of typo correction candidates, also filters out non-keyword
candidates that don't refer to (template) functions that accept the
number of arguments that are present for the call being recovered.

llvm-svn: 148962
2012-01-25 18:37:44 +00:00
Douglas Gregor 0dd22bc4d6 When we're substituting into a function parameter pack and expect to
get a function parameter pack (but don't due to weird substitutions),
complain. Fixes the last bit of PR11848.

llvm-svn: 148960
2012-01-25 16:15:54 +00:00
Chandler Carruth f7bf3db070 The Linux pattern of adding all the search paths that exist doesn't seem
to suit the FreeBSD folks. Take them back to something closer to the old
behavior. We test whether the /usr/lib32 directory exists (within the
SysRoot), and use it if so, otherwise use /usr/lib.

FreeBSD folks, let me know if this causes any problems, or if you have
further tweaks.

llvm-svn: 148953
2012-01-25 11:24:24 +00:00
Chandler Carruth 1ccbed88fc Remove the 'ToolTriple' concept from the NetBSD toolchain along with my
gross hack to provide it from my previous patch removing HostInfo. This
was enshrining (and hiding from my searches) the concept of storing and
diff-ing the host and target triples. We don't have the host triple
reliably available, so we need to merely inspect the target system. I've
changed the logic in selecting library search paths for NetBSD to match
what I provided for FreeBSD -- we include both search paths, but put the
32-bit-on-64-bit-host path first so it trumps.

NetBSD maintainers, you may want to tweak this, or feel free to ask me
to tweak it. I've left a FIXME here about the challeng I see in fixing
this properly.

llvm-svn: 148952
2012-01-25 11:18:20 +00:00
Chandler Carruth 2886ba2352 Delete still more remnants of the now dead HostInfo. The janitoring will
continue until cleanliness improves.

llvm-svn: 148951
2012-01-25 11:03:35 +00:00
Chandler Carruth 2ad5de1f72 Delete the driver's HostInfo class. This abstraction just never really
did anything. The two big pieces of functionality it tried to provide
was to cache the ToolChain objects for each target, and to figure out
the exact target based on the flag set coming in to an invocation.
However, it had a lot of flaws even with those goals:
 - Neither of these have anything to do with the host, or its info.
 - The HostInfo class was setup as a full blown class *hierarchy* with
   a separate implementation for each "host" OS. This required
   dispatching just to create the objects in the first place.
 - The hierarchy claimed to represent the host, when in fact it was
   based on the target OS.
 - Each leaf in the hierarchy was responsible for implementing the flag
   processing and caching, resulting in a *lot* of copy-paste code and
   quite a few bugs.
 - The caching was consistently done based on architecture alone, even
   though *any* aspect of the targeted triple might change the behavior
   of the configured toolchain.
 - Flag processing was already being done in the Driver proper,
   separating the flag handling even more than it already is.

Instead of this, we can simply have the dispatch logic in the Driver
which previously created a HostInfo object create the ToolChain objects.
Adding caching in the Driver layer is a tiny amount of code. Finally,
pulling the flag processing into the Driver puts it where it belongs and
consolidates it in one location.

The result is that two functions, and maybe 100 lines of new code
replace over 10 classes and 800 lines of code. Woot.

This also paves the way to introduce more detailed ToolChain objects for
various OSes without threading through a new HostInfo type as well, and
the accompanying boiler plate. That, of course, was the yak I started to
shave that began this entire refactoring escapade. Wheee!

llvm-svn: 148950
2012-01-25 11:01:57 +00:00
Chandler Carruth 013820fea3 Add some really minimalist freebsd testing trees and use them in the
freebsd test so that it's behavior isn't dependent on the filesystem of
the host running the tests. This should revive the build bots at least.
The tests and the trees still need a lot of love to make them as useful
and easy to maintain as linux-ld.c.

llvm-svn: 148949
2012-01-25 10:50:34 +00:00
Jean-Daniel Dupas d5f7ef48e2 Add support for const pointer to literal-objc string as format attribute.
llvm-svn: 148948
2012-01-25 10:35:33 +00:00
Chris Lattner 33633a90a0 fix a bug I introduced in r148929, this is not a splat!
Thanks to Eli for noticing.

llvm-svn: 148947
2012-01-25 09:56:22 +00:00
Nick Lewycky 3c3feaf40c Gracefully degrade precision in branch probability numbers.
llvm-svn: 148946
2012-01-25 09:43:14 +00:00
Chandler Carruth b65b111d24 Switch the ToolChain types to all store a Driver reference rather than
a HostInfo reference. Nothing about the HostInfo was used by any
toolchain except digging out the driver from it. This just makes that
a lot more direct. The change was accomplished entirely mechanically.
It's one step closer to removing the shim full of buggy copy/paste code
that is HostInfo.

llvm-svn: 148945
2012-01-25 09:12:06 +00:00
NAKAMURA Takumi 509b7af017 test/CodeGen/avx-builtins.c: Fix more for -Asserts.
llvm-svn: 148944
2012-01-25 09:11:21 +00:00
NAKAMURA Takumi ccca11a3de Fixup r148926, for -Asserts.
llvm-svn: 148943
2012-01-25 08:58:21 +00:00
Chandler Carruth cb91619e5c Remove the TargetTriple object that I added to the Driver recently. This
helped stage the refactoring of things a bit, but really isn't the right
place for it. The driver may be responsible for compilations with many
different targets. In those cases, having a target triple in the driver
is actively misleading because for many of those compilations that is
not actually the triple being targeted.

This moves the last remaining users of the Driver's target triple to
instead use the ToolChain's target triple. The toolchain has a single,
concrete target it operates over, making this a more stable and natural
home for it.

llvm-svn: 148942
2012-01-25 08:49:21 +00:00
Nick Lewycky 70d50ee8fb Support pointer comparisons against constants, when looking at the inline-cost
savings from a pointer argument becoming an alloca. Sometimes callees will even
compare a pointer to null and then branch to an otherwise unreachable block!
Detect these cases and compute the number of saved instructions, instead of
bailing out and reporting no savings.

llvm-svn: 148941
2012-01-25 08:27:40 +00:00
Chandler Carruth 25442b8e72 Have FreeBSD use even more of the same smarts as Linux is now using for
adding search paths. Add them only when they exist, and prefix the paths
with the sysroot. This will allow targeting a FreeBSD sysroot on
a non-FreeBSD host machine, and perhaps more importantly should allow
testing the FreeBSD driver's behavior similarly to the Linux tests with
a fake tree of files in the regression test suite.

I don't have FreeBSD systems handy to build up the list of files that
should be used here, but this is the basic functionality and I'm hoping
Roman or someone from the community can contribute the actual test
cases.

llvm-svn: 148940
2012-01-25 08:10:33 +00:00
Chandler Carruth f4826e28b9 Switch FreeBSD to just include both '/usr/lib32' and '/usr/lib' in the
search paths for 32-bit targets. This avoids having to detect which is
expected for the target system, and the linker should DTRT, and take the
32-bit libraries from the first one when applicable. Thanks to Roman
Divacky for sanity checking this.

llvm-svn: 148939
2012-01-25 08:04:15 +00:00
Chandler Carruth a1f1fd3b60 Switch the Linux C++ standard library header search logic over to use
the GCC installation's multiarch suffix now that it is exposed.

llvm-svn: 148938
2012-01-25 08:04:13 +00:00
Chandler Carruth 44d69d9c25 Revert a tiny bit of r148553 which extended LLVM's function attributes
to 64-bits, and added a new attribute in bit #32. Specifically, remove
this new attribute from the enum used in the C API. It's not yet clear
what the best approach is for exposing these new attributes in the
C API, and several different proposals are on the table. Until then, we
can simply not expose this bit in the API at all.

Also, I've reverted a somewhat unrelated change in the same revision
which switched from "1 << 31" to "1U << 31" for the top enum. While "1
<< 31" is technically undefined behavior, implementations DTRT here.
However, MS and -pedantic mode warn about non-'int' type enumerator
values. If folks feel strongly about this I can put the 'U' back in, but
it seemed best to wait for the proper solution.

llvm-svn: 148937
2012-01-25 07:40:15 +00:00
Evan Cheng ef6a2ea216 Update hasProperty comment.
llvm-svn: 148936
2012-01-25 07:38:48 +00:00
Chandler Carruth 866faab4db Make a major refactoring to how the GCC installation detection works.
The fundamental shift here is to stop making *any* assumptions about the
*host* triple. Where these assumptions you ask? Why, they were in one of
the two target triples referenced of course. This was the single biggest
place where the previously named "host triple" was actually used as
such. ;] The reason we were reasoning about the host is in order to
detect the use of '-m32' or '-m64' flags to change the target. These
flags shift the default target only slightly, which typically means
a slight deviation from the host. When using these flags, the GCC
installation is under a different triple from the one actually targeted
in the compilation, and we used the host triple to find it.

Too bad that wasn't even correct. Consider an x86 Linux host which has
a PPC64 cross-compiling GCC toolchain installed. This toolchain is also
configured for multiarch compiling and can target PPC32 with eth '-m32'
flag. When targeting 'powerpc-linux-gnu' or some other PPC32 triple, we
have to look for the PPC64 variant of the triple to find the GCC
install, and that triple is neither the host nor target.

The new logic computes the multiarch's alternate triple from the target
triple, and looks under both sides. It also looks more aggressively for
the correct subdirectory of the GCC installation, and exposes the
subdirectory in a nice programmatic way. This '/32' or '/64' suffix is
something we can reuse in many other parts of the toolchain.

An important note -- while this likely fixes a large category of
cross-compile use cases, that's not my primary goal, and I've not done
testing (or added test cases) for scenarios that may now work. If
someone else wants to try more interesting PPC cross compiles, I'd love
to have reports. But my focus is on factoring away the references to the
"host" triple. The refactoring is my goal, and so I'm mostly relying on
the existing (pretty good) test coverage we have here.

Future patches will leverage this new functionality to factor out more
and more of the toolchain's triple manipulation.

llvm-svn: 148935
2012-01-25 07:21:38 +00:00
Chris Lattner 6705883ad8 use Constant::getAggregateElement to simplify a bunch of code.
llvm-svn: 148934
2012-01-25 06:48:06 +00:00
Craig Topper 7834900950 Custom lower PSIGN and PSHUFB intrinsics to their corresponding target specific nodes so we can remove the isel patterns.
llvm-svn: 148933
2012-01-25 06:43:11 +00:00
Craig Topper 80df922f2f Re-enable test that was broken by r148919
llvm-svn: 148932
2012-01-25 06:23:23 +00:00
Chris Lattner 7e683d10a8 constify some methods and add a new Constant::getAggregateElement
helper method for the common operation of extracting an element
out of a constant aggregate.

llvm-svn: 148931
2012-01-25 06:16:32 +00:00
Ted Kremenek a163d0b5de Fix -fmacro-backtrace-limit=0 to show the entire macro backtrace.
llvm-svn: 148930
2012-01-25 06:07:15 +00:00
Chris Lattner 47a86bdbe2 use ConstantVector::getSplat in a few places.
llvm-svn: 148929
2012-01-25 06:02:56 +00:00
Chris Lattner f07b612313 disable this test for now.
llvm-svn: 148928
2012-01-25 05:38:06 +00:00
Craig Topper ce4f9c5668 Custom lower phadd and phsub intrinsics to target specific nodes. Remove the patterns that are no longer necessary.
llvm-svn: 148927
2012-01-25 05:37:32 +00:00
Chris Lattner 2d6b7b91b9 reapply r148902:
"use the new ConstantVector::getSplat method where it makes sense."

Also simplify a bunch of code to use the Builder->getInt32 instead
of doing it the hard and ugly way.  Much more progress could be made
here, but I don't plan to do it.

llvm-svn: 148926
2012-01-25 05:34:41 +00:00
Chris Lattner 29969cd86a fix broken testcase.
llvm-svn: 148925
2012-01-25 05:29:46 +00:00
Chris Lattner e9eed29b5b reapply r148901 with a crucial fix.
"Introduce a new ConstantVector::getSplat constructor function to 
simplify a really common case."

llvm-svn: 148924
2012-01-25 05:19:54 +00:00
Eli Friedman 5995489d27 Fix a crash for an edge case of the GNU ?: extension.
llvm-svn: 148923
2012-01-25 05:04:17 +00:00
Craig Topper 5bcf070e68 Remove AVX 256-bit unaligned load intrinsics. 128-bit versions had been removed a while ago.
llvm-svn: 148922
2012-01-25 04:42:03 +00:00
Eli Friedman 0ce4de4183 Fix r148920 to what I actually meant to commit.
llvm-svn: 148921
2012-01-25 04:35:06 +00:00
Eli Friedman 6601b550c0 Add missing check for placeholders.
llvm-svn: 148920
2012-01-25 04:29:24 +00:00