Commit Graph

129226 Commits

Author SHA1 Message Date
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
Alexander Potapenko 50e788b724 Add a test for NSURL deallocation (issue 70)
llvm-svn: 158843
2012-06-20 20:28:39 +00:00
Nico Weber df7dffb34b Allow unqualified lookup of non-dependent member functions
in microsoft mode. Fixes PR12701.

The code for this was already in 2 of the 3 branches of a
conditional and missing in the 3rd branch, so lift it above
the conditional.

llvm-svn: 158842
2012-06-20 20:21:42 +00:00
Kaelyn Uhrain 23fb5c3e93 Check that a file is not a directory before reading it into a MemoryBuffer.
llvm-svn: 158841
2012-06-20 20:21:33 +00:00
Andrew Trick dbb7ae54b8 Add "extern template" declarations now that we use explicit instantiation.
This is supported by gcc and clang, but guarded by a macro for MSVC 2008.

The extern template declaration is not necessary but generally good
form. It can avoid extra instantiations of the template methods
defined inline.

The EXTERN_TEMPLATE_INSTANTIATION macro could probably be generalized to
handle multiple template parameters if someone thinks it's worthwhile.

llvm-svn: 158840
2012-06-20 20:17:20 +00:00
Pete Cooper fe5b84b404 Add users of a MERGE_VALUE node to the worklist to process again when the node is removed. Sorry, no test case. Foudn it by inspection of the code
llvm-svn: 158839
2012-06-20 19:35:43 +00:00
Chad Rosier cc6a908c39 Whitespace.
llvm-svn: 158837
2012-06-20 18:51:04 +00:00
Jordan Rose de9e976468 Remove -Winternal-linkage-in-inline in C++.
It's very easy for anonymous external linkage to propagate in C++ through
return types and parameter types. Likewise, it's possible that a template
containing an inline function is only used with parameters that have internal
linkage. Actually diagnosing where the internal linkage comes from is fairly
difficult (both to locate and then to print nicely). Finally, since we only
have one translation unit available, we can't even prove that any of this
violates the ODR.

This warning needs better-defined behavior in C++ before it can really go in.

Rewording of the C warning (which /is/ specified by C99) coming shortly.

llvm-svn: 158836
2012-06-20 18:50:06 +00:00
Chad Rosier 43b7c021b3 [ms-style asm] Change the fatal error to an extension warning. Apparently, this
error was asserting on anything that included Windows.h.  MS-style inline asm is
still dropped, but at least now we're not completely silent about it.

llvm-svn: 158833
2012-06-20 18:28:37 +00:00
Benjamin Kramer e6dcf106b2 Don't circumvent the debug info type cache when emitting info for EnumConstantDecl.
CreateEnumType doesn't participate in caching so the descriptor for the enum
gets recomputed for every reference of an element of an enum, only to get
discarded when it gets turned into an MDNode.

No functionality change except performance.

llvm-svn: 158832
2012-06-20 18:11:18 +00:00
Jakob Stoklund Olesen 833308d785 Only update regunit live ranges that have been precomputed.
Regunit live ranges are computed on demand, so when mi-sched calls
handleMove, some regunits may not have live ranges yet.

That makes updating them easier: Just skip the non-existing ranges. They
will be computed correctly from the rescheduled machine code when they
are needed.

llvm-svn: 158831
2012-06-20 18:00:57 +00:00
Chad Rosier bebf146dd6 Whitespace.
llvm-svn: 158830
2012-06-20 17:43:05 +00:00
Nuno Lopes 3fa32f2452 replace usage of EmitGEPOffset() with TargetData::getIndexedOffset() when the GEP offset is known to be constant.
With this change, we avoid relying on the IR Builder to constant fold the operations.

No functionality change intended.

llvm-svn: 158829
2012-06-20 17:30:51 +00:00