Commit Graph

129023 Commits

Author SHA1 Message Date
Nuno Lopes b7c941bad9 add the 'alloc' metadata node to represent the size of offset of buffers pointed to by pointers.
This metadata can be attached to any instruction returning a pointer

llvm-svn: 158660
2012-06-18 16:04:04 +00:00
Joel Jones 3237ce737e This change handles a another case for generating the bic instruction
when a compile time constant is known.  This occurs when implicitly zero 
extending function arguments from 16 bits to 32 bits.  The 8 bit case doesn't
need to be handled, as the 8 bit constants are encoded directly, thereby
not needing a separate load instruction to form the constant into a register.

<rdar://problem/11481151>

llvm-svn: 158659
2012-06-18 14:51:32 +00:00
Alexey Samsonov 8516014790 [Sanitizer] add internal_strncmp to sanitizer libc
llvm-svn: 158658
2012-06-18 14:34:59 +00:00
Alexey Samsonov cf7d233ac0 [TSan] kill some linux-specific code in favor of code in common runtime: reuse wrappers for mmap routines, ProcessMaps iterator, thread stack calculation
llvm-svn: 158657
2012-06-18 09:42:39 +00:00
Chandler Carruth a1da0bf5ef Add a regression test for the bug exposed by r158087, which has been
temporarily reverted.

This test is annoyingly overspecified, but I don't know of another way
to thoroughly test the saving and restoring of the registers. While this
will have to be adjusted even with the issue fixed in order to re-apply
r158087, those adjustments should very clearly indicate that it is still
correct (%esp getting restored prior to pops), whereas without it, this
case can easily slip under the radar.

Still, any suggestions for improvements are very welcome.

All credit to Matt Beaumont-Gay for reducing this out of an insane
Address Sanitizer crash to a reasonably small seg-faulting C program
when built with -mstackrealign. I just reduced it to IR, which was much
simpler. =]

llvm-svn: 158656
2012-06-18 09:15:04 +00:00
Alexey Samsonov 58a3c58ec9 [Sanitizer] move different wrappers from TSan to common sanitizer runtime
llvm-svn: 158655
2012-06-18 08:44:30 +00:00
Chandler Carruth 2cc11fd8c7 Temporarily revert r158087.
This patch causes problems when both dynamic stack realignment and
dynamic allocas combine in the same function. With this patch, we no
longer build the epilog correctly, and silently restore registers from
the wrong position in the stack.

Thanks to Matt for tracking this down, and getting at least an initial
test case to Chad. I'm going to try to check a variation of that test
case in so we can easily track the fixes required.

llvm-svn: 158654
2012-06-18 07:03:12 +00:00
Michael J. Spencer f97bd8c9cb [MSExtensions] Add support for __forceinline.
__forceinline is a combination of the inline keyword and __attribute__((always_inline))

llvm-svn: 158653
2012-06-18 07:00:48 +00:00
Richard Smith 7b3f322517 Extend the error recovery for a template-argument-list terminated by '>>' to
also deal with '>>>' (in CUDA), '>=', and '>>='. Fix the FixItHints logic to
deal with cases where the token is followed by an adjacent '=', '==', '>=',
'>>=', or '>>>' token, where a naive fix-it would result in a differing token
stream on a re-lex.

llvm-svn: 158652
2012-06-18 06:11:04 +00:00
Joerg Sonnenberger 5c98e1fb24 Don't warn about address-to-member used as part of initialisation, if
the member expression is in parentheses.

llvm-svn: 158651
2012-06-17 23:10:39 +00:00
NAKAMURA Takumi e0d4a7c5be TableGen.cmake: Fix to work without LLVM_COMMON_DEPENDS.
llvm-svn: 158650
2012-06-17 15:41:56 +00:00
NAKAMURA Takumi f32f4f46b4 diagtool/CMakeLists.txt: Add missing tblgen'd dependency, ClangDiagnosticIndexName.
llvm-svn: 158649
2012-06-17 15:41:44 +00:00
Benjamin Kramer a520de10c9 For reasons I can't fathom MSVC supports ULL but not LLU suffixes on long long integer literals.
llvm-svn: 158648
2012-06-17 14:53:53 +00:00
Benjamin Kramer 6bc197e4cd Add missing unittest files to the cmake build.
llvm-svn: 158647
2012-06-17 14:42:49 +00:00
Benjamin Kramer ae7f793785 Remove SmallMap unittests, unbreaking the build.
I don't know how useful these are for SmallDenseMap, I'll leave that decision to Chandler.

llvm-svn: 158646
2012-06-17 12:46:18 +00:00
Benjamin Kramer 23a9c3e090 Bring the return value of SmallVector::insert in line with std::vector::insert.
It always returns the iterator for the first inserted element, or the passed in
iterator if the inserted range was empty. Flesh out the unit test more and fix
all the cases it uncovered so far.

