platform/upstream/llvm.git
12 years agoSphinxify the developer policy document.
Bill Wendling [Wed, 20 Jun 2012 11:20:07 +0000 (11:20 +0000)]
Sphinxify the developer policy document.

llvm-svn: 158814

12 years agoSphinxify the lexicon doc.
Bill Wendling [Wed, 20 Jun 2012 10:36:41 +0000 (10:36 +0000)]
Sphinxify the lexicon doc.

llvm-svn: 158813

12 years agoResuming work on the compiler-rt CMake build at long long last. In order
Chandler Carruth [Wed, 20 Jun 2012 10:18:43 +0000 (10:18 +0000)]
Resuming work on the compiler-rt CMake build at long long last. In order
to get it working again, two changes were needed:

- I had to give up on glob-based file expansion. This just isn't well
  supported by CMake, and until we convince upstream there of its value,
  it's not worth dealing with the pain.
- Add the common library as otherwise even ASan won't build.

This now builds again, although the "correctness" of it is a touch
debatable. ;] Specifically, there is no merging of the common runtime
library with the asan runtime library into a single archive file. I'm
not really sure what the best technique is for that, and it may be
influenced by the ongoing discussion about how best to link runtime
libraries.

Note of course that this is still very much WIP. It doesn't entirely
work yet, and remains disabled by the LLVM projects/CMakeLists.txt until
it is in a working state.

llvm-svn: 158811

12 years agoSphinxify BranchWeightMetadata document.
Bill Wendling [Wed, 20 Jun 2012 10:17:46 +0000 (10:17 +0000)]
Sphinxify BranchWeightMetadata document.

llvm-svn: 158810

12 years agoContinue the cleanup started on r158737
Filipe Cabecinhas [Wed, 20 Jun 2012 10:13:40 +0000 (10:13 +0000)]
Continue the cleanup started on r158737

Adds a utility class method to TestBase that checks and removes a temp
file.
Removed every use of system() to execute rm -f.

llvm-svn: 158809

12 years agoSphinxify the LTO document.
Bill Wendling [Wed, 20 Jun 2012 10:08:02 +0000 (10:08 +0000)]
Sphinxify the LTO document.

llvm-svn: 158808

12 years agoFix a big layering violation introduced by r158771.
Chandler Carruth [Wed, 20 Jun 2012 09:53:52 +0000 (09:53 +0000)]
Fix a big layering violation introduced by r158771.

That commit added a new library just to hold the RawCommentList. I've
started a discussion on the commit thread about whether that is really
meritted -- it certainly doesn't seem necessary at this stage.

However, the immediate problem is that the AST library has a hard
dependency on the Comment library, but the dependencies were set up
completely backward. In addition to the layering violation, this had an
unfortunate effect if scattering the Comments library dependency
throughout the build system, but inconsistently so -- several parts of
the CMake dependencies were missing and only showed up due to transitive
deps or the fact that the target wasn't being built by tho bots.

It turns out that the Comments library can't (currently) be a well
formed layer *below* the AST library either, as it has an API that
accepts an ASTContext. That parameter is currently unused, so maybe that
was a mistake?

Anyways, it really seems like this is logically part of the AST --
that's the whole point of the ASTContext providing access to it as far
as I can tell -- so I've merged it into the AST library to solve the
immediate layering violation problems and remove some of the churn from
our library dependencies.

llvm-svn: 158807

12 years agoUnindent list.
Bill Wendling [Wed, 20 Jun 2012 09:50:45 +0000 (09:50 +0000)]
Unindent list.

llvm-svn: 158806

12 years agoSphinxify the AliasAnalysis document.
Bill Wendling [Wed, 20 Jun 2012 09:49:57 +0000 (09:49 +0000)]
Sphinxify the AliasAnalysis document.

llvm-svn: 158805

12 years agoUnindent list.
Bill Wendling [Wed, 20 Jun 2012 09:49:06 +0000 (09:49 +0000)]
Unindent list.

