Commit Graph

129238 Commits

Author SHA1 Message Date
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
Benjamin Kramer d0b767f849 Disable the right instance of TheJIT, this one is only used in asserts.
llvm-svn: 158610
2012-06-16 21:55:52 +00:00
Benjamin Kramer cc7c710fb0 Guard private fields that are unused in Release builds with #ifndef NDEBUG.
llvm-svn: 158609
2012-06-16 21:48:23 +00:00
Benjamin Kramer b9f84bb0ce Guard private fields that are unused in Release builds with #ifndef NDEBUG.
llvm-svn: 158608
2012-06-16 21:48:13 +00:00
Hal Finkel 6261c2dc28 Cleanup trip-count finding for PPC CTR loops (and some bug fixes).
This cleans up the method used to find trip counts in order to form CTR loops on PPC.
This refactoring allows the pass to find loops which have a constant trip count but also
happen to end with a comparison to zero. This also adds explicit FIXMEs to mark two different
classes of loops that are currently ignored.

In addition, we now search through all potential induction operations instead of just the first.
Also, we check the predicate code on the conditional branch and abort the transformation if the
code is not EQ or NE, and we then make sure that the branch to be transformed matches the
condition register defined by the comparison (multiple possible comparisons will be considered).

llvm-svn: 158607
2012-06-16 20:34:07 +00:00
Hal Finkel fa103d3fc7 Teach BBVectorize to combine, when possible, or discard metadata when fusing instructions.
The present implementation handles only TBAA and FP metadata, discarding everything else.
For debug metadata, the current behavior is maintained (the debug metadata associated with
one of the instructions will be kept, discarding that attached to the other).

This should address PR 13040.

llvm-svn: 158606
2012-06-16 20:34:06 +00:00
Hal Finkel 16ddd4b66b Move the Metadata merging methods from GVN and make them public in MDNode.
There are other passes, BBVectorize specifically, that also need some of
this functionality.

llvm-svn: 158605
2012-06-16 20:33:37 +00:00
Rafael Espindola f70bea93e2 Implement irpc. Extracted from a patch by the PaX team. I just added the test.
llvm-svn: 158604
2012-06-16 18:03:25 +00:00
Kay Tiong Khoo 390edb0d91 *no need to pollute Intel syntax with bonus mnemonics; operand size is explicitly specified
llvm-svn: 158603
2012-06-16 17:19:49 +00:00
NAKAMURA Takumi e2d4a09305 Mips/AsmParser/CMakeLists.txt: Fix dependency.
llvm-svn: 158602
2012-06-16 15:33:52 +00:00
Benjamin Kramer aa1e8f3ae0 Update CMake build.
llvm-svn: 158601
2012-06-16 10:53:58 +00:00
Benjamin Kramer 34d6a9e57a Merge the SmallBitVector and BitVector unit tests with gtest's typed test magic and bring SmallBitVector up to date.
llvm-svn: 158600
2012-06-16 10:51:07 +00:00
Chandler Carruth 3bbbeebd33 Relax one assertion -- long double has strange alignments on lots of
platforms.

Also, remove one assertion on MSVC because it produces a completely
preposterous result, claiming something needs 12-byte alignment.

llvm-svn: 158599
2012-06-16 09:44:00 +00:00
Chandler Carruth 8710d886ee Try to reduce the size of the array used for compile-time testing by
making the bounds all '1', and chunking it a bit.

llvm-svn: 158598
2012-06-16 09:25:11 +00:00
Chandler Carruth dea00d7c5a Add support to the alignment support header for conjuring a character
array of a suitable size and alignment for any of a number of different
types to be stored into the character array.

The mechanisms for producing an explicitly aligned type are fairly
complex because this operation is poorly supported on all compilers.
We've spent a fairly significant amount of time experimenting with
different implementations inside of Google, and the one using explicitly
expanded templates has been the most robust.

Credit goes to Nick Lewycky for writing the first 20 versions or so of
this logic we had inside of Google. I based this on the only one to
actually survive. In case anyone is worried, yes we are both explicitly
re-contributing and re-licensing it for LLVM. =]

