Commit Graph

124162 Commits

Author SHA1 Message Date
Kostya Serebryany 01401cec00 [asan] rename class BlackList to FunctionBlackList and move it into a separate file -- we will need the same functionality in ThreadSanitizer
llvm-svn: 152753
2012-03-14 23:22:10 +00:00
Chandler Carruth 4d1d34fbfc Extend the inline cost calculation to account for bonuses due to
correlated pairs of pointer arguments at the callsite. This is designed
to recognize the common C++ idiom of begin/end pointer pairs when the
end pointer is a constant offset from the begin pointer. With the
C-based idiom of a pointer and size, the inline cost saw the constant
size calculation, and this provides the same level of information for
begin/end pairs.

In order to propagate this information we have to search for candidate
operations on a pair of pointer function arguments (or derived from
them) which would be simplified if the pointers had a known constant
offset. Then the callsite analysis looks for such pointer pairs in the
argument list, and applies the appropriate bonus.

This helps LLVM detect that half of bounds-checked STL algorithms
(such as hash_combine_range, and some hybrid sort implementations)
disappear when inlined with a constant size input. However, it's not
a complete fix due the inaccuracy of our cost metric for constants in
general. I'm looking into that next.

Benchmarks showed no significant code size change, and very minor
performance changes. However, specific code such as hashing is showing
significantly cleaner inlining decisions.

llvm-svn: 152752
2012-03-14 23:19:53 +00:00
Fariborz Jahanian 07a423d652 modern objective-c translator: section info.
and metadata for "non-lazy" class and categories.

llvm-svn: 152751
2012-03-14 23:18:19 +00:00
Richard Smith 4b38ded66a Instantiating a class template should not instantiate the definition of any
scoped enumeration members. Later uses of an enumeration temploid as a nested
name specifier should cause its instantiation. Plus some groundwork for
explicit specialization of member enumerations of class templates.

llvm-svn: 152750
2012-03-14 23:13:10 +00:00
Matt Beaumont-Gay be84d85905 '#if 0' out a variable that's only used in other preprocessor-disabled code.
(Why are we keeping all of this code around anyway? Say the word and I'll
start swinging the delete hammer.)

llvm-svn: 152749
2012-03-14 23:12:42 +00:00
Dan Gohman 532fb8131b When an invoke is marked with metadata indicating its unwind edge
should be ignored by ARC optimization, don't insert new ARC runtime
calls in the unwind destination.

llvm-svn: 152748
2012-03-14 23:05:06 +00:00
Kostya Serebryany baf68ffcf8 [asan] fix -Wnull-conversion warnings
llvm-svn: 152747
2012-03-14 22:48:09 +00:00
Francois Pichet 118bad1a08 Fixes the MSVC build.
Commit r152704 exposed a latent MSVC limitation (aka bug). 
Both ilist and and iplist contains the same function:
  template<class InIt> void insert(iterator where, InIt first, InIt last) {
    for (; first != last; ++first) insert(where, *first);
  }

Also ilist inherits from iplist and ilist contains a "using iplist<NodeTy>::insert".
MSVC doesn't know which one to pick and complain with an error.

I think it is safe to delete ilist::insert since it is redundant anyway.

