Commit Graph

115143 Commits

Author SHA1 Message Date
Craig Topper 25ea4e5ad3 Add X86 BEXTR instruction. This instruction uses VEX.vvvv to encode Operand 3 instead of Operand 2 so needs special casing in the disassembler and code emitter. Ultimately, should pass this information from tablegen
llvm-svn: 142105
2011-10-16 03:51:13 +00:00
Chandler Carruth 3eb8b54e71 Persist the TextDiagnostic object across multiple diagnostics as long as
the SourceManager doesn't change, and the source files don't change.
This greatly simplifies the interfaces and interactions. The lifetime of
the TextDiagnostic object forms the 'session' over which we attempt to
condense and deduplicate information in diagnostics.

llvm-svn: 142104
2011-10-16 02:57:39 +00:00
NAKAMURA Takumi bccadaf1a3 CMake: Introduce LLVM_CLANG_SOURCE_DIR, "tools/clang" by default. Clang will not be built if LLVM_CLANG_SOURCE_DIR="" or ${LLVM_CLANG_SOURCE_DIR}/CMakeLists.txt is not found.
llvm-svn: 142103
2011-10-16 02:54:33 +00:00
NAKAMURA Takumi 914f1924e0 autoconf: Introduce --with-clang-srcdir, to build out-of-tree clang as tools/clang on tools/Makefile.
llvm-svn: 142102
2011-10-16 02:54:26 +00:00
NAKAMURA Takumi 2c1a4cce4c Makefile.rules: Let OPTIONAL_PARALLEL_DIRS accept out-of-tree absolute path.
llvm-svn: 142101
2011-10-16 02:54:19 +00:00
NAKAMURA Takumi 4f539312df test/Makefile: Inspect $(PROJ_OBJ_ROOT)/tools/clang/Makefile instead of $(PROJ_SRC_ROOT)/tools/clang for "check-all".
llvm-svn: 142100
2011-10-16 02:54:14 +00:00
Bill Wendling 6b8fe982e0 Add a helper script to create branches and tag release candidates.
llvm-svn: 142098
2011-10-16 02:03:18 +00:00
Bill Wendling 90f98e704d Add a script that helps merge changes into a release branch.
llvm-svn: 142097
2011-10-16 01:54:03 +00:00
Craig Topper 6c8879e3ab Add X86 feature detection support for BMI instructions. Added new cpuid function for accessing leafs with sub leafs specified in ECX. Also added code to keep track of the max cpuid level supported in both basic and extended leaves and qualified the existing cpuid calls and the new call to leaf 7.
llvm-svn: 142089
2011-10-16 00:21:51 +00:00
Chandler Carruth ab4c1daab1 Clean up the names of all the TextDiagnostic methods (and even a static
function) to agree with the coding conventions, and in one case have
a bit more information in it.

llvm-svn: 142088
2011-10-15 23:54:09 +00:00
Chandler Carruth 07c346d220 Move two functions out of the public interface that shouldn't have ever
been there. Also delete their redundant doxyments in favor of those in
the source file. I'm putting the doxyments for private and static
helpers into the implementation file, and only the public interface
doxyments into the header. If folks have strong opinions about this type
of split, feel free to chime in, I'm happy to re-organize.

llvm-svn: 142087
2011-10-15 23:48:02 +00:00
Chandler Carruth a302885b33 Graduate the TextDiagnostic interface to its own header and source file,
making it accessible to anyone from the Frontend library. Still a good
bit of cleanup to do here, but its a good milestone. This ensures that
*all* of the functionality needed to implement the DiagnosticConsumer is
exposed via the generic interface in some form. No sneaky re-use of
static functions.

llvm-svn: 142086
2011-10-15 23:43:53 +00:00
Chandler Carruth 76576db69d Move the message printing to a class-static function so that it can be
part of the TextDiagnostic interface without requiring a full instance.

llvm-svn: 142085
2011-10-15 22:57:29 +00:00
Chandler Carruth 3fc93892ae Move the diagnostic level printing into a class static helper. This will
allow the TextDiagnosticPrinter to continue using it even if
TextDiagnostic is implemented in a separate file.

llvm-svn: 142084
2011-10-15 22:49:21 +00:00
Chandler Carruth 3b73f83d3a Rationalize the last bit of "arbitrary" state that is carried between
diagnostics to control suppression of redundant information. It now
follows the same model as all the other state, and has a bit more clear
semantics.

This is making the duality of the state a bit annoying, and I've added
a FIXME to resolve it. The problem is that I need to lift the
TextDiagnostic up into an externally visible layer before that can
happen.

