Commit Graph

129180 Commits

Author SHA1 Message Date
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
Fariborz Jahanian edc2971c4d objc: improved diagnostic when property autosynthesis may cause
change in behavior. // rdar://11671080

llvm-svn: 158828
2012-06-20 17:18:31 +00:00
Jakob Stoklund Olesen d702e8fddf Delete dead code.
llvm-svn: 158827
2012-06-20 16:38:50 +00:00
Alexis Hunt 6c19063a1c Fix a thinko and a stray debugging hunk in my attributes patch. Thanks to Jordan
Rose and Richard Smith for catching these.

llvm-svn: 158826
2012-06-20 16:05:42 +00:00
Hal Finkel ca542beffe Add support for generating reg+reg (indexed) pre-inc loads on PPC.
llvm-svn: 158823
2012-06-20 15:43:03 +00:00
Hal Finkel 8a31138521 Fix DAGCombine to deal with ext-conversion of pre/post_inc loads.
The test case for this will come with the PPC indexed preinc loads commit.

llvm-svn: 158822
2012-06-20 15:42:48 +00:00
Kostya Serebryany 98390d0b71 [tsan] a bit more lint and Makefile changes to run tests from sanitizer_common
llvm-svn: 158821
2012-06-20 15:19:17 +00:00
Aaron Ballman 421a5ba06d Fixing a compiler warning in MSVC 10.
llvm-svn: 158820
2012-06-20 14:44:44 +00:00
Bill Wendling 814ad4a169 Sphinxify the SegmentedStack document.
llvm-svn: 158819
2012-06-20 12:05:05 +00:00
Bill Wendling 1eec272587 Move coding standards reference from development_process.rst to programming.rst.
llvm-svn: 158818
2012-06-20 11:56:24 +00:00
Bill Wendling 39174deb12 Unindent list.
llvm-svn: 158817
2012-06-20 11:55:22 +00:00
Bill Wendling 3a9192c19a Un-indent list to remove ugly back-slash.
llvm-svn: 158816
2012-06-20 11:53:08 +00:00
Bill Wendling 4a8948d583 Fix the formatting a bit.
llvm-svn: 158815
2012-06-20 11:25:11 +00:00
Bill Wendling f42595a75f Sphinxify the developer policy document.
llvm-svn: 158814
2012-06-20 11:20:07 +00:00
Bill Wendling 29f569c3c6 Sphinxify the lexicon doc.
llvm-svn: 158813
2012-06-20 10:36:41 +00:00
Chandler Carruth bf22bd21e9 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
2012-06-20 10:18:43 +00:00
Bill Wendling 8a6215c3b6 Sphinxify BranchWeightMetadata document.
llvm-svn: 158810
2012-06-20 10:17:46 +00:00
Filipe Cabecinhas 0eec15acf2 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
2012-06-20 10:13:40 +00:00
Bill Wendling 8cb8e9987b Sphinxify the LTO document.
llvm-svn: 158808
2012-06-20 10:08:02 +00:00
Chandler Carruth 39a3e7544a 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
2012-06-20 09:53:52 +00:00
Bill Wendling dca6fccd1f Unindent list.
llvm-svn: 158806
2012-06-20 09:50:45 +00:00
Bill Wendling e78ab21781 Sphinxify the AliasAnalysis document.
llvm-svn: 158805
2012-06-20 09:49:57 +00:00
Bill Wendling b2f7b95b9d Unindent list.
llvm-svn: 158804
2012-06-20 09:49:06 +00:00
Bill Wendling 7aa439ece8 Un-indent the list and remove ugly back-slash.
llvm-svn: 158803
2012-06-20 09:48:38 +00:00
Chandler Carruth e813806462 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
2012-06-20 08:43:50 +00:00
Chandler Carruth 5c0997f066 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
2012-06-20 08:39:33 +00:00
Chandler Carruth c60fbe6b58 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
2012-06-20 08:39:30 +00:00
Chandler Carruth 35e6706675 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
2012-06-20 08:39:27 +00:00
Craig Topper 21d04fc118 Add predicate check around some patterns.
llvm-svn: 158797
2012-06-20 07:30:23 +00:00
Ted Kremenek c26328afa6 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
2012-06-20 07:03:37 +00:00
Craig Topper 3b662a6279 Add predicate check around some patterns.
llvm-svn: 158795
2012-06-20 07:01:11 +00:00
Chandler Carruth 029ea4ad29 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
2012-06-20 06:47:54 +00:00
John McCall 5fb5df9c83 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
2012-06-20 06:18:46 +00:00
Craig Topper b9e8e18949 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
2012-06-20 05:39:26 +00:00
Jordan Rose 7d2bdd538d [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
2012-06-20 05:34:32 +00:00
Andrew Trick ff2ed7b687 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
2012-06-20 05:23:33 +00:00
Bill Wendling 74ede098b3 Sphinxify the MakefileGuide document.
llvm-svn: 158789
2012-06-20 04:20:39 +00:00
Francois Pichet 5dc987a3d1 Unbreak the MSVC build: add return to unimplemented functions.
llvm-svn: 158788
2012-06-20 04:08:49 +00:00
Andrew Trick cda51d430d 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
2012-06-20 03:42:09 +00:00
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