llvm-svn: 152746
2012-03-14 22:36:10 +00:00
David Blaikie 1ce8dbb93f Provide -Wnull-conversion separately from -Wconversion.
Like GCC, provide a NULL conversion to non-pointer conversion as a separate
flag, on by default. GCC's flag is "conversion-null" which we provide for
cross compatibility, but in the interests of consistency (with
-Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called
-Wnull-conversion.

Patch by Lubos Lunak.
Review feedback by myself, Chandler Carruth, and Chad Rosier.

llvm-svn: 152745
2012-03-14 22:28:22 +00:00
Fariborz Jahanian ddddca3e6d objective-c modern tranaltor. More section info.
for misc. objc meta-data.

llvm-svn: 152743
2012-03-14 21:44:09 +00:00
Anna Zaks 3a0f57057e [analyzer] A fixup to r152734. Always initialize the flag.
llvm-svn: 152742
2012-03-14 21:24:14 +00:00
Greg Clayton 1b02c17391 <rdar://problem/11049371>
http://llvm.org/bugs/show_bug.cgi?id=12232

Fixed a case where a missing "break" in a switch statement could cause an assertion to fire and kill the debug session.

The fix was derived from the findings of Andrea Bigagli, thanks Andrea.

llvm-svn: 152741
2012-03-14 21:00:47 +00:00
Aaron Ballman bc9e04342d No longer defining LP64 in 64-bit builds on platforms which are not LP64.
llvm-svn: 152740
2012-03-14 20:50:57 +00:00
Nick Lewycky fcd5e7a160 When emitting a diagnostic about two-phase name lookup, don't do useless
qualified name lookups into transparent contexts.

llvm-svn: 152739
2012-03-14 20:41:00 +00:00
Matt Beaumont-Gay dcc425ec19 Fix dereference of end iterator. Spotted by ASan.
llvm-svn: 152738
2012-03-14 20:21:25 +00:00
Chandler Carruth 30b8416d2c Change where we enable the heuristic that delays inlining into functions
which are small enough to themselves be inlined. Delaying in this manner
can be harmful if the function is inelligible for inlining in some (or
many) contexts as it pessimizes the code of the function itself in the
event that inlining does not eventually happen.

Previously the check was written to only do this delaying of inlining
for static functions in the hope that they could be entirely deleted and
in the knowledge that all callers of static functions will have the
opportunity to inline if it is in fact profitable. However, with C++ we
get two other important sources of functions where the definition is
always available for inlining: inline functions and templated functions.
This patch generalizes the inliner to allow linkonce-ODR (the linkage
such C++ routines receive) to also qualify for this delay-based
inlining.

Benchmarking across a range of large real-world applications shows
roughly 2% size increase across the board, but an average speedup of
about 0.5%. Some benhcmarks improved over 2%, and the 'clang' binary
itself (when bootstrapped with this feature) shows a 1% -O0 performance
improvement when run over all Sema, Lex, and Parse source code smashed
into a single file. A clean re-build of Clang+LLVM with a bootstrapped
Clang shows approximately 2% improvement, but that measurement is often
noisy.

llvm-svn: 152737
2012-03-14 20:16:41 +00:00
Howard Hinnant ffa26667d9 Missed an underscore on the last commit.
llvm-svn: 152736
2012-03-14 19:39:50 +00:00
Howard Hinnant baae2be624 Enable __arm__ on apple
llvm-svn: 152735
2012-03-14 19:30:00 +00:00
Anna Zaks d4e9059fe0 [analyzer] Diagnostics: Supply Caller information even if the bug occurs
in the callee.

llvm-svn: 152734
2012-03-14 18:58:28 +00:00
Enrico Granata a88fdd3cdd Committing a patch from Filipe Cabecinhas
llvm-svn: 152733
2012-03-14 18:52:33 +00:00
Johnny Chen 24b5b8b7b8 Remove a debug statement.
llvm-svn: 152732
2012-03-14 18:35:38 +00:00
Fariborz Jahanian 4548962f00 objective-c modern translator.
Add the _class_ro_t.reserved field for 64bit targets.
// rdar://11040024

llvm-svn: 152731
2012-03-14 18:09:23 +00:00
Erik Verbruggen 5923cbd27b [Analyser] Remove unnecessary recursive visits for ExprWithCleanups and
MaterializeTemporaryExpr.

llvm-svn: 152730
2012-03-14 18:01:43 +00:00
Douglas Gregor d23e333bf6 Remove clang-wpa example, which has been unmaintained for quite a while.
llvm-svn: 152729
2012-03-14 17:29:44 +00:00
Sean Callanan cc5039dd9e Updating Xcode project version numbers for lldb-131 and debugserver-181
llvm-svn: 152726
2012-03-14 17:15:39 +00:00
Douglas Gregor 5c3cc42342 Minor cleanup in attribute-related diagnostics, from Alexander Kornienko!
llvm-svn: 152725
2012-03-14 16:55:17 +00:00
Sebastian Redl db63af2216 Parse brace initializers as default arguments. PR12236.
llvm-svn: 152721
2012-03-14 15:54:00 +00:00
Erik Verbruggen fe66dd624d [Analyser] Removes more recursive visitations in ExprEngine that are no
longer needed as the CFG is fully linearized.

llvm-svn: 152720
2012-03-14 15:38:55 +00:00
David Chisnall 1e02029f37 Undo some overzealous #ifdefs for LIBCXXRT.
llvm-svn: 152718
2012-03-14 14:11:13 +00:00
David Chisnall 5f13d66fb4 Make sure [at_]quick_exit is in std::
llvm-svn: 152717
2012-03-14 14:10:37 +00:00
David Chisnall 2f4cb4d79d Don't refer to a function that doesn't exist in the quick_exit test.
llvm-svn: 152716
2012-03-14 14:02:15 +00:00
Eli Bendersky f0a1305bc0 Some typos in lit command guide
llvm-svn: 152712
2012-03-14 11:34:19 +00:00
Benjamin Kramer 05e7a843aa Silence operator precedence warnings.
llvm-svn: 152711
2012-03-14 11:26:37 +00:00
Benjamin Kramer e6afc77a1b Makefile build: clang now depends on libclangEdit.
llvm-svn: 152710
2012-03-14 11:03:46 +00:00
Daniel Dunbar 7be12296fe [Basic] Change DiagnosticBuilder to use a separate status variable to track whether the builder is active.
- This may seem superflous, but actually this allows the optimizer to more
   easily eliminate the isActive() checks needed by the SemaDiagnosticBuilder
   and DiagnosticBuilder dtors. And by more easily, I mean the current LLVM is
   actually able to do one and not the other. :)

