Commit Graph

129238 Commits

Author SHA1 Message Date
Chandler Carruth a5d42f83f9 Factor the logic for setting up a GoogleTest unit test executable into
a helper function in CMake. This will allow us to share all of this
logic with Clang, and eventually CompilerRT.

llvm-svn: 158896
2012-06-21 05:16:58 +00:00
Richard Smith 73af5c6dda MS: Mangle rvalue references and nullptr_t, and produce back-references when
appropriate. Patch by João Matos!

llvm-svn: 158895
2012-06-21 02:52:27 +00:00
Chandler Carruth 8897331381 Simplify the Clang unittest function in the CMake build, and make it
match the LLVM implemenation. This also simplifies the name management
and splits the custom library management out from the unittest specific
management. It finally drops the dependency on parsing cmake arguments.

llvm-svn: 158894
2012-06-21 02:04:39 +00:00
Chandler Carruth 1313d9860d Simplify the naming pattern in the unittests' CMake file
llvm-svn: 158893
2012-06-21 02:02:48 +00:00
Jason Molenda a5609c8588 Preliminary set of changes to ObjectFileMachO::ParseSymtab when lldb
is being run on iOS natively and we are examining a binary that is
in the shared-cache.  The shared cache may be set up to not load the
symbol names in memory (and may be missing some local symbols entirely,
to boot) so we need to read the on-disk-but-not-mapped-into-memory cache
of symbol names/symbols before we start processing the in-memory nlist
entries.  

This code needs to be reorganized into its own separate method, ideally
we'll find some way to not duplicate the nlist symbol handling.  But 
we need to handle this new format quickly and we'll clean up later.

Thanks for James McIlree for the patch.  Fixes <rdar://problem/11639018>.

llvm-svn: 158891
2012-06-21 01:51:02 +00:00
Jason Molenda 06bca9ed0e Bump version number to lldb-160.
llvm-svn: 158890
2012-06-21 01:41:15 +00:00
Chandler Carruth e530d2ba4d Remove one of the LLVM-specific CMake hacks in favor of standard CMake
facilities.

This was only used in one place in LLVM, and was used pervasively (but
with different code!) in Clang. It has no advantages over the standard
CMake facilities and in some cases disadvantages.

llvm-svn: 158889
2012-06-21 01:35:09 +00:00
Chandler Carruth 28969b4139 Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

llvm-svn: 158888
2012-06-21 01:30:21 +00:00
Richard Smith c7b0bdffe7 If an object (such as a std::string) with an appropriate c_str() member function
is passed to a variadic function in a position where a format string indicates
that c_str()'s return type is desired, provide a note suggesting that the user
may have intended to call the c_str() member.

Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and
move it to SemaChecking in order to facilitate this. Factor the call checking
out of function call checking and block call checking, and extend it to cover
constructor calls too.

Patch by Sam Panzer!

llvm-svn: 158887
2012-06-21 01:08:35 +00:00
Alexander Potapenko 15b4cafd2c Enable AddressSanitizerMac.CFAllocatorDefaultDoubleFree and AddressSanitizerMac.CFAllocatorMallocDoubleFree, which now work fine.
llvm-svn: 158886
2012-06-21 01:04:30 +00:00
Alexander Potapenko 1bde28b464 Factor the common code out of cf_free and mz_free.
Introduce the mac_ignore_invalid_free flag (0 by default) which makes both cf_free and mz_free ignore invalid free invocations and leak memory.

llvm-svn: 158885
2012-06-21 01:01:20 +00:00
Chandler Carruth 4b3d2c801c Remove an unused feature of the clang unittest macro.
llvm-svn: 158884
2012-06-21 00:40:48 +00:00
Richard Smith d0124578ee Do not complain about junk on the end of a #endif in a skipped block. Such junk
is permitted by all relevant language standards. Patch by Andy Gibbs!