llvm-svn: 158804

12 years agoUn-indent the list and remove ugly back-slash.
Bill Wendling [Wed, 20 Jun 2012 09:48:38 +0000 (09:48 +0000)]
Un-indent the list and remove ugly back-slash.

llvm-svn: 158803

12 years agoRemove a 'static' specifier from an 'inline' function in a header file.
Chandler Carruth [Wed, 20 Jun 2012 08:43:50 +0000 (08:43 +0000)]
Remove a 'static' specifier from an 'inline' function in a header file.

This issue was caught by the new '-Winternal-linkage-in-inline' warning.

llvm-svn: 158801

12 years agoRemove 'static' from inline functions defined in header files.
Chandler Carruth [Wed, 20 Jun 2012 08:39:33 +0000 (08:39 +0000)]
Remove 'static' from inline functions defined in header files.

There is a pretty staggering amount of this in LLVM's header files, this
is not all of the instances I'm afraid. These include all of the
functions that (in my build) are used by a non-static inline (or
external) function. Specifically, these issues were caught by the new
'-Winternal-linkage-in-inline' warning.

I'll try to just clean up the remainder of the clearly redundant "static
inline" cases on functions (not methods!) defined within headers if
I can do so in a reliable way.

There were even several cases of a missing 'inline' altogether, or my
personal favorite "static bool inline". Go figure. ;]

llvm-svn: 158800

12 years agoFix two rather subtle internal vs. external linker issues.
Chandler Carruth [Wed, 20 Jun 2012 08:39:30 +0000 (08:39 +0000)]
Fix two rather subtle internal vs. external linker issues.

I'll admit I'm not entirely satisfied with this change, but it seemed
the cleanest option. Other suggestions quite welcome

The issue is that the traits specializations have static methods which
return the typedef'ed PHI_iterator type. In both the IR and MI layers
this is typedef'ed to a custom iterator class defined in an anonymous
namespace giving the types and the functions returning them internal
linkage. However, because the traits specialization is defined in the
'llvm' namespace (where it has to be, specialized template lives there),
and is in turn used in the templated implementation of the SSAUpdater.
This led to the linkage conflict that Clang now warns about.

The simplest solution to me was just to define the PHI_iterator as
a nested class inside the trait specialization. That way it still
doesn't get scoped widely, it can't be accidentally reused somewhere,
etc. This is a little gross just because nested class definitions are
a little gross, but the alternatives seem more ad-hoc.

llvm-svn: 158799

12 years agoFix inappropriate use of anonymous namespaces in unittests.
Chandler Carruth [Wed, 20 Jun 2012 08:39:27 +0000 (08:39 +0000)]
Fix inappropriate use of anonymous namespaces in unittests.

The TEST_F macros actually declare *subclasses* of the test fixtures.
Even if they didn't we don't want them to declare external functions.
The entire unit test, including both the fixture class and the fixture
test cases should be wrapped in the anonymous namespace.

This issue was caught by the new '-Winternal-linkage-in-inline' warning.

llvm-svn: 158798

12 years agoAdd predicate check around some patterns.
Craig Topper [Wed, 20 Jun 2012 07:30:23 +0000 (07:30 +0000)]
Add predicate check around some patterns.

llvm-svn: 158797

12 years agoRevert "Provide a -no-pedantic to cancel out -pedantic." This needs to be designed
Ted Kremenek [Wed, 20 Jun 2012 07:03:37 +0000 (07:03 +0000)]
Revert "Provide a -no-pedantic to cancel out -pedantic."  This needs to be designed
a bit further.  We may wish to just have -Wno flags to silence warnings, and not have a -no-pedantic.

llvm-svn: 158796

12 years agoAdd predicate check around some patterns.
Craig Topper [Wed, 20 Jun 2012 07:01:11 +0000 (07:01 +0000)]
Add predicate check around some patterns.

llvm-svn: 158795