Once the issues with actually specifying the alignment are finished, it
turns out that most compilers don't in turn align anything the way they
are instructed. Testing of this logic against both Clang and GCC
indicate that the alignment constraints are largely ignored by both
compilers! I've come up with and used a work-around by wrapping each
alignment-hinted type directly in a struct, and using that struct to
align the character array through a union. This elaborate hackery is
terrifying, but I've included testing that caught a terrifying number of
bugs in every other technique I've tried.

All of this in order to implement a poor C++98 programmers emulation of
C++11 unrestricted unions in classes such as SmallDenseMap.

llvm-svn: 158597
2012-06-16 08:52:57 +00:00
NAKAMURA Takumi 8bd8ee7648 clang/lib/Basic/FileManager.cpp: Detect the root directory with PathV2. It should be better fix for PR10331, or, "clang X:\foo.c" fails.
llvm-svn: 158596
2012-06-16 06:04:10 +00:00
NAKAMURA Takumi fdf9d7197b ToolingTest.cpp: Fix r158592, runToolOnCode.FindsNoTopLevelDeclOnEmptyCode on msvc. LangOpts.MicrosoftExt still appends "class type_info;".
llvm-svn: 158595
2012-06-16 06:04:05 +00:00
Evan Cheng 773b2cd63c It's not deterministic to iterate over SmallPtrSet. Replace it with SmallSetVector. Patch by Daniel Reynaud. rdar://11671029
llvm-svn: 158594
2012-06-16 04:28:11 +00:00
Chandler Carruth a68dcb448a Work around a bug with MSVC 10 where it fails to recognize a valid use
of typename. GCC and Clang were fine with this, but MSVC won't accept
it. Fortunately, it also doesn't need it. Yuck.

Thanks to Nakamura for pointing this out in IRC.

llvm-svn: 158593
2012-06-16 03:54:11 +00:00
Meador Inge 5d3fb22bac Explicitly build __builtin_va_list.
The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.

llvm-svn: 158592
2012-06-16 03:34:49 +00:00
Eli Friedman 93ee5ca805 Fix Sema and IRGen for atomic compound assignment so it has the right semantics when promotions are involved.
(As far as I can tell, this only affects some edge cases.)

llvm-svn: 158591
2012-06-16 02:19:17 +00:00
Pete Cooper 818e9f4a26 Fix crash from r158529 on Bullet.
Dynamic GEPs created by SROA needed to insert extra "i32 0"
operands to index through structs and arrays to get to the
vector being indexed.

llvm-svn: 158590
2012-06-16 01:43:26 +00:00
Chandler Carruth 2b50c40ebd Type parameterize the DenseMap unit tests.
These were already trying to be type parameterized over different
key/value pairs. I've realized this goal using GoogleTest's typed test
functionality. This allows us to easily replicate the tests across
different key/value combinations and soon different mapping templates.

I've fixed a few bugs in the tests and extended them a bit in the
process as many tests were only applying to the int->int mapping.

llvm-svn: 158589
2012-06-16 01:31:33 +00:00
Jordan Rose b4712d142a [analyzer] Array CompoundLiteralExprs need to be treated like lvalues.
llvm-svn: 158588
2012-06-16 01:28:03 +00:00
Jordan Rose e42412be39 [analyzer] Return an UnknownVal when we try to get the binding for a VLA.
This happens in C++ mode right at the declaration of a struct VLA;
MallocChecker sees a bind and tries to get see if it's an escaping bind.
It's likely that our handling of this is still incomplete, but it fixes a
crash on valid without disturbing anything else for now.

llvm-svn: 158587
2012-06-16 01:28:00 +00:00
Chandler Carruth 144a2ac89d Lift the NumElements and NumTombstones members into the super class
rather than the base class. Add a pile of boilerplate to indirect around
this.

This is pretty ugly, but it allows the super class to change the
representation of these values, which will be key for doing
a SmallDenseMap.

Suggestions on better method structuring / naming are welcome, but keep
in mind that SmallDenseMap won't have an 'unsigned' member to expose
a reference to... =/

