Commit Graph

129238 Commits

Author SHA1 Message Date
Bill Wendling 1c5e94a47c Sphinxify the CodingStandard documentation.
llvm-svn: 158786
2012-06-20 02:57:56 +00:00
Argyrios Kyrtzidis aa38f695ad [arcmt]
-Disable -pedantic-errors when migrating per Jordan's suggestion.
-Use llvm_move() per John's suggestion.

llvm-svn: 158785
2012-06-20 01:46:26 +00:00
Jordan Rose 44320367ac [analyzer] Invalidate placement args; return the pointer given to placement new
The default global placement new just returns the pointer it is given.
Note that other custom 'new' implementations with placement args are not
guaranteed to do this.

In addition, we need to invalidate placement args, since they may be updated by
the allocator function. (Also, right now we don't properly handle the
constructor inside a CXXNewExpr, so we need to invalidate the placement args
just so that callers know something changed!)

This invalidation is not perfect because CallOrObjCMessage doesn't support
CXXNewExpr, and all of our invalidation callbacks expect that if there's no
CallOrObjCMessage, the invalidation is happening manually (e.g. by a direct
assignment) and shouldn't affect checker-specific metadata (like malloc state);
hence the malloc test case in new-fail.cpp. But region values are now
properly invalidated, at least.

The long-term solution to this problem is to rework CallOrObjCMessage into
something more general, rather than the morass of branches it is today.

<rdar://problem/11679031>

llvm-svn: 158784
2012-06-20 01:32:01 +00:00
Argyrios Kyrtzidis 927a437ac7 [objcmt] Have the modern objc migration warning change from:
[NSNumber numberWithDouble:cppb];
warning: converting to boxing syntax requires a cast

to something like:

[NSNumber numberWithDouble:cppb];
warning: converting to boxing syntax requires casting 'bool' to 'double'

This is way better to fully understand the warning.
rdar://11705106

llvm-svn: 158783
2012-06-20 01:28:32 +00:00
Rafael Espindola c757570032 Fix cmake build.
llvm-svn: 158782
2012-06-20 01:18:08 +00:00
Argyrios Kyrtzidis 692bf8cb64 [arcmt] When migrating to ARC disable -Werror so as to only block migration
for "hard" ARC errors, not warnings.

rdar://11691437

llvm-svn: 158781
2012-06-20 01:10:40 +00:00
Dmitri Gribenko 17e147fa9d Unbreak GCC build: GCC doesn't like clang::Parser::CommentHandler and class clang::CommentHandler to have same name.
llvm-svn: 158780
2012-06-20 01:06:08 +00:00
James Dennett 35ad6f9ac7 Documentation cleanup: adding/fixing Doxygen markup, particularly \brief,
\code...\endcode, \file commands and escaing for angle brackets.

llvm-svn: 158779
2012-06-20 01:00:18 +00:00
James Dennett a02e11f31d Documentation cleanup: escape "::" to avoid a Doxygen warning
llvm-svn: 158778
2012-06-20 00:57:15 +00:00
Dmitri Gribenko b0ed34df15 Unbreak CMake build: remove not-yet-committed CommentLexer.cpp.
llvm-svn: 158777
2012-06-20 00:56:47 +00:00
James Dennett c07ab2c96a Documentation cleanup:
* Escaped # and < characters in Doxygen comments as needed;
* Removed a Doxygen comment in HeaderSearch.cpp that was redundant with
  the corresponding comment in the header file.

llvm-svn: 158776
2012-06-20 00:56:32 +00:00
James Dennett 250c865c15 Documentation cleanup: escape # character in a Doxygen comment.
llvm-svn: 158775
2012-06-20 00:51:53 +00:00
James Dennett e5f16ae679 Documentation cleanup:
* Escape < characters in Doxygen comments as needed;
* Demote one Doxygen comment to a regular comment to fix a Doxygen warning.

llvm-svn: 158774
2012-06-20 00:50:53 +00:00
James Dennett e12128361d Documentation cleanup:
* Escaped # characters in Doxygen comments as needed;
* Added/fixed \file and \brief markup to add summaries to Doxygen output.

llvm-svn: 158773
2012-06-20 00:48:54 +00:00
Kaelyn Uhrain 272d718808 Add the PCH file name to the message about not being able to read the PCH.
Also add a couple of unit tests to check the invalid-PCH error messages
to satisfy PR4568 and for the assertion (introduced in r149918 and fixed
in r158769) that would cause clang to crash when given an empty PCH.

llvm-svn: 158772
2012-06-20 00:36:03 +00:00
Dmitri Gribenko aab8383a2b Structured comment parsing, first step.
* Retain comments in the AST
* Serialize/deserialize comments
* Find comments attached to a certain Decl
* Expose raw comment text and SourceRange via libclang

llvm-svn: 158771
2012-06-20 00:34:58 +00:00
Nick Kledzik 18497e9242 Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs and add unit test. Unix is implemented. Windows side needs to be implemented.
llvm-svn: 158770
2012-06-20 00:28:54 +00:00
Kaelyn Uhrain 2212f807c7 Don't assert when given an empty range.
llvm::RawMemoryObject handles empty ranges just fine, and the assert can
be triggered in the wild by e.g. invoking clang with a file that
included an empty pre-compiled header file when clang has been built
with assertions enabled. Without assertions enabled, clang will properly
report that the empty file is not a valid PCH.

llvm-svn: 158769
2012-06-20 00:16:40 +00:00
Nico Weber 5f96883d44 Do a second lookup for type_info in the global namespace in microsoft mode. PR13153.
llvm-svn: 158768
2012-06-19 23:58:27 +00:00
Alexis Hunt 3bc72c1ec2 Reapply r158700 and fixup patches, minus one hunk that slipped through and
caused a crash in an obscure case. On the plus side, it caused me to catch
another bug by inspection.

llvm-svn: 158767
2012-06-19 23:57:03 +00:00
Jakob Stoklund Olesen 3802bbf35e Add regunit liveness support to LiveIntervals::handleMove().
When LiveIntervals is tracking fixed interference in regunits, make sure
to update those intervals as well. Currently guarded by -live-regunits.

llvm-svn: 158766
2012-06-19 23:50:18 +00:00
Bill Wendling 152c38503e Alphabetize.
llvm-svn: 158764
2012-06-19 23:47:58 +00:00
Alexis Hunt 78e2b91319 Do not crash when we dynamic cast a final type to void*.
llvm-svn: 158763
2012-06-19 23:44:55 +00:00
Chad Rosier 651f9a485a Tidy up.
llvm-svn: 158762
2012-06-19 23:37:57 +00:00
DeLesley Hutchins 312e742c99 Thread Safety Analysis: Move some warnings on thread safety
attributes into the ThreadSafetyAttributes group, where the other
warnings currently live.

llvm-svn: 158761
2012-06-19 23:25:19 +00:00
Tanya Lattner 4fdce3faa8 Extend the support for cl-std to include 1.2.
Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature.
Added test case for 1.2 static storage class feature.

llvm-svn: 158759
2012-06-19 23:09:52 +00:00
Chad Rosier 7369692790 Add an ensureMaxAlignment() function to MachineFrameInfo (analogous to
ensureAlignment() in MachineFunction).  Also, drop setMaxAlignment() in
favor of this new function.  This creates a main entry point to setting
MaxAlignment, which will be helpful for future work.  No functionality
change intended.

llvm-svn: 158758
2012-06-19 22:59:12 +00:00
Lang Hames 39fb1d08dc Add DAG-combines for aggressive FMA formation.
This patch adds DAG combines to form FMAs from pairs of FADD + FMUL or
FSUB + FMUL. The combines are performed when:
(a) Either
      AllowExcessFPPrecision option (-enable-excess-fp-precision for llc)
        OR
      UnsafeFPMath option (-enable-unsafe-fp-math)
    are set, and
(b) TargetLoweringInfo::isFMAFasterThanMulAndAdd(VT) is true for the type of
    the FADD/FSUB, and
(c) The FMUL only has one user (the FADD/FSUB).

If your target has fast FMA instructions you can make use of these combines by
overriding TargetLoweringInfo::isFMAFasterThanMulAndAdd(VT) to return true for
types supported by your FMA instruction, and adding patterns to match ISD::FMA
to your FMA instructions.

llvm-svn: 158757
2012-06-19 22:51:23 +00:00
Fariborz Jahanian 63d40202fb objective-c: warn when autosynthesizing a property which has same
name as an existing ivar since this is common source of error
when people remove @synthesize to take advantage of autosynthesis. 
// rdar://11671080