12 years agoFix a warning on a fully covered switch with a default:
Chandler Carruth [Wed, 20 Jun 2012 06:47:54 +0000 (06:47 +0000)]
Fix a warning on a fully covered switch with a default:

../tools/clang/lib/Serialization/ASTReader.cpp:6316:9: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]

Also fix the indentation here to match the coding conventions.

llvm-svn: 158794

12 years agoRestructure how the driver communicates information about the
John McCall [Wed, 20 Jun 2012 06:18:46 +0000 (06:18 +0000)]
Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend:  break this
down into a single target runtime kind and version, and compute
all the relevant information from that.  This makes it
relatively painless to add support for new runtimes to the
compiler.  Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime.  This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

llvm-svn: 158793

12 years agoDon't insert 128-bit UNDEF into 256-bit vectors. Just keep the 256-bit vector. Origin...
Craig Topper [Wed, 20 Jun 2012 05:39:26 +0000 (05:39 +0000)]
Don't insert 128-bit UNDEF into 256-bit vectors. Just keep the 256-bit vector. Original patch by Elena Demikhovsky. Tweaked by me to allow possibility of covering more cases.

llvm-svn: 158792

12 years ago[analyzer] Move failing 'new' test cases back into new.cpp instead of XFAILing.
Jordan Rose [Wed, 20 Jun 2012 05:34:32 +0000 (05:34 +0000)]
[analyzer] Move failing 'new' test cases back into new.cpp instead of XFAILing.

Per Anna's comment, this is a better way to handle "to-do list"-type failures.
This way we'll know if any of the features get fixed; in an XFAIL file, /all/
the cases have to be fixed before lit would tell us anything.

llvm-svn: 158791

12 years agoA new algorithm for computing LoopInfo. Temporarily disabled.
Andrew Trick [Wed, 20 Jun 2012 05:23:33 +0000 (05:23 +0000)]
A new algorithm for computing LoopInfo. Temporarily disabled.

-stable-loops enables a new algorithm for generating the Loop
forest. It differs from the original algorithm in a few respects:

- Not determined by use-list order.
- Initially guarantees RPO order of block and subloops.
- Linear in the number of CFG edges.
- Nonrecursive.

I didn't want to change the LoopInfo API yet, so the block lists are
still inclusive. This seems strange to me, and it means that building
LoopInfo is not strictly linear, but it may not be a problem in
practice. At least the block lists start out in RPO order now. In the
future we may add an attribute or wrapper analysis that allows other
passes to assume RPO order.

The primary motivation of this work was not to optimize LoopInfo, but
to allow reproducing performance issues by decomposing the compilation
stages. I'm often unable to do this with the current LoopInfo, because
the loop tree order determines Loop pass order. Serializing the IR
tends to invert the order, which reverses the optimization order. This
makes it nearly impossible to debug interdependent loop optimizations
such as LSR.

I also believe this will provide more stable performance results across time.

llvm-svn: 158790

12 years agoSphinxify the MakefileGuide document.
Bill Wendling [Wed, 20 Jun 2012 04:20:39 +0000 (04:20 +0000)]
Sphinxify the MakefileGuide document.

llvm-svn: 158789

12 years agoUnbreak the MSVC build: add return to unimplemented functions.
Francois Pichet [Wed, 20 Jun 2012 04:08:49 +0000 (04:08 +0000)]
Unbreak the MSVC build: add return to unimplemented functions.

llvm-svn: 158788

12 years agoMove the implementation of LoopInfo into LoopInfoImpl.h.
Andrew Trick [Wed, 20 Jun 2012 03:42:09 +0000 (03:42 +0000)]
Move the implementation of LoopInfo into LoopInfoImpl.h.

The implementation only needs inclusion from LoopInfo.cpp and
MachineLoopInfo.cpp. Clients of the interface should only include the
interface. This makes the interface readable and speeds up rebuilds
after modifying the implementation.

llvm-svn: 158787