This is good for another 20k code size reduction.

llvm-svn: 152709
2012-03-14 09:49:36 +00:00
Daniel Dunbar d671ab94fe [Sema] Fix SemaDiagnosticBuilder to be inline.
- As with DiagnosticBuilder, it is very important that SemaDiagnosticBuilder be
   completely inline to ensure that the compiler can rip it apart and sink it to
   registers.

This is good for another 30k reduction in code size.

llvm-svn: 152708
2012-03-14 09:49:32 +00:00
Bill Wendling 21ee0d21ae Update the "hello world" example to resemble what we currently output.
Also do some minor reformatting.

llvm-svn: 152707
2012-03-14 08:07:43 +00:00
Chandler Carruth a308955993 Refactor the inline cost bonus calculation for constants to use
a worklist rather than a recursive call.

No functionality changed.

llvm-svn: 152706
2012-03-14 07:32:53 +00:00
Bill Wendling d7c0aae45b Reapply r152486 with a fix for the nightly testers.
There were cases where a value could be used and it's both crossing an invoke
and NOT crossing an invoke. This could happen in the landing pads. In that case,
we will demote the value to the stack like we did before.
<rdar://problem/10609139>

llvm-svn: 152705
2012-03-14 07:28:01 +00:00
Bill Wendling 618d57310a Insert the debugging instructions in one fell-swoop so that it doesn't call the
expensive "getFirstTerminator" call. This reduces the time of compilation in
PR12258 from >10 minutes to < 10 seconds.

llvm-svn: 152704
2012-03-14 07:14:25 +00:00
Eli Bendersky c54f63b204 Clean up removed file after r152620
llvm-svn: 152703
2012-03-14 06:16:57 +00:00
Eli Bendersky 2859178242 Typo in lit command guide
llvm-svn: 152702
2012-03-14 06:09:20 +00:00
Andrew Trick 8823decdd4 misched: implemented a framework for top-down or bottom-up scheduling.
New flags: -misched-topdown, -misched-bottomup. They can be used with
the default scheduler or with -misched=shuffle. Without either
topdown/bottomup flag -misched=shuffle now alternates scheduling
direction.

LiveIntervals update is unimplemented with bottom-up scheduling, so
only -misched-topdown currently works.

Capped the ScheduleDAG hierarchy with a concrete ScheduleDAGMI class.
ScheduleDAGMI is aware of the top and bottom of the unscheduled zone
within the current region. Scheduling policy can be plugged into
the ScheduleDAGMI driver by implementing MachineSchedStrategy.
ConvergingScheduler is now the default scheduling algorithm.
It exercises the new driver but still does no reordering.

llvm-svn: 152700
2012-03-14 04:00:41 +00:00
Andrew Trick 72515bef32 misched comments
llvm-svn: 152699
2012-03-14 04:00:38 +00:00
Greg Clayton d64afba584 <rdar://problem/10434005>
Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind
macros that allows us to easily compile for either C++.

llvm-svn: 152698
2012-03-14 03:07:05 +00:00
Eric Christopher a9916d0296 Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing).

Saves 1% on the debug information for a build of llvm.

Fixes rdar://11043421

llvm-svn: 152697
2012-03-14 02:59:17 +00:00
Greg Clayton 29e08cbb9c <rdar://problem/11042408>
Fixed an issue with the FUNC_STARTS load command where we would get the
symbol size wrong and we would add all sorts of symbols due to bit zero being
set to indicate thumb.

llvm-svn: 152696
2012-03-14 01:53:24 +00:00
Matt Beaumont-Gay 1c883c58dd Remove trailing whitespace (especially after a \ which should be trailing)
llvm-svn: 152695
2012-03-14 01:23:41 +00:00
Benjamin Kramer 91b9ac8ae9 -arch is a darwin-only feature, use -target instead to make the linux buildbots happy again.
Also check the error message.

llvm-svn: 152694
2012-03-14 01:17:52 +00:00
Nick Kledzik 37cb6555f0 fix crash log magic
llvm-svn: 152693
2012-03-14 01:16:14 +00:00