llvm-svn: 158645
2012-06-17 12:46:13 +00:00
Chandler Carruth b539b47793 Remove SmallMap, and the several files that were used to implement it.
We have SmallDenseMap now that has more correct and predictable
semantics, even though it is a more narrow abstraction.

llvm-svn: 158644
2012-06-17 12:07:42 +00:00
Benjamin Kramer 371b9b0e99 SmallVector: return a valid iterator for the rare case of inserting an empty range into a SmallVector.
Patch by Johannes Schaub!

llvm-svn: 158643
2012-06-17 11:52:22 +00:00
Chandler Carruth 7a39ad6444 Switch users of SmallMap to use SmallDenseMap instead.
The most important change here is that the destructor and copy
constructor for StoredDeclsList will now reliably be run. Previously,
the destructors at least were missed in some cases. See the LLVM commits
discussions for why SmallMap is broken and going away.

llvm-svn: 158642
2012-06-17 11:47:03 +00:00
Chandler Carruth 4de807a552 Add a unit test for 'swap', and fix a pile of bugs in
SmallDenseMap::swap.

First, make it parse cleanly. Yay for uninstantiated methods.

Second, make the inline-buckets case work correctly. This is way
trickier than it should be due to the uninitialized values in empty and
tombstone buckets.

Finally fix a few typos that caused construction/destruction mismatches
in the counting unittest.

llvm-svn: 158641
2012-06-17 11:28:13 +00:00
Chandler Carruth d599a8c4d1 Disable a particular assertion on MSVC... I'm deeply disturbed by its
implementation of the class layout for the V8 type.

llvm-svn: 158640
2012-06-17 10:36:49 +00:00
Chandler Carruth a1be842f98 Add tests for *DenesMap for both key and value types' construction and
destruction and fix a bug in SmallDenseMap they caught.

This is kind of a poor-man's version of the testing that just adds the
addresses to a set on construction and removes them on destruction. We
check that double construction and double destruction don't occur.
Amusingly enough, this is enough to catch a lot of SmallDenseMap issues
because we spend a lot of time with fixed stable addresses in the inline
buffer.

The SmallDenseMap bug fix included makes grow() not double-destroy in
some cases. It also fixes a FIXME there, the code was pretty crappy. We
now don't have any wasted initialization, but we do move the entries in
inline bucket array an extra time. It's probably a better tradeoff, and
is much easier to get correct.

llvm-svn: 158639
2012-06-17 10:33:51 +00:00
Chandler Carruth 20dd838ae5 Introduce a SmallDenseMap container that re-uses the existing DenseMap
implementation.

This type includes an inline bucket array which is used initially. Once
it is exceeded, an array of 64 buckets is allocated on the heap. The
bucket count grows from there as needed. Some highlights of this
implementation:

- The inline buffer is very carefully aligned, and so supports types
  with alignment constraints.
- It works hard to avoid aliasing issues.
- Supports types with non-trivial constructors, destructors, copy
  constructions, etc. It works reasonably hard to minimize copies and
  unnecessary initialization. The most common initialization is to set
  keys to the empty key, and so that should be fast if at all possible.

This class has a performance / space trade-off. It tries to optimize for
relatively small maps, and so packs the inline bucket array densely into
the object. It will be marginally slower than a normal DenseMap in a few
use patterns, so it isn't appropriate everywhere.

The unit tests for DenseMap have been generalized a bit to support
running over different map implementations in addition to different
key/value types. They've then been automatically extended to cover the
new container through the magic of GoogleTest's typed tests.

All of this is still a bit rough though. I'm going to be cleaning up
some aspects of the implementation, documenting things better, and
adding tests which include non-trivial types. As soon as I'm comfortable
with the correctness, I plan to switch existing users of SmallMap over
to this class as it is already more correct w.r.t. construction and
destruction of objects iin the map.

Thanks to Benjamin Kramer for all the reviews of this and the lead-up
patches. That said, more review on this would really be appreciated. As
I've noted a few times, I'm quite surprised how hard it is to get the
semantics for a hashtable-based map container with a small buffer
optimization correct. =]

llvm-svn: 158638
2012-06-17 09:05:09 +00:00
Chandler Carruth a4d4075360 Add some somewhat exhaustive tests of sizeof properties of this horrible
construct just for my sanity.

llvm-svn: 158637
2012-06-17 09:05:04 +00:00
James Dennett eb9cb80810 Documentation cleanup:
* Escaped # characters in Doxygen comments as needed;
* Exposed summaries using the \brief command.

llvm-svn: 158636
2012-06-17 07:39:14 +00:00
James Dennett 819ff4f11c Documentation cleanup:
* Escaped # characters in Doxygen comments as needed;
* Added/reformatted \brief docs;
* Used a \file comment to document the file (MultipleIncludeOpt.h).

llvm-svn: 158635
2012-06-17 06:45:58 +00:00
James Dennett d6f1723838 Documentation cleanup:
* For Doxygen, escaped "::std" as "\::std";
* For humans, fixed "namespaecs" to "namespaces".