12 years agoSphinxify the CodingStandard documentation.
Bill Wendling [Wed, 20 Jun 2012 02:57:56 +0000 (02:57 +0000)]
Sphinxify the CodingStandard documentation.

llvm-svn: 158786

12 years ago[arcmt]
Argyrios Kyrtzidis [Wed, 20 Jun 2012 01:46:26 +0000 (01:46 +0000)]
[arcmt]
-Disable -pedantic-errors when migrating per Jordan's suggestion.
-Use llvm_move() per John's suggestion.

llvm-svn: 158785

12 years ago[analyzer] Invalidate placement args; return the pointer given to placement new
Jordan Rose [Wed, 20 Jun 2012 01:32:01 +0000 (01:32 +0000)]
[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

12 years ago[objcmt] Have the modern objc migration warning change from:
Argyrios Kyrtzidis [Wed, 20 Jun 2012 01:28:32 +0000 (01:28 +0000)]
[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

12 years agoFix cmake build.
Rafael Espindola [Wed, 20 Jun 2012 01:18:08 +0000 (01:18 +0000)]
Fix cmake build.

llvm-svn: 158782

12 years ago[arcmt] When migrating to ARC disable -Werror so as to only block migration
Argyrios Kyrtzidis [Wed, 20 Jun 2012 01:10:40 +0000 (01:10 +0000)]
[arcmt] When migrating to ARC disable -Werror so as to only block migration
for "hard" ARC errors, not warnings.

rdar://11691437

llvm-svn: 158781

12 years agoUnbreak GCC build: GCC doesn't like clang::Parser::CommentHandler and class clang...
Dmitri Gribenko [Wed, 20 Jun 2012 01:06:08 +0000 (01:06 +0000)]
Unbreak GCC build: GCC doesn't like clang::Parser::CommentHandler and class clang::CommentHandler to have same name.

llvm-svn: 158780

12 years agoDocumentation cleanup: adding/fixing Doxygen markup, particularly \brief,
James Dennett [Wed, 20 Jun 2012 01:00:18 +0000 (01:00 +0000)]
Documentation cleanup: adding/fixing Doxygen markup, particularly \brief,
\code...\endcode, \file commands and escaing for angle brackets.

llvm-svn: 158779

12 years agoDocumentation cleanup: escape "::" to avoid a Doxygen warning
James Dennett [Wed, 20 Jun 2012 00:57:15 +0000 (00:57 +0000)]
Documentation cleanup: escape "::" to avoid a Doxygen warning

llvm-svn: 158778

12 years agoUnbreak CMake build: remove not-yet-committed CommentLexer.cpp.
Dmitri Gribenko [Wed, 20 Jun 2012 00:56:47 +0000 (00:56 +0000)]
Unbreak CMake build: remove not-yet-committed CommentLexer.cpp.

llvm-svn: 158777

12 years agoDocumentation cleanup:
James Dennett [Wed, 20 Jun 2012 00:56:32 +0000 (00:56 +0000)]
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

12 years agoDocumentation cleanup: escape # character in a Doxygen comment.
James Dennett [Wed, 20 Jun 2012 00:51:53 +0000 (00:51 +0000)]
Documentation cleanup: escape # character in a Doxygen comment.

llvm-svn: 158775

12 years agoDocumentation cleanup:
James Dennett [Wed, 20 Jun 2012 00:50:53 +0000 (00:50 +0000)]
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

12 years agoDocumentation cleanup:
James Dennett [Wed, 20 Jun 2012 00:48:54 +0000 (00:48 +0000)]
Documentation cleanup:
* Escaped # characters in Doxygen comments as needed;
* Added/fixed \file and \brief markup to add summaries to Doxygen output.

llvm-svn: 158773

12 years agoAdd the PCH file name to the message about not being able to read the PCH.
Kaelyn Uhrain [Wed, 20 Jun 2012 00:36:03 +0000 (00:36 +0000)]
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

12 years agoStructured comment parsing, first step.
Dmitri Gribenko [Wed, 20 Jun 2012 00:34:58 +0000 (00:34 +0000)]
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

12 years agoAdd permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs and...
Nick Kledzik [Wed, 20 Jun 2012 00:28:54 +0000 (00:28 +0000)]
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

12 years agoDon't assert when given an empty range.
Kaelyn Uhrain [Wed, 20 Jun 2012 00:16:40 +0000 (00:16 +0000)]
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

12 years agoDo a second lookup for type_info in the global namespace in microsoft mode. PR13153.
Nico Weber [Tue, 19 Jun 2012 23:58:27 +0000 (23:58 +0000)]
Do a second lookup for type_info in the global namespace in microsoft mode. PR13153.

llvm-svn: 158768

12 years agoReapply r158700 and fixup patches, minus one hunk that slipped through and
Alexis Hunt [Tue, 19 Jun 2012 23:57:03 +0000 (23:57 +0000)]
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

12 years agoAdd regunit liveness support to LiveIntervals::handleMove().
Jakob Stoklund Olesen [Tue, 19 Jun 2012 23:50:18 +0000 (23:50 +0000)]
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

12 years agoAlphabetize.
Bill Wendling [Tue, 19 Jun 2012 23:47:58 +0000 (23:47 +0000)]
Alphabetize.

llvm-svn: 158764

12 years agoDo not crash when we dynamic cast a final type to void*.
Alexis Hunt [Tue, 19 Jun 2012 23:44:55 +0000 (23:44 +0000)]
Do not crash when we dynamic cast a final type to void*.

llvm-svn: 158763

12 years agoTidy up.
Chad Rosier [Tue, 19 Jun 2012 23:37:57 +0000 (23:37 +0000)]
Tidy up.

llvm-svn: 158762

12 years agoThread Safety Analysis: Move some warnings on thread safety
DeLesley Hutchins [Tue, 19 Jun 2012 23:25:19 +0000 (23:25 +0000)]
Thread Safety Analysis:  Move some warnings on thread safety
attributes into the ThreadSafetyAttributes group, where the other
warnings currently live.

llvm-svn: 158761

12 years agoExtend the support for cl-std to include 1.2.
Tanya Lattner [Tue, 19 Jun 2012 23:09:52 +0000 (23:09 +0000)]
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

12 years agoAdd an ensureMaxAlignment() function to MachineFrameInfo (analogous to
Chad Rosier [Tue, 19 Jun 2012 22:59:12 +0000 (22:59 +0000)]
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

12 years agoAdd DAG-combines for aggressive FMA formation.
Lang Hames [Tue, 19 Jun 2012 22:51:23 +0000 (22:51 +0000)]
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

12 years agoobjective-c: warn when autosynthesizing a property which has same
Fariborz Jahanian [Tue, 19 Jun 2012 22:51:22 +0000 (22:51 +0000)]
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

12 years ago80 col.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 22:50:53 +0000 (22:50 +0000)]
80 col.

llvm-svn: 158755

12 years agoTypo. Patch by Cameron McInally <cameron.mcinally@nyu.edu>.
Chad Rosier [Tue, 19 Jun 2012 22:28:18 +0000 (22:28 +0000)]
Typo. Patch by Cameron McInally <cameron.mcinally@nyu.edu>.

llvm-svn: 158754

12 years agoAdd Projects.rst to the toctree.
Bill Wendling [Tue, 19 Jun 2012 22:25:41 +0000 (22:25 +0000)]
Add Projects.rst to the toctree.

llvm-svn: 158753

12 years agoUse correct capitalization.
Bill Wendling [Tue, 19 Jun 2012 22:25:17 +0000 (22:25 +0000)]
Use correct capitalization.

llvm-svn: 158752

12 years agoChnage VerifyWatchpointIDs() from a static function to a class function to be called...
Johnny Chen [Tue, 19 Jun 2012 22:12:58 +0000 (22:12 +0000)]
Chnage VerifyWatchpointIDs() from a static function to a class function to be called from other source files.

llvm-svn: 158751

12 years agoReapplying the changes from r158717 as they were rolled back to avoid merge conflicts...
Aaron Ballman [Tue, 19 Jun 2012 22:09:27 +0000 (22:09 +0000)]
Reapplying the changes from r158717 as they were rolled back to avoid merge conflicts from a separate problematic patch.

llvm-svn: 158750

12 years agoRevert r158700 and dependent patches r158716, r158717, and r158731.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:48:43 +0000 (21:48 +0000)]
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

12 years agoAdd a triple.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:46:25 +0000 (21:46 +0000)]
Add a triple.

