Commit Graph

128035 Commits

Author SHA1 Message Date
Chris Lattner f7f59b15aa These tests used intrinsics with the wrong prototype. They weren't caught because
the old verifier just checked that something "was a pointer", but not that the pointee
was correct.

llvm-svn: 157544
2012-05-27 19:35:41 +00:00
Chris Lattner 4cca620c18 remove two (useless) tests that use incorrect intrinsic prototypes, detected by the new intrinsic verifier.
llvm-svn: 157543
2012-05-27 19:31:00 +00:00
Chris Lattner 9db8eed2b2 generalize this to allow any argument.
llvm-svn: 157542
2012-05-27 19:17:16 +00:00
Peter Collingbourne 4d358b55fa Have getOrCreateSubprogramDIE store the DIE for a subprogram
definition in the map before calling itself to retrieve the
DIE for the declaration.  Without this change, if this causes
getOrCreateSubprogramDIE to be recursively called on the definition,
it will create multiple DIEs for that definition.  Fixes PR12831.

llvm-svn: 157541
2012-05-27 18:36:44 +00:00
Chris Lattner f39c278384 move some code around so that Verifier.cpp can get access to the intrinsic info table.
llvm-svn: 157540
2012-05-27 18:28:35 +00:00
Benjamin Kramer 1e165f0343 DenseMap: Provide a move ctor and move semantics for operator[] and FindAndConstruct.
The only missing part is insert(), which uses a pair of parameters and I haven't
figured out how to convert it to rvalue references. It's now possible to use a
DenseMap with std::unique_ptr values :)

llvm-svn: 157539
2012-05-27 17:38:30 +00:00
Benjamin Kramer fd91e72ee2 DenseMap: Factor destruction into a common helper method.
llvm-svn: 157538
2012-05-27 17:38:18 +00:00
Fariborz Jahanian f021889036 -Wdeprecated warning to include reference (as a note)
to the declaration in this patch. // rdar://10893232

llvm-svn: 157537
2012-05-27 16:59:48 +00:00
Chris Lattner c464416107 enhance the intrinsic info table to encode what *kind* of Any argument
it is (at the cost of 45 bytes of extra table space) so that the verifier can
start using it.

llvm-svn: 157536
2012-05-27 16:39:08 +00:00
Benjamin Kramer 15d4169e7e Move-enable IntrusiveRefCntPtr.
These tend to be copied around a lot, moving it instead saves a ton of memory
accesses.

llvm-svn: 157535
2012-05-27 16:22:08 +00:00
Benjamin Kramer 443488eba9 Pass ProgramStateRef by reference.
Retain + Release on a ref counted pointer is cheap, but not free (it adds a function call in this case).

llvm-svn: 157534
2012-05-27 15:32:10 +00:00
Dmitri Gribenko 34983f25c6 Close HTML tag properly.
llvm-svn: 157533
2012-05-27 14:08:44 +00:00
Benjamin Kramer b33ffee04f Use the SelectorSet typedef more widely throughout Sema.
While there make it a SmallPtrSet.

llvm-svn: 157532
2012-05-27 13:28:52 +00:00
Benjamin Kramer 69b5a60d96 Replace some custom hash combines with the standard stuff from DenseMapInfo.
llvm-svn: 157531
2012-05-27 13:28:44 +00:00
NAKAMURA Takumi 42e5ac409c clang/unittests/Tooling/RewriterTestContext.h: Don't try to remove TemporaryDirectory.
llvm-svn: 157530
2012-05-27 13:10:14 +00:00
NAKAMURA Takumi b030e8a5c8 Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir.
llvm-svn: 157529
2012-05-27 13:02:04 +00:00
NAKAMURA Takumi ce6ad6748a clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. Win32 doesn't allow rename/removing opened files.
llvm-svn: 157528
2012-05-27 12:59:58 +00:00
Benjamin Kramer abb3fa69b4 Missed parens.
llvm-svn: 157527
2012-05-27 10:56:55 +00:00
Benjamin Kramer 4b8f8e75e6 r157525 didn't work, just disable iterator checking.
This is obviosly right but I don't see how to do this with proper vector
iterators without building a horrible mess of workarounds.