llvm-svn: 158634
2012-06-17 06:43:43 +00:00
James Dennett 9000bfee46 Documentation cleanup: add parameter name to \param
llvm-svn: 158633
2012-06-17 05:54:50 +00:00
James Dennett 28c68d7ddd Documentation cleanup:
* Escaped # characters in Doxygen comments;
* Added \brief markup to provide summaries.

llvm-svn: 158632
2012-06-17 05:49:13 +00:00
James Dennett 6b47ebb0ae Documentation cleanup: escaped a < character in a Doxygen comment.
llvm-svn: 158631
2012-06-17 05:37:49 +00:00
James Dennett f124387119 Documentation cleanup: fix two typos, rief -> brief and Descripts -> Describes
llvm-svn: 158630
2012-06-17 05:33:25 +00:00
James Dennett d9faf1c7db Documentation cleanup: escaping #define in Doxygen comments
llvm-svn: 158629
2012-06-17 04:46:54 +00:00
James Dennett 3d5e4593de Documentation cleanup:
* Added \file, \brief and \verbatim...\endverbatim markup, particularly around
  documentation of subset of the grammars that are being parsed.

llvm-svn: 158628
2012-06-17 04:36:28 +00:00
James Dennett e16f3aa5d7 Documentation cleanup: escaping # characters and adding \brief markup
llvm-svn: 158627
2012-06-17 04:08:41 +00:00
James Dennett 946de9ea28 Documentation cleanup: escaping # characters and adding \brief markup
llvm-svn: 158626
2012-06-17 04:04:08 +00:00
James Dennett 1de0f83360 Documentation cleanup: escape #undef in Doxygen comments.
llvm-svn: 158625
2012-06-17 04:00:01 +00:00
James Dennett 3da20af2d5 Documentation cleanup: delete an erroneous use of \link
llvm-svn: 158624
2012-06-17 03:58:59 +00:00
Pete Cooper 33ee6c9bf1 Now that SROA can form alloca's for dynamic vector accesses, further improve it to be able to replace operations on these vector alloca's with insert/extract element insts
llvm-svn: 158623
2012-06-17 03:58:26 +00:00
James Dennett 464df1bfd5 Documentation cleanup: typo fix, \briaf -> \brief
llvm-svn: 158622
2012-06-17 03:57:24 +00:00
James Dennett cb620fdd03 Documentation cleanup: Add missing parameter name to a \param command
llvm-svn: 158621
2012-06-17 03:52:50 +00:00
James Dennett 9cb0a0887b Documentation cleanup: escape "::" to eliminate a Doxygen warning
llvm-svn: 158620
2012-06-17 03:43:32 +00:00
James Dennett 6deb84137c Documentation cleanup: Use \brief for summaries, and escape # characters.
llvm-svn: 158619
2012-06-17 03:41:54 +00:00
James Dennett f442d2455b Documentation cleanup:
* Removed docs for Lexer::makeFileCharRange from Lexer.cpp, as they're in
  the header file;
* Reworked the documentation for SkipBlockComment so that it doesn't confuse
  Doxygen's comment parsing;
* Added another summary with \brief markup.

llvm-svn: 158618
2012-06-17 03:40:43 +00:00
James Dennett 3dc736da32 Documentation cleanup: fixing a typo from my previous 'fix'.
llvm-svn: 158617
2012-06-17 03:36:08 +00:00
James Dennett 1cc2203286 Documentation cleanup: added \verbatim...\verbatim markup to fix the
formatting of Doxygen's output for StringLiteralParser::StringLiteralParser.

llvm-svn: 158616
2012-06-17 03:34:42 +00:00
James Dennett 18a6d793e7 Documentation cleanup:
* Escaped #pragma (as \#pragma) in Doxygen comments;
* Added \code...\endcode annotations around code examples in doc comments.

llvm-svn: 158615
2012-06-17 03:26:26 +00:00
James Dennett 87a2acf1eb Documentation cleanup: escaped # characters in Doxygen comments.
llvm-svn: 158614
2012-06-17 03:22:59 +00:00
Hal Finkel 49bba70ec5 For compatibility with gcc, accept -maltivec as an alias of -faltivec.
llvm-svn: 158613
2012-06-17 02:29:23 +00:00
Michael J. Spencer aedfa6a36b Fix MSVC compat. MSVC doesn't have bzero.
Although the code is not valid to begin with. It is trying to do a raw memory
copy of a non standard-layout type. nameoffset is not guaranteed to directly
follow cmdsize.

This should be properly fixed.

llvm-svn: 158612
2012-06-17 01:18:44 +00:00
Richard Smith a8d4f229a6 -Wuninitialized bugfix: when entering the scope of a variable with no
initializer, it is uninitialized, even if we may be coming from somewhere where
it was initialized.

llvm-svn: 158611
2012-06-16 23:34:14 +00:00