The test was failing on Linux because of asm syntax differences.

llvm-svn: 158748

12 years agoFix -Wc++11-narrowing warnings for narrowing negative values to larger unsigned
Richard Smith [Tue, 19 Jun 2012 21:28:35 +0000 (21:28 +0000)]
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

12 years agoEnable -Wnull-conversion for non-integral target types (eg: double).
David Blaikie [Tue, 19 Jun 2012 21:19:06 +0000 (21:19 +0000)]
Enable -Wnull-conversion for non-integral target types (eg: double).

llvm-svn: 158744

12 years agoImplement PPCInstrInfo::isCoalescableExtInstr().
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:14:34 +0000 (21:14 +0000)]
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

12 years agoStyle: Don't reuse variables for multiple purposes.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:10:18 +0000 (21:10 +0000)]
Style: Don't reuse variables for multiple purposes.

No functional change.

llvm-svn: 158742

12 years agoDocumentation cleanup: escape "::", and other minor reformatting
James Dennett [Tue, 19 Jun 2012 21:05:49 +0000 (21:05 +0000)]
Documentation cleanup: escape "::", and other minor reformatting

llvm-svn: 158741

12 years agoDocumentation cleanup: add \verbatim markup for grammar productions
James Dennett [Tue, 19 Jun 2012 21:04:25 +0000 (21:04 +0000)]
Documentation cleanup: add \verbatim markup for grammar productions