llvm-svn: 142083
2011-10-15 22:39:16 +00:00
Craig Topper 27ad12539d Add support for X86 blsr, blsmsk, and blsi instructions. Required extra work because these are the first VEX encoded instructions to use the reg field as an opcode extension.
llvm-svn: 142082
2011-10-15 20:46:47 +00:00
Nadav Rotem 45f0f87af5 The CELL backend cannot select patterns for vector trunc-store and shl on v2i64; CellSPU/shift_ops.ll fails when promoting elements.
llvm-svn: 142081
2011-10-15 20:05:17 +00:00
Nadav Rotem 097106b77a ARM cannot select a pattern for trunc-store v4i8; /ARM/vrev.ll fails when promoting elements.
llvm-svn: 142080
2011-10-15 20:03:12 +00:00
Nick Lewycky 772060c5b8 Fix extra whitespace in comment.
llvm-svn: 142079
2011-10-15 19:36:45 +00:00
Fariborz Jahanian c27cd1b881 Avoid duplicate unavailbility diagnostics in objc++.
// rdar://10268422

llvm-svn: 142078
2011-10-15 19:18:36 +00:00
Nico Weber 3a46b375e2 Let this test pass even if 'int' is somewhere in its directory path.
On my machine, grep matched:

  ; ModuleID = '/Volumes/MacintoshHD2/src/chrome-git/src/third_party/llvm/test/Linker/2011-08-18-unique-debug-type.ll'
  !9 = metadata !{i32 720932, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]

Explicitly filter out the ModuleID line.

llvm-svn: 142077
2011-10-15 18:07:16 +00:00
Benjamin Kramer a518b22d6b Place static initializers on linux into the ".text.startup" section, so the linker can group them together for performance.
This only has an effect with fairly new binutils (2.21.51 or later). Other ELF targets probably want this as well, but on BSDs binutils is usually old so it doesn't matter.

llvm-svn: 142076
2011-10-15 17:53:33 +00:00
Fariborz Jahanian 7c386f838a obj-c++: allow the getter/setter to return/take parameters
by reference. // rdar://10188258

llvm-svn: 142075
2011-10-15 17:36:49 +00:00
Peter Collingbourne a8e267b398 Internals manual: eliminate mention of System library
llvm-svn: 142074
2011-10-15 16:59:24 +00:00
Benjamin Kramer 5fb5e3b384 SmallVector -> array
llvm-svn: 142073
2011-10-15 13:28:31 +00:00
Benjamin Kramer 22d24c287a Replace vectors with arrays.
llvm-svn: 142072
2011-10-15 12:20:02 +00:00
Chandler Carruth 02b88ca980 Neither 'Warning' nor 'NonNote' was a good name for this location...
It's the last include-stack-root we tried to walk up. Use a better name
and better doxyments for it.

llvm-svn: 142071
2011-10-15 12:12:44 +00:00
Chandler Carruth c9b1c180ff Nuke a bunch of FIXMEs that are now fixed. =] Also, remove the now-dead
TextDiagnosticPrinter argument to the TextDiagnostic helper class. This
cements the proper ordering of things: TextDiagnostic is now a viable
stand-alone class for emitting pretty-printed textual diagnostics to
a terminal.

llvm-svn: 142070
2011-10-15 12:07:49 +00:00
Chandler Carruth 636b2501bb Sink the include stack printing into the generic text diagnostic
utility. This is a particularly nice win because it removes a pile of
parameters from these routines. Also name them a bit better. I'm trying
to follow the pattern of 'emit' routines writing directly to what is
expected to be the final output, while 'print' routines take a output
stream argument and can be used to build up intermediate buffers, etc.

Also, fix a bug I spotted by inspection from my last commit where
'LastLoc' and 'LastNonNoteLoc' were reversed. It's really scary that
this didn't trigger a single test failure. Will be working on tests for
more of this functionality now.

llvm-svn: 142069
2011-10-15 12:07:47 +00:00
Chandler Carruth 3d262187f6 Rationalize some of how the locations of prior diagnostics are tracked
across emissions.

1) The include stack printing is conditioned on non-note diagnostics,
   not just on warning diagnostics.
2) Those should be full source locations as they're tied to a source
   manager.
3) We should pass in the prior state to the TextDiagnostic constructor,
   allow it to mutate as diagnostics are emitted, and then cache the
   final state before tearing it down.

Some of this remains incomplete, specifically #3 isn't finished for the
non-note location. That'll come when the include stack printing sinks
down a level.

This also highlights how *completely* bug-ridden this code is. For
example, we currently do all these comparisons of a FullSourceLoc and
a SourceLocation... which silently does a SourceLocation to
SourceLocation comparison, completely disregarding the source manager
from whence one of the arguments came. Oops! Good thing in practice this
wasn't important, but it could in theory be suppressing caret
diagnostics in a second TU on a single clang invocation. I'm hoping to
hammer these bugs out as the refactorings occur, although for so many of
them it's really unlikely I can dream up a test case that would show the
potentially buggy behavior.

llvm-svn: 142067
2011-10-15 11:44:27 +00:00
Duncan Sands f537a6edd4 Don't replace all dominated uses if there is only one use, since that
use can't be dominated, saving one domtree lookup.

llvm-svn: 142066
2011-10-15 11:13:42 +00:00
Chandler Carruth 99eb7dc85f Sink the EmitDiagnosticLoc method down to the generic TextDiagnostic
interface now that its only caller is there.