llvm-svn: 158883
2012-06-21 00:35:03 +00:00
Dmitri Gribenko 7bedfda489 RawCommentList::addComment: fix the assertion so it actually checks that new comment is after the last one (change Comments[0] to Comments.back()), and handle the case of two consecutive comments, e.g. /** *//* */. There is already a testcase for that (but it didn't trigger the assert because the assert itself was wrong).
llvm-svn: 158882
2012-06-21 00:28:14 +00:00
Jakob Stoklund Olesen 58713de545 Update regunits in RegisterCoalescer::reMaterializeTrivialDef.
Old code would only update physreg live intervals.

llvm-svn: 158881
2012-06-21 00:09:15 +00:00
Meador Inge 6a706af708 Put space after "code-block::".
llvm-svn: 158880
2012-06-20 23:57:00 +00:00
Jakob Stoklund Olesen 88ef957e74 Remove LiveIntervals::iterator.
Live intervals for regunits and virtual registers are stored separately,
and physreg live intervals are going away.

To visit the live ranges of all virtual registers, use this pattern
instead:

  for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) {
    unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
    if (MRI->reg_nodbg_empty(Reg))
      continue;

llvm-svn: 158879
2012-06-20 23:54:20 +00:00
Jakob Stoklund Olesen 37a1338a16 Remove spurious typedefs.
llvm-svn: 158878
2012-06-20 23:54:18 +00:00
Meador Inge 46137da795 Removed some left over HTML tags and a '}'.
llvm-svn: 158877
2012-06-20 23:48:01 +00:00
Jakob Stoklund Olesen 1911a0203d Remove the RenderMachineFunction HTML output pass.
I don't think anyone has been using this functionality for a while, and
it is getting in the way of refactoring now.

llvm-svn: 158876
2012-06-20 23:47:58 +00:00
Anna Zaks 886dfb8cfa [analyzer] Malloc leak false positive: Allow xpc context to escape.
llvm-svn: 158875
2012-06-20 23:35:57 +00:00
Fariborz Jahanian 1501987951 objective-c: place quotes around named items in a diagnostic.
// rdar://11671080

llvm-svn: 158874
2012-06-20 23:33:16 +00:00
Jakob Stoklund Olesen 51c63e64e3 Remove the -live-regunits command line option.
Register allocators depend on it being permanently enabled now.

llvm-svn: 158873
2012-06-20 23:31:34 +00:00
Jakob Stoklund Olesen 781e0b9fd7 Fix some more LiveInterval enumerations.
Deterministically enumerate the virtual registers instead.

llvm-svn: 158872
2012-06-20 23:23:59 +00:00
Fariborz Jahanian 914faaf78a objc: tweak my last patch to warn if class extension
has not overridden the property. // rdar://11656982

llvm-svn: 158871
2012-06-20 23:18:57 +00:00
Alexander Potapenko 642371724e Fix the output tests on Darwin
llvm-svn: 158870
2012-06-20 23:07:55 +00:00
Fariborz Jahanian 876cc65a3f objective-c: Normally, a property cannot be both 'readonly' and having a
"write" attribute (copy/retain/etc.). But, property declaration in 
primary class and protcols are tentative as they may be overridden 
into a 'readwrite' property in class extensions. Postpone diagnosing 
such warnings until the class implementation is seen. 
// rdar://11656982

llvm-svn: 158869
2012-06-20 22:57:42 +00:00
Jakob Stoklund Olesen 2d2dec96e0 Remove LiveIntervalUnions from RegAllocBase.
They are living in LiveRegMatrix now.

llvm-svn: 158868
2012-06-20 22:52:29 +00:00
Jakob Stoklund Olesen 96eebf0b14 Convert RAGreedy to LiveRegMatrix interference checking.
Stop depending on the LiveIntervalUnions in RegAllocBase, they are about
to be removed.

The changes are mostly replacing register alias iterators with regunit
iterators, and querying LiveRegMatrix instrad of RegAllocBase.

InterferenceCache is converted to work with per-regunit
LiveIntervalUnions, and it checks fixed regunit interference separately,
using the fixed live intervals provided by LiveIntervalAnalysis.

The local splitting helper calcGapWeights() is also considering fixed
regunit interference which is kept on the side now.

llvm-svn: 158867
2012-06-20 22:52:26 +00:00
Jakob Stoklund Olesen 03b87d5aaa Convert RABasic to using LiveRegMatrix interference checking.
Stop using the LiveIntervalUnions provided by RegAllocBase, they will be
removed soon.

llvm-svn: 158866
2012-06-20 22:52:24 +00:00
Jakob Stoklund Olesen effc6b2d18 Enable register unit liveness by default.
Soon we won't need to compute live intervals for physical registers.

llvm-svn: 158865
2012-06-20 22:52:22 +00:00
Jakob Stoklund Olesen bfa664eaae Teach PBQPBuilder::build() about regunit interference.
Filter out physreg candidates with regunit interferrence.
Also compute regmask interference more efficiently.

llvm-svn: 158864
2012-06-20 22:32:05 +00:00
Alexander Potapenko f9f2fbacb3 Actually intercept free() to ensure that the deallocations caused by other functions directly calling it are routed to our allocator.
For the allocations that do not belong to any malloc zone check whether they're padded with a pointer to ASan's CFAllocator. If so, free the original (unpadded) pointer.
This should fix AddressSanitizerMac.NSURLDeallocation and issue 70.

llvm-svn: 158863
2012-06-20 22:29:09 +00:00
Andrew Trick 2ed08a7cc1 Restructure PopulateLoopsDFS::insertIntoLoop.
As Nadav pointed out the first implementation was obscure.

llvm-svn: 158862
2012-06-20 22:18:33 +00:00
James Dennett 8618cb7ef8 Documentation cleanup: escape a < character in a Doxygen comment
llvm-svn: 158861
2012-06-20 22:06:21 +00:00
John McCall 18ac1632f0 Introduce ObjCRuntime::hasWeakClassImport() and use it in the appropriate
places.  I've turned this off for the GNU runtimes --- I don't know if
they support weak class import, but it's easy enough for them to opt in.

Also tweak a comment per review by Jordan.

llvm-svn: 158860
2012-06-20 21:58:02 +00:00
James Dennett 8811865e49 Documentation cleanup:
* Escape < characters in Doxygen comments as needed;
* Add \code...\endcode around code examples;
* Remove an incorrect use of Doxygen's \arg command.

llvm-svn: 158859
2012-06-20 21:55:51 +00:00
Bill Wendling 9dc93279a5 Sphixify the GEP FAQ.
llvm-svn: 158858
2012-06-20 21:54:22 +00:00
Jakob Stoklund Olesen a1f43dcdb8 Avoid iterating with LiveIntervals::iterator.
That is a DenseMap iterator keyed by pointers, so the iteration order is
nondeterministic.

I would like to replace the DenseMap with an IndexedMap which doesn't
allow iteration.

llvm-svn: 158856
2012-06-20 21:25:05 +00:00
Akira Hatanaka 87505f46ac Revert r158846.
llvm-svn: 158855
2012-06-20 21:19:39 +00:00
Alexander Kornienko 9a34889efe Added test with sizeof conditions (relies on to-be-implemented functionality of CFG, discussion: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120507/057370.html)
llvm-svn: 158854
2012-06-20 21:12:23 +00:00
Jordan Rose dc753b625f Reword -Winternal-linkage-in-inline, and rename it to -Wstatic-in-inline.
Now that this is a C-only warning, we can use "static" instead of "internal
linkage", which is a term developers are probably more familiar with.
This makes for a better warning message. The warning name was changed to match,
since "internal linkage" is not mentioned in the warning text anymore.

llvm-svn: 158853
2012-06-20 21:09:10 +00:00
James Dennett 0187a05e35 Documentation cleanup:
* Many fixes for \brief summaries (adding some, and making others shorter);
* Don't try to explicit tell Doxygen a namespace name (and particularly
  don't get it wrong);
* Typo fix: instantitions -> instantiations;
* Slightly more use of \pre for documenting preconditions.

llvm-svn: 158852
2012-06-20 21:03:59 +00:00
Anna Zaks b3fea8741f [analyzer] Do not walk the types for call graph construction.
Similar to r156661. This should be beneficial performance wise and
hopefully, resolve a RecursiveASTVisitor crash that we are seeing in the
wild, but are incapable of reproducing.

llvm-svn: 158851
2012-06-20 20:57:49 +00:00
Anna Zaks 9050ffd57c [analyzer] Malloc: cleanup, disallow free on relinquished memory.
This commits sets the grounds for more aggressive use after free
checking. We will use the Relinquished sate to denote that someone
else is now responsible for releasing the memory.

llvm-svn: 158850
2012-06-20 20:57:46 +00:00
Anna Zaks 51b7357159 [analyzer] Remove dead code.
llvm-svn: 158849
2012-06-20 20:57:42 +00:00
James Dennett 6eac20e8df Documentation cleanup: escaping # characters in Doxygen comments.
llvm-svn: 158847
2012-06-20 20:49:07 +00:00
Akira Hatanaka da448fe0b1 In MipsDisassembler.cpp, instead of defining register class tables, use the ones
that are generated by TableGen and are already available in
MipsGenRegisterInfo.inc. Suggested by Jakob Stoklund Olesen.

Also, fix bug in function DecodeAFGR64RegisterClass.

Patch by Vladimir Medic. 

llvm-svn: 158846
2012-06-20 20:39:23 +00:00
Dmitri Gribenko 93b9ecba9b Remove unused ASTContext& arg in RawCommentList::addComment, as pointed out by Chandler in commit message for r158807.
llvm-svn: 158845
2012-06-20 20:39:04 +00:00
Kaelyn Uhrain 4cb2e2dc63 Remove an "else" that snuck in after a "return" ;)
llvm-svn: 158844
2012-06-20 20:38:36 +00:00