llvm-svn: 158740

12 years agoDocumentation cleanup: fixing file headers to use Doxygen \file markup while
James Dennett [Tue, 19 Jun 2012 21:02:26 +0000 (21:02 +0000)]
Documentation cleanup: fixing file headers to use Doxygen \file markup while
also being sufficiently conformant to LLVM's coding standards.

llvm-svn: 158739

12 years agoobjc-arc: captured block variable accessed in its block literal
Fariborz Jahanian [Tue, 19 Jun 2012 20:53:26 +0000 (20:53 +0000)]
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

12 years agoTest suite cleanup: use Python API to remove files as part of cleanup instead of...
Johnny Chen [Tue, 19 Jun 2012 20:29:50 +0000 (20:29 +0000)]
Test suite cleanup: use Python API to remove files as part of cleanup instead of running OS commands.

llvm-svn: 158737

12 years agoAdjust scan-build to enable color output for xterm-256color.
Ted Kremenek [Tue, 19 Jun 2012 19:27:28 +0000 (19:27 +0000)]
Adjust scan-build to enable color output for xterm-256color.

llvm-svn: 158735

12 years ago[driver] Per Bob's suggestion, emphasize the file dumps.
Chad Rosier [Tue, 19 Jun 2012 18:39:21 +0000 (18:39 +0000)]
[driver] Per Bob's suggestion, emphasize the file dumps.
rdar://11684107

llvm-svn: 158734

12 years agoRemove some debugging code that snuck into r158691.
Kaelyn Uhrain [Tue, 19 Jun 2012 18:38:00 +0000 (18:38 +0000)]
Remove some debugging code that snuck into r158691.

llvm-svn: 158733

12 years agoRevert predefined decl tracking.
Meador Inge [Tue, 19 Jun 2012 18:17:30 +0000 (18:17 +0000)]
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

