Commit Graph

129238 Commits

Author SHA1 Message Date
Nick Kledzik 920ceddf80 Fix Sphinx warning. Patch by Sean Silva
llvm-svn: 158678
2012-06-18 20:24:47 +00:00
Michael J. Spencer 626a4ecf3a [docs] Port FAQ over to Sphinx.
Patch by Mikael Lyngvig!

llvm-svn: 158677
2012-06-18 20:21:38 +00:00
Matt Beaumont-Gay 50911a9d60 Move a few static functions from DiagnosticRenderer.cpp into SourceManager.
This simplifies the code a little bit, since these functions all took a
SourceManager parameter and called a bunch of methods on it, and makes
the functions available to other users.

llvm-svn: 158676
2012-06-18 20:12:05 +00:00
Marshall Clow d3e2a76ca4 Added accessors for getting coff_relocation info
llvm-svn: 158675
2012-06-18 19:47:16 +00:00
Jim Grosbach cb540f5cff ARM: Define generic HINT instruction.
The NOP, WFE, WFI, SEV and YIELD instructions are all hints w/
a different immediate value in bits [7,0]. Define a generic HINT
instruction and refactor NOP, WFI, WFI, SEV and YIELD to be
assembly aliases of that.

rdar://11600518

llvm-svn: 158674
2012-06-18 19:45:50 +00:00
Jim Grosbach 9ec06a15d6 TableGen: AsmMatcher missing-features list minimization.
When returning a 'cannot match due to missing CPU features' error code,
if there are multiple potential matches with different feature sets,
return the smallest set of missing features from the alternatives as
that's most likely to be the one that's desired.

llvm-svn: 158673
2012-06-18 19:45:46 +00:00
Simon Atanasyan 15c4aed428 Add mipsel-* to the list of targets recognized by configure script.
llvm-svn: 158670
2012-06-18 19:06:25 +00:00
Joerg Sonnenberger 8524f0ba2f Declare some variables unsigned to avoid signed vs unsigned mismatches.
This exploits the relative order of the arguments and/or checks already
made in the functions.

llvm-svn: 158669
2012-06-18 18:51:13 +00:00
James Dennett 7b33767275 Documentation cleanup:
* Escaped "::" where needed to prevent Doxygen trying to make links;
* Updated one mention of C++0x to refer to C++11;
* Fixed a \brief summary to make it somewhat concise.

llvm-svn: 158667
2012-06-18 18:42:20 +00:00
Jordan Rose edff020011 Allow internal decls in inline functions if the function is in the main file.
This handles the very common case of people writing inline functions in their
main source files and not tagging them as inline. These cases should still
behave as the user intended. (The diagnostic is still emitted as an extension.)

I'm reworking this code anyway to account for C++'s equivalent restriction in
[basic.def.odr]p6, but this should get some bots back to green.

llvm-svn: 158666
2012-06-18 17:49:58 +00:00
Fariborz Jahanian 9563a053de document _has_feature(objc_default_synthesize_properties).
// rdar://11676972

llvm-svn: 158665
2012-06-18 17:13:17 +00:00
Michael J. Spencer e2f493604a [VS Toolchain] Correctly forward -l linker inputs to link.exe.
Patch by Nikola Smiljanic!

llvm-svn: 158664
2012-06-18 16:56:04 +00:00
Nuno Lopes e881ce2ef6 fix PR13071 / rdar://problem/11634669 :
crash on invalid function decl with alloc_size attribute

llvm-svn: 158663
2012-06-18 16:39:04 +00:00
Nuno Lopes e44e93aa6b alloc_size attribute: there's nothing wrong with alloc_size(1,1). It just means the function allocates x^2 bytes. GCC also accepts this syntax
llvm-svn: 158662
2012-06-18 16:27:56 +00:00
Alexis Hunt a0e54d453b Handle C++11 attribute namespaces automatically.
Now, as long as the 'Namespaces' variable is correct inside Attr.td, the
generated code will correctly admit a C++11 attribute only when it has the
appropriate namespace(s).

llvm-svn: 158661
2012-06-18 16:13:52 +00:00
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