llvm-svn: 157526
2012-05-27 10:24:52 +00:00
Benjamin Kramer 48ff2751c1 SDAGBuilder: Avoid iterator invalidation harder.
vector.begin()-1 is invalid too.

llvm-svn: 157525
2012-05-27 09:44:52 +00:00
Charles Davis 5511dfb399 Mangle template instantiations properly (as of VC 7.x) when compiling for
the Microsoft Visual C++ ABI. Currently limited to type and integral
non-type arguments. Based on a patch by Timur Iskhodzhanov!

llvm-svn: 157524
2012-05-26 23:12:19 +00:00
Chris Lattner c5a825bb79 rearrange some code, no functionality change.
llvm-svn: 157523
2012-05-26 23:03:52 +00:00
Benjamin Kramer 5aad872f8c SDAGBuilder: Don't create an invalid iterator when there is only one switch case.
Found by libstdc++'s debug mode.

llvm-svn: 157522
2012-05-26 21:19:12 +00:00
Benjamin Kramer f2beccf6b4 SelectionDAGBuilder: When emitting small compare chains for switches order them by using edge weights.
SimplifyCFG tends to form a lot of 2-3 case switches when merging branches. Move
the most likely condition to the front so it is checked first and the others can
be skipped. This is currently not as effective as it could be because SimplifyCFG
destroys profiling metadata when merging branches and switches. Merging branch
weight metadata is tricky though.

This code touches at most 3 cases so I didn't use a proper sorting algorithm.

llvm-svn: 157521
2012-05-26 20:01:32 +00:00
Benjamin Kramer 7b01b578a9 Only emit one set of braces for __VERSION__, getClangFullRepositoryVersion already adds some.
No test as the output is highly dependend on the local configuration.

llvm-svn: 157520
2012-05-26 19:39:52 +00:00
Greg Clayton d70b14ea9d Fixed memory management issues introduced by revision 157507.
A local std::string was being filled in and then the function would return "s.c_str()".
A local StreamString (which contains a std::string) was being filled in, and essentially also returning the c string from the std::string, though it was in a the StreamString class.

The fix was to not do this by passing a stream object into StringList::Join() and fix the "arch_helper()" function to do what it should: cache the result in a global.

llvm-svn: 157519
2012-05-26 17:21:14 +00:00
Duncan Sands 3c05cd3ea8 Since commit 157467, if reassociate isn't actually going to change an expression
then it doesn't alter the instructions composing it, however it would continue
to move the instructions to just before the expression root.  Ensure it doesn't
move them either, so now it really does nothing if there is nothing to do.  That
commit also ensured that nsw etc flags weren't cleared if the expression was not
being changed.  Tweak this a bit so that it doesn't clear flags on the initial
part of a computation either if that part didn't change but later bits did.

llvm-svn: 157518
2012-05-26 16:42:52 +00:00
Fariborz Jahanian f3b7681f2b Change warning to error when property setter names conflict.
// rdar://11528439

llvm-svn: 157517
2012-05-26 16:10:06 +00:00
Benjamin Kramer 58abf4f193 SimplifyCFG: Turn the ad-hoc std::pair that represents switch cases into an explicit struct.
llvm-svn: 157516
2012-05-26 14:29:37 +00:00
Benjamin Kramer 65e75666ff Add support for branch weight metadata to MDBuilder and use it in various places.
llvm-svn: 157515
2012-05-26 13:59:43 +00:00
Benjamin Kramer 484f4247aa ScoreboardHazardRecognizer: Remove dead conditional in debug code.
Negative cycles are filtered out earlier.

llvm-svn: 157514
2012-05-26 11:37:37 +00:00
Duncan Sands c94ac6fdf6 Move this debug statement earlier so it is easy to see the order in
which operands come flying out of the linearization stage.

llvm-svn: 157512
2012-05-26 07:47:48 +00:00
Richard Smith 1bb8edb8ac In response to some discussions on IRC, tweak the wording of the new
-Wsometimes-uninitialized diagnostics to make it clearer that the cause
of the issue may be a condition which must always evaluate to true or
false, rather than an uninitialized variable.

To emphasize this, add a new note with a fixit which removes the
impossible condition or replaces it with a constant.