12 years agoRemove redundant uses of SmallString
Alexis Hunt [Tue, 19 Jun 2012 18:12:18 +0000 (18:12 +0000)]
Remove redundant uses of SmallString

llvm-svn: 158731

12 years agoNew test tool: obj2yaml
Marshall Clow [Tue, 19 Jun 2012 18:02:35 +0000 (18:02 +0000)]
New test tool: obj2yaml

llvm-svn: 158730

12 years ago[driver] Print the compiler version before the diagnostic messages.
Chad Rosier [Tue, 19 Jun 2012 17:51:34 +0000 (17:51 +0000)]
[driver] Print the compiler version before the diagnostic messages.

llvm-svn: 158729

12 years agoIndent coding examples.
Bill Wendling [Tue, 19 Jun 2012 17:48:06 +0000 (17:48 +0000)]
Indent coding examples.

llvm-svn: 158728

12 years ago[driver] Make the crash diagnostic message more visable. Bug reports are being
Chad Rosier [Tue, 19 Jun 2012 17:48:02 +0000 (17:48 +0000)]
[driver] Make the crash diagnostic message more visable.  Bug reports are being
filed, but still missing the preprocessed source and associated run script.
rdar://11684107

llvm-svn: 158727

12 years agoRemove bad HTML tags. Add missing :.
Bill Wendling [Tue, 19 Jun 2012 17:43:57 +0000 (17:43 +0000)]
Remove bad HTML tags. Add missing :.

llvm-svn: 158726

12 years agoFix PR13148, an inf-loop in StringMap.
Chandler Carruth [Tue, 19 Jun 2012 17:40:35 +0000 (17:40 +0000)]
Fix PR13148, an inf-loop in StringMap.

StringMap suffered from the same bug as DenseMap: when you explicitly
construct it with a small number of buckets, you can arrange for the
tombstone-based growth path to be followed when the number of buckets
was less than '8'. In that case, even with a full map, it would compare
'0' as not less than '0', and refuse to grow the table, leading to
inf-loops trying to find an empty bucket on the next insertion. The fix
is very simple: use '<=' as the comparison. The same fix was applied to
DenseMap as well during its recent refactoring.

Thanks to Alex Bolz for the great report and test case. =]

llvm-svn: 158725

12 years agoRemove some superfluous SCOPED_TRACEs from this unit test.
Chandler Carruth [Tue, 19 Jun 2012 17:40:29 +0000 (17:40 +0000)]
Remove some superfluous SCOPED_TRACEs from this unit test.

GoogleTest already prints errors with all the information about which
test case contained the error.

llvm-svn: 158724

12 years agoEmit TableGen's header comment with C-style comments, so it can be used from C89...
Benjamin Kramer [Tue, 19 Jun 2012 17:04:16 +0000 (17:04 +0000)]
Emit TableGen's header comment with C-style comments, so it can be used from C89 code.

Should silence warnings when compiling the X86 disassembler.

llvm-svn: 158723

12 years agoHave ARM ELF use correct reloc for "b" instr.
Jan Wen Voung [Tue, 19 Jun 2012 16:03:02 +0000 (16:03 +0000)]
Have ARM ELF use correct reloc for "b" instr.

The condition code didn't actually matter for arm "b" instructions,
unlike "bl".  It should just use the R_ARM_JUMP24 reloc.

llvm-svn: 158722

12 years agoMark most PPC register classes to avoid write-after-write.
Hal Finkel [Tue, 19 Jun 2012 13:57:17 +0000 (13:57 +0000)]
Mark most PPC register classes to avoid write-after-write.

For processors with the G5-like instruction-grouping scheme, this helps avoid
early group termination due to a write-after-write dependency within the group.
It should also help on pipelined embedded cores.

On POWER7, over the test suite, this gives an average 0.5% speedup. The largest
speedups are:

SingleSource/Benchmarks/Stanford/Quicksort - 33%
MultiSource/Applications/d/make_dparser - 21%
MultiSource/Benchmarks/FreeBench/analyzer/analyzer - 12%
MultiSource/Benchmarks/MiBench/telecomm-FFT/telecomm-fft - 12%