llvm-svn: 142065
2011-10-15 11:09:23 +00:00
Chandler Carruth c38c7b1b1a Sink the non-caret diagnostic logic down and out of the diagnostic
consumer. The TextDiagnostic interface now has a generic entry point for
emitting a diagnostic which uses a minimal interface that should be
compatible with StoredDiagnostics such as are available in libclang etc.

Some unfortunate shuffling of static functions as things get relocated.
Also some unfortunate public interface points added to
TextDiagnosticPrinter, but those are the next bits to get moved so they
won't last long.

llvm-svn: 142064
2011-10-15 11:09:19 +00:00
Chandler Carruth 342327cac2 Simplify the interface of a helper method in the TextDiagnosticPrinter
to operate directly on the source location and ranges associated with
a diagnostic rather than digging them out of the diagnostic. This had
a side benefit of cleaning up its code a tiny bit by using the ArrayRef
interface.

No functionality changed.

llvm-svn: 142063
2011-10-15 10:48:19 +00:00
Chandler Carruth 0360600811 Add an accessor for all of the ranges in a diagnostic as an ArrayRef.
This will simplify a number of calls in the diagnostic printing going
forward.

llvm-svn: 142062
2011-10-15 10:48:13 +00:00
Benjamin Kramer 4d681d7dc4 Add a bad char heuristic to StringRef::find.
Based on Horspool's simplified version of Boyer-Moore. We use a constant-sized table of
uint8_ts to keep cache thrashing low, needles bigger than 255 bytes are uncommon anyways.

The worst case is still O(n*m) but we do a lot better on the average case now.

llvm-svn: 142061
2011-10-15 10:08:31 +00:00
Nadav Rotem ebe13bc3f1 Move the legalization of vector loads and stores into LegalizeVectorOps. In some
cases we need the second type-legalization pass in order to support all cases.

llvm-svn: 142060
2011-10-15 07:41:10 +00:00
Andrew Trick fd4ca0f4ac Fix SCEVExpander assert during LSR: "argument of incompatible type".
Just because we're dealing with a GEP doesn't mean we can assert the
SCEV has a pointer type. The fix is simply to ignore the SCEV pointer
type, which we really didn't need.
Fixes PR11138 webkit crash.

llvm-svn: 142058
2011-10-15 06:19:55 +00:00
Richard Smith e41fac231c Add -Wc++98-compat warning for deduced 'auto' type specifier.
llvm-svn: 142057
2011-10-15 05:42:01 +00:00
Richard Smith 5d164bc5e0 Implement -Wc++98-compat warnings for the parser.
llvm-svn: 142056
2011-10-15 05:09:34 +00:00
NAKAMURA Takumi ea97a05fc5 Revert r142046, "Fix for llvm::sys::getHostTriple on Windows. Instead of relying on the triple"
It extremely breaks builds when optimization is enabled. Twine should not hold temporary objects.

By the way, I might feel sad if I saw "i786-" "i1586-" or "iF86-".

llvm-svn: 142055
2011-10-15 04:29:36 +00:00
Richard Smith da2611199b Refactor: remove redundant check for 'final' specifier when parsing class/struct definition.
llvm-svn: 142054
2011-10-15 04:21:46 +00:00
Richard Smith 6b46488ff2 Testcase for half of r142048.
llvm-svn: 142053
2011-10-15 04:11:50 +00:00
Ted Kremenek 6afe37294f Convert stray doxygen comments to regular comments. They logically represent the fields in FunctionProtoType.
llvm-svn: 142052
2011-10-15 04:06:55 +00:00
Ted Kremenek 8670a41a54 Revert "Move doxygen comments to pair with the actual values."
John convinced me this wasn't the right thing to do.  I'll follow up with a second
commit to make these non-doxygen comments.

llvm-svn: 142051
2011-10-15 04:06:52 +00:00
Richard Smith a34f9c7fd5 Use of override keywords in C++98 should produce a warning by default.
llvm-svn: 142050
2011-10-15 04:01:16 +00:00
Richard Smith bffe88027c Rename an ExtWarn to ext_ for consistency.
llvm-svn: 142049
2011-10-15 03:55:17 +00:00
Richard Smith 2db9652b5a Don't warn about use of 'final' in ill-formed C++98 code which didn't use
'final', and don't accept (then silently discard) braced init lists in C++98
new-expressions.

llvm-svn: 142048
2011-10-15 03:38:41 +00:00
Eli Friedman 27ef75b0be Handle an edge case involving the conditional operator and throw expressions. PR10582.
llvm-svn: 142047
2011-10-15 02:10:40 +00:00
Chad Rosier 559b8f2ae9 Fix for llvm::sys::getHostTriple on Windows. Instead of relying on the triple
from config.h, it discovers the triple based on the execution environment.

Patch by Aaron Ballman <aaron@aaronballman.com>

llvm-svn: 142046
2011-10-15 02:10:06 +00:00