Also, downgrade the diagnostic from -Wsometimes-uninitialized to
-Wconditional-uninitialized when it applies to a range-based for loop,
since the condition is not written explicitly in the code in that case.

llvm-svn: 157511
2012-05-26 06:20:46 +00:00
David Blaikie 3d8edc24c7 Fix indentation.
llvm-svn: 157510
2012-05-26 05:35:39 +00:00
Alexander Kornienko 246e85ddb0 Don't offer '[[clang::fallthrough]];' fix-it when a fall-through occurs to a
switch label immediately followed by a 'break;'.

llvm-svn: 157508
2012-05-26 00:49:15 +00:00
Johnny Chen ca7835c685 rdar://problem/11535045
Make 'help arch' return the list of supported architectures.
Add a convenience method StringList::Join(const char *separator) which is called from the help function for 'arch'.
Also add a simple test case.

llvm-svn: 157507
2012-05-26 00:32:39 +00:00
Jim Ingham de22182b33 Fix the comments about LLDB_DISABLE_PYTHON in the python swig shell scripts to be more clear.
llvm-svn: 157506
2012-05-26 00:23:52 +00:00
Bill Wendling 8ed0749a34 The llvm_gcda_increment_indirect_counter function writes to the arguments that
are passed in. However, those arguments may be in a write-protected area, as far
as the runtime library is concerned. For instance, the data could be placed into
a 'linkedit' section, which isn't writable. Emit the code from
llvm_gcda_increment_indirect_counter directly into the function instead.

Note: The code for this is ugly, and can lead to bloat. We should look into
simplifying this code instead of having all of these branches.

<rdar://problem/11181370>

llvm-svn: 157505
2012-05-25 23:55:00 +00:00
Akira Hatanaka 5cec9007bb Fix predicate HasStandardEncoding in MipsInstrInfo.td per suggestion of
Benjamin Kramer.

llvm-svn: 157504
2012-05-25 22:15:15 +00:00
Howard Hinnant 8b805c915a The rules for emplace in map, multimap, unordered_map and unordered_multimap changed a while back and I'm just now updating to these new rules. In a nutshell, you've got to know you're emplacing to a pair and use one of pair's constructors. I made one extension: If you want to emplace the key and default construct the mapped_type, you can just emplace(key), as opposed to emplace(piecewise_construct, forward_as_tuple(key), forward_as_tuple()).
llvm-svn: 157503
2012-05-25 22:04:21 +00:00
Bill Wendling 7b29885463 Small code cleanup. No functionality change.
llvm-svn: 157502
2012-05-25 21:57:59 +00:00
Bill Wendling bdcbc04503 Open in read/write mode, creating the file if it doesn't exist.
llvm-svn: 157501
2012-05-25 21:55:06 +00:00
Nuno Lopes f491fbd715 fix codegen support for alloc_size attribute for static C++ methods
add test case for C++ codegen

llvm-svn: 157500
2012-05-25 21:45:08 +00:00
Nuno Lopes e9b0bdf804 bounds checking: add support for byval arguments
llvm-svn: 157498
2012-05-25 21:15:17 +00:00
Johnny Chen 7d49c9c861 rdar://problem/11533713
Allow setting conditions inline with breakpoints.  Add test cases.

llvm-svn: 157497
2012-05-25 21:10:46 +00:00
Akira Hatanaka 03968fac4f Delete MipsExpandPseudo.cpp.
llvm-svn: 157496
2012-05-25 20:54:48 +00:00
Akira Hatanaka d0ac2c93d3 Move the code in MipsExpandPseudo to MipsInstrInfo::expandPostRAPseudo.
Delete MipsExpandPseudo.

llvm-svn: 157495
2012-05-25 20:52:52 +00:00
Akira Hatanaka f4554485cb Remove the code that expands MIPS' .cpload directive.
llvm-svn: 157494
2012-05-25 20:46:52 +00:00
Akira Hatanaka 5de59266cd Remove the code that emits MIPS' .cprestore directive.
llvm-svn: 157493
2012-05-25 20:42:55 +00:00
Akira Hatanaka 4d9b017ef2 Remove pseudo instructions that are no longer used.
llvm-svn: 157492
2012-05-25 20:37:40 +00:00