llvm-svn: 158586
2012-06-16 01:18:07 +00:00
Chandler Carruth d7291625cc Factor DenseMap into a base class that implements the hashtable logic,
and a derived class that provides the allocation and growth strategy.

This is the first (and biggest) step toward building a SmallDenseMap
that actually behaves exactly the same as DenseMap, and supports all the
same types and interface points with the same semantics.

llvm-svn: 158585
2012-06-16 01:05:01 +00:00
Nick Kledzik 28854f56db Wordsmithing from patch from Sean Silva
llvm-svn: 158584
2012-06-16 00:52:17 +00:00
Argyrios Kyrtzidis 33b4bfcef5 [AST/libclang] Fix the selector locations that are reported for a
method definition that has its '{' attached to the method name without
a space.

With a method like:

-(id)meth{
.....
}

the logic in ObjCMethodDecl that determined the selector locations got
confused because it was initialized based on an end location for '{' but
that end location changed to '}' after the method was finished.

Fix this by having an immutable end location for the declarator and
for getLocEnd() get the end location from the body itself.

Fixes rdar://11659739.

llvm-svn: 158583
2012-06-16 00:46:02 +00:00
Chandler Carruth 52de271da1 Don't call 'FilesToRemove[0]' when the vector is empty, even to compute
the address of it. Found by a checking STL implementation used on
a dragonegg builder. Sorry about this one. =/

llvm-svn: 158582
2012-06-16 00:44:07 +00:00
Anna Zaks f5cad928f5 Make the analyzer site a single point of reference for info
on controlling diagnostics.

llvm-svn: 158581
2012-06-16 00:30:21 +00:00
Chandler Carruth e6196eba0d Harden the Unix signals code to be more async signal safe.
This is likely only the tip of the ice berg, but this particular bug
caused any double-free on a glibc system to turn into a deadlock! It is
not generally safe to either allocate or release heap memory from within
the signal handler. The 'pop_back()' in RemoveFilesToRemove was deleting
memory and causing the deadlock. What's worse, eraseFromDisk in PathV1
has lots of allocation and deallocation paths. We even passed 'true' in
a place that would have caused the *signal handler* to try to run the
'system' system call and shell out to 'rm -rf'. That was never going to
work...

This patch switches the file removal to use a vector of strings so that
the exact text needed for the 'unlink' system call can be stored there.
It switches the loop to be a boring indexed loop, and directly calls
unlink without looking at the error. It also works quite hard to ensure
that calling 'c_str()' is safe, by ensuring that the non-signal-handling
code path that manipulates the vector always leaves it in a state where
every element has already had 'c_str()' called at least once.

I dunno exactly how overkill this is, but it fixes the
deadlock-on-double free issue, and seems likely to prevent any other
issues from sneaking up.

Sorry for not having a test case, but I *really* don't know how to test
signal handling code easily....

llvm-svn: 158580
2012-06-16 00:09:41 +00:00
Jordan Rose de409b6d5f [analyzer] Buffers passed to CGBitmapContextCreate can escape.
Specifically, although the bitmap context does not take ownership of the
buffer (unlike CGBitmapContextCreateWithData), the data buffer can be extracted
out of the created CGContextRef. Thus the buffer is not leaked even if its
original pointer goes out of scope, as long as
- the context escapes, or
- it is retrieved via CGBitmapContextGetData and freed.

Actually implementing that logic is beyond the current scope of MallocChecker,
so for now CGBitmapContextCreate goes on our system function exception list.

llvm-svn: 158579
2012-06-16 00:09:20 +00:00
Eli Friedman 13ffdd86b9 Make the ".*" operator work correctly when the base is a prvalue and the field has a non-trivial copy constructor. PR13097.
llvm-svn: 158578
2012-06-15 23:51:06 +00:00
Jakob Stoklund Olesen 38a6fbf933 Remove final verification in RABasic.
We now have a proper machine code verifier pass between register
allocation and rewriting.

llvm-svn: 158577
2012-06-15 23:48:48 +00:00
Jakob Stoklund Olesen 45c1f9976c Print out register number in InlineSpiller.
llvm-svn: 158575
2012-06-15 23:47:09 +00:00