llvm-svn: 158756
2012-06-19 22:51:22 +00:00
Jakob Stoklund Olesen 2db1125b15 80 col.
llvm-svn: 158755
2012-06-19 22:50:53 +00:00
Chad Rosier bb335c96f9 Typo. Patch by Cameron McInally <cameron.mcinally@nyu.edu>.
llvm-svn: 158754
2012-06-19 22:28:18 +00:00
Bill Wendling 444075a281 Add Projects.rst to the toctree.
llvm-svn: 158753
2012-06-19 22:25:41 +00:00
Bill Wendling 34ffc89e93 Use correct capitalization.
llvm-svn: 158752
2012-06-19 22:25:17 +00:00
Johnny Chen 1773a89ff4 Chnage VerifyWatchpointIDs() from a static function to a class function to be called from other source files.
llvm-svn: 158751
2012-06-19 22:12:58 +00:00
Aaron Ballman 478faed4b0 Reapplying the changes from r158717 as they were rolled back to avoid merge conflicts from a separate problematic patch.
llvm-svn: 158750
2012-06-19 22:09:27 +00:00
Jakob Stoklund Olesen e1c0ae6fda Revert r158700 and dependent patches r158716, r158717, and r158731.
The original r158700 caused crashes in the gcc test suite,
g++.abi/vtable3a.C among others. It also caused failures in the libc++
test suite.

llvm-svn: 158749
2012-06-19 21:48:43 +00:00
Jakob Stoklund Olesen 77a0cfb19a Add a triple.
The test was failing on Linux because of asm syntax differences.

llvm-svn: 158748
2012-06-19 21:46:25 +00:00
Richard Smith 72cd8ea5e5 Fix -Wc++11-narrowing warnings for narrowing negative values to larger unsigned
types to actually includes the value, rather than saying <uninitialized>.

llvm-svn: 158745
2012-06-19 21:28:35 +00:00
David Blaikie 9366d2b32d Enable -Wnull-conversion for non-integral target types (eg: double).
llvm-svn: 158744
2012-06-19 21:19:06 +00:00
Jakob Stoklund Olesen 0f855e4263 Implement PPCInstrInfo::isCoalescableExtInstr().
The PPC::EXTSW instruction preserves the low 32 bits of its input, just
like some of the x86 instructions. Use it to reduce register pressure
when the low 32 bits have multiple uses.

This requires a small change to PeepholeOptimizer since EXTSW takes a
64-bit input register.

This is related to PR5997.

llvm-svn: 158743
2012-06-19 21:14:34 +00:00
Jakob Stoklund Olesen 8eb9905a7c Style: Don't reuse variables for multiple purposes.
No functional change.

llvm-svn: 158742
2012-06-19 21:10:18 +00:00
James Dennett 51a8d8b8b5 Documentation cleanup: escape "::", and other minor reformatting
llvm-svn: 158741
2012-06-19 21:05:49 +00:00
James Dennett 99c193b3c0 Documentation cleanup: add \verbatim markup for grammar productions
llvm-svn: 158740
2012-06-19 21:04:25 +00:00
James Dennett e37835ef18 Documentation cleanup: fixing file headers to use Doxygen \file markup while
also being sufficiently conformant to LLVM's coding standards.

llvm-svn: 158739
2012-06-19 21:02:26 +00:00
Fariborz Jahanian a36cbeb464 objc-arc: captured block variable accessed in its block literal
initializer need be null initialized before initializer takes
hold, just like any other initialized retainable object pointer. 
// rdar://11016025

llvm-svn: 158738
2012-06-19 20:53:26 +00:00
Johnny Chen 59ceee7933 Test suite cleanup: use Python API to remove files as part of cleanup instead of running OS commands.
llvm-svn: 158737
2012-06-19 20:29:50 +00:00
Ted Kremenek 00c31c888b Adjust scan-build to enable color output for xterm-256color.
llvm-svn: 158735
2012-06-19 19:27:28 +00:00
Chad Rosier 103e2c9508 [driver] Per Bob's suggestion, emphasize the file dumps.
rdar://11684107

llvm-svn: 158734
2012-06-19 18:39:21 +00:00
Kaelyn Uhrain 33621a6977 Remove some debugging code that snuck into r158691.
llvm-svn: 158733
2012-06-19 18:38:00 +00:00
Meador Inge cdc0057e3c Revert predefined decl tracking.
r158085 added some logic to track predefined declarations.  The main reason we
had predefined declarations in the input was because the __builtin_va_list
declarations were injected into the preprocessor input.  As of r158592 we 
explicitly build the __builtin_va_list declarations.  Therefore the predefined
decl tracking is no longer needed.

llvm-svn: 158732
2012-06-19 18:17:30 +00:00