Largest slowdowns:

SingleSource/Benchmarks/Stanford/Bubblesort - 23%
MultiSource/Benchmarks/Prolangs-C++/city/city - 21%
MultiSource/Benchmarks/BitBench/uuencode/uuencode - 16%
MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/mpeg2decode - 13%

llvm-svn: 158719

12 years agoUpdating the credits after r158717
Aaron Ballman [Tue, 19 Jun 2012 13:52:33 +0000 (13:52 +0000)]
Updating the credits after r158717

llvm-svn: 158718

12 years agoImproves parsing and semantic analysis for MS __declspec attributes. This includes...
Aaron Ballman [Tue, 19 Jun 2012 13:49:26 +0000 (13:49 +0000)]
Improves parsing and semantic analysis for MS __declspec attributes.  This includes support for the align (which fixes PR12631).

llvm-svn: 158717

12 years agoStop abusing StringRef. Fixes the Windows build.
Alexis Hunt [Tue, 19 Jun 2012 13:36:02 +0000 (13:36 +0000)]
Stop abusing StringRef. Fixes the Windows build.

I've also removed the duplicate check for PARSED_ATTR since it seems
unnecessary, and would have made the code more complicated.

llvm-svn: 158716

12 years agoPut flag names on one line.
Bill Wendling [Tue, 19 Jun 2012 09:29:05 +0000 (09:29 +0000)]
Put flag names on one line.

llvm-svn: 158715

12 years agoFix italicized text.
Bill Wendling [Tue, 19 Jun 2012 09:27:54 +0000 (09:27 +0000)]
Fix italicized text.

llvm-svn: 158714

12 years agoUse correct URL.
Bill Wendling [Tue, 19 Jun 2012 09:26:15 +0000 (09:26 +0000)]
Use correct URL.

llvm-svn: 158713

12 years agoFix numbering of list items.
Bill Wendling [Tue, 19 Jun 2012 09:25:04 +0000 (09:25 +0000)]
Fix numbering of list items.

llvm-svn: 158712

12 years agoFix some Sphinx mistakes.
Bill Wendling [Tue, 19 Jun 2012 09:23:23 +0000 (09:23 +0000)]
Fix some Sphinx mistakes.

llvm-svn: 158711

12 years ago[Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to sanitizer libc)
Alexey Samsonov [Tue, 19 Jun 2012 09:21:57 +0000 (09:21 +0000)]
[Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to sanitizer libc)

llvm-svn: 158710

12 years agoFirst attempt at Sphinx. Convert the Projects.html file to Sphinx format.
Bill Wendling [Tue, 19 Jun 2012 09:18:34 +0000 (09:18 +0000)]
First attempt at Sphinx. Convert the Projects.html file to Sphinx format.

llvm-svn: 158709

12 years ago[TSan] Add a comment that tsan_flags.h may be included in the user code, and therefor...
Alexey Samsonov [Tue, 19 Jun 2012 08:57:53 +0000 (08:57 +0000)]
[TSan] Add a comment that tsan_flags.h may be included in the user code, and therefore shouldn't include other headers from TSan or common sanitizer runtime. User may need tsan_flags.h to provide its implementation of __tsan::OverrideFlags

llvm-svn: 158708

12 years ago[Sanitizer] State that sanitizer_libc.h header can be included in the user code ...
Alexey Samsonov [Tue, 19 Jun 2012 08:52:02 +0000 (08:52 +0000)]
[Sanitizer] State that sanitizer_libc.h header can be included in the user code (and therefore it shouldn't include other sanitizer runtime headers).

llvm-svn: 158707

12 years ago[Sanitizer] use fully qualified type for placement new replacement
Alexey Samsonov [Tue, 19 Jun 2012 07:40:45 +0000 (07:40 +0000)]
[Sanitizer] use fully qualified type for placement new replacement

llvm-svn: 158706