Commit Graph

162239 Commits

Author SHA1 Message Date
Chandler Carruth f6e9986a41 [PM] Add support for using SFINAE to reflect on an analysis's result
type and detect whether or not it provides an 'invalidate' member the
analysis manager should use.

This lets the overwhelming common case of *not* caring about custom
behavior when an analysis is invalidated be the the obvious default
behavior with no code written by the author of an analysis. Only when
they write code specifically to handle invalidation does it get used.

Both cases are actually covered by tests here. The test analysis uses
the default behavior, and the proxy module analysis actually has custom
behavior on invalidation that is firing correctly. (In fact, this is the
analysis which was the primary motivation for having custom invalidation
behavior in the first place.)

llvm-svn: 195332
2013-11-21 09:10:21 +00:00
Kostya Serebryany 53c51a1675 [tsan] use FileCheck in race_on_speculative_load.cc
llvm-svn: 195331
2013-11-21 09:09:47 +00:00
Ana Pazos 9ac2fc85d2 Implemented Neon scalar vdup_lane intrinsics.
Fixed scalar dup alias and added test case.

llvm-svn: 195330
2013-11-21 08:16:15 +00:00
Ana Pazos dbd1a22496 Implemented Neon scalar vdup_lane intrinsics.
Fixed scalar dup alias and added test case.

llvm-svn: 195329
2013-11-21 08:15:01 +00:00
Ted Kremenek a14c3119ac Revert "Add new attribute 'objc_suppress_protocol' to suppress protocol conformance for a class."
After implementing this patch, a few concerns about the language
feature itself emerged in my head that I had previously not considered.
I want to resolve those design concerns first before having
a half-designed language feature in the tree.

llvm-svn: 195328
2013-11-21 07:57:53 +00:00
Ana Pazos fbc1adbaa7 Implemented Neon scalar by element intrinsics.
Intrinsics implemented: vqdmull_lane, vqdmulh_lane, vqrdmulh_lane,
vqdmlal_lane, vqdmlsl_lane scalar Neon intrinsics.

llvm-svn: 195327
2013-11-21 07:37:04 +00:00
Ana Pazos 2b02688fd9 Implemented Neon scalar by element intrinsics.
Intrinsics implemented: vqdmull_lane, vqdmulh_lane, vqrdmulh_lane,
vqdmlal_lane, vqdmlsl_lane scalar Neon intrinsics.

llvm-svn: 195326
2013-11-21 07:36:33 +00:00
Kostya Serebryany 95f3e54066 [tsan] add a run-time-side regression test for https://code.google.com/p/thread-sanitizer/issues/detail?id=40 (tsan-hostile load speculation)
llvm-svn: 195325
2013-11-21 07:31:12 +00:00
Kostya Serebryany 0b458286e1 Don't speculate loads under ThreadSanitizer
Summary:
Don't speculate loads under ThreadSanitizer.
This fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=40
Also discussed here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-November/067929.html

Reviewers: chandlerc

Reviewed By: chandlerc

CC: llvm-commits, dvyukov

Differential Revision: http://llvm-reviews.chandlerc.com/D2227

llvm-svn: 195324
2013-11-21 07:29:28 +00:00
Ted Kremenek a4bd9a0c0e Add new attribute 'objc_suppress_protocol' to suppress protocol conformance for a class.
The idea is to allow a class to stipulate that its methods (and those
of its parents) cannot be used for protocol conformance in a subclass.
A subclass is then explicitly required to re-implement those methods
of they are present in the class marked with this attribute.

Currently the attribute can only be applied to an @interface, and
not a category or class extension.  This is by design.  Unlike
protocol conformance, where a category can add explicit conformance
of a protocol to class, this anti-conformance really needs to be
observed uniformly by all clients of the class.  That's because
the absence of the attribute implies more permissive checking of
protocol conformance.

This unfortunately required changing method lookup in ObjCInterfaceDecl
to take an optional protocol parameter.  This should not slow down
method lookup in most cases, and is just used for protocol conformance.

llvm-svn: 195323
2013-11-21 07:20:42 +00:00
Ted Kremenek 2d3379e394 Refactor some of handleObjCBridgeAttr to make it more concise and the diagnostic reusable.
llvm-svn: 195322
2013-11-21 07:20:34 +00:00
Bill Wendling 07787f8747 The basic problem is that some mainstream programs cannot deal with the way
clang optimizes tail calls, as in this example:

int foo(void);
int bar(void) {
 return foo();
}

where the call is transformed to:

  calll .L0$pb
.L0$pb:
  popl  %eax
.Ltmp0:
  addl  $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
  movl  foo@GOT(%eax), %eax
  popl  %ebp
  jmpl  *%eax                   # TAILCALL

However, the GOT references must all be resolved at dlopen() time, and so this
approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which
usually populates the PLT with stubs that perform the actual resolving.

This patch changes X86TargetLowering::LowerCall() to skip tail call
optimization, if the called function is a global or external symbol.

Patch by Dimitry Andric!

PR15086

llvm-svn: 195318
2013-11-21 07:04:30 +00:00
Paul Robinson b379efeb53 Teach ISel not to optimize 'optnone' functions.
Based on work by Andrea Di Biagio.

llvm-svn: 195317
2013-11-21 06:33:32 +00:00
Lang Hames fd949a28c3 Dereference the node iterator when dumping the PBQP graph structure in DOT
format.

Thanks to Arnaud A. de Grandmaison for the patch!

llvm-svn: 195316
2013-11-21 06:30:14 +00:00
Reed Kotler 2fc05be887 Add, to constant islands, long jumps similar to ARM far branch.
llvm-svn: 195312
2013-11-21 05:13:23 +00:00
Yuchen Wu 2a9d96992d llvm-cov: Don't assume FileChecksum was generated.
For cases where emitProfileArcs() was called but emitProfileNotes() was
not, set the CfgChecksum to 0.

llvm-svn: 195311
2013-11-21 04:53:39 +00:00
Yuchen Wu 9a74b8c677 llvm-cov: Formatting change.
llvm-svn: 195310
2013-11-21 04:12:10 +00:00
Yuchen Wu 664dc7678b llvm-cov: Fixed some bugs related to file checksum.
Added call to update CfgChecksum. Made FileChecksum a vector, separate
for each source file.

llvm-svn: 195309
2013-11-21 04:01:05 +00:00
Jason Molenda db2f51e5f1 Fixes to get the arm native debugserver building again.
Fix a small typeo in the i386/x86_64 debugserver plugins.

llvm-svn: 195308
2013-11-21 03:59:47 +00:00
Shankar Easwaran 178324d903 [LinkingContext] Limit shared library undefined atoms to be added.
This adds functionality to limit shared library undefined atoms to be added
only once by the Resolver.

Dynamic libraries may be processed more than once if they exist within a
Group.

Also adds a test to verify the change.

llvm-svn: 195307
2013-11-21 03:50:59 +00:00
Hans Wennborg 84fe12d1e9 Provide better diagnostic wording for initializers on static
data member definitions when the variable has an initializer
in its declaration.

For the following code:

  struct S {
    static const int x = 42;
  };
  const int S::x = 42;

This patch changes the diagnostic from:

  a.cc:4:14: error: redefinition of 'x'
  const int S::x = 42;
               ^
  a.cc:2:20: note: previous definition is here
    static const int x = 42;
                     ^
to:

  a.cc:4:18: error: static data member 'x' already has an initializer
  const int S::x = 42;
                   ^
  a.cc:2:24: note: previous initialization is here
    static const int x = 42;
                         ^

Differential Revision: http://llvm-reviews.chandlerc.com/D2235

llvm-svn: 195306
2013-11-21 03:17:44 +00:00
Jason Molenda 4a4b5dcb7d sys/stat.h needed for mkdir, chmod, stat.
llvm-svn: 195305
2013-11-21 02:45:55 +00:00
Chandler Carruth 851a2aa0e0 [PM] Add a module analysis pass proxy for the function analysis manager.
This proxy will fill the role of proxying invalidation events down IR
unit layers so that when a module changes we correctly invalidate
function analyses. Currently this is a very coarse solution -- any
change blows away the entire thing -- but the next step is to make
invalidation handling more nuanced so that we can propagate specific
amounts of invalidation from one layer to the next.

The test is extended to place a module pass between two function pass
managers each of which have preserved function analyses which get
correctly invalidated by the module pass that might have changed what
functions are even in the module.

llvm-svn: 195304
2013-11-21 02:11:31 +00:00
Richard Smith e934d7c9f5 PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. This is a different, and more
targeted, approach than that in r194540.

llvm-svn: 195303
2013-11-21 01:53:02 +00:00
Aaron Ballman f22ef5ab1a Refactored integer argument checking code into a helper method. Removes a considerable amount of duplicated code.
llvm-svn: 195302
2013-11-21 01:50:40 +00:00
Daniel Jasper a78d7d4502 clang-format: Improve formatting of ObjC method expressions.
In particular, make breaking after a parameter's ":" more of a last
resort choice as it significantly affects the readability gained by
aligning the parameters.

Before (in Chromium style - which doesn't allow bin-packing):
  {
    popup_window_.reset([[RenderWidgetPopupWindow alloc]
        initWithContentRect:
            NSMakeRect(
                origin_global.x, origin_global.y, pos.width(), pos.height())
                  styleMask:NSBorderlessWindowMask
                    backing:NSBackingStoreBuffered
                      defer:NO]);
  }

After:
  {
    popup_window_.reset([[RenderWidgetPopupWindow alloc]
        initWithContentRect:NSMakeRect(origin_global.x,
                                       origin_global.y,
                                       pos.width(),
                                       pos.height())
                  styleMask:NSBorderlessWindowMask
                    backing:NSBackingStoreBuffered
                      defer:NO]);
  }

llvm-svn: 195301
2013-11-21 01:46:33 +00:00
Greg Clayton 29b8fc4da9 Added new options to lldb-platform:
--gdbserver-port PORT
    --min-gdbserver-port PORT
    --max-gdbserver-port PORT
    
The --gdbserver-port option can be specified multiple times to tell lldb-platform which ports it can use when launching child GDB server processes.
The --min-gdbserver-port and --max-gdbserver-port options allow a range of ports to be specified for use when launching child GDB server processes.

Fixed the code to manage these ports correctly in GDBRemoteCommunicationServer.

Also changed GDBRemoteCommunicationClient to not set a port when sending the "qLaunchGDBServer" packet so that the remote lldb-platform can decide which ports to use. If the lldb-platform was launched with no --gdbserver-port or --min-gdbserver-port/--max-gdbserver-port options, then port 0 is always used and a unix socket is used between the lldb-platform and child GDB server process to coordinate the use of valid port.

llvm-svn: 195300
2013-11-21 01:44:58 +00:00
Eric Christopher a16725b6b6 Move DebugInfoOffset member near the other data member it helps describe.
llvm-svn: 195299
2013-11-21 01:29:16 +00:00
Eric Christopher 4affe8ce3e Reflow some documentation and remove whitespace comments. Move
DebugInfoOffset data member up with the rest of the data members.

llvm-svn: 195298
2013-11-21 01:29:13 +00:00
Eric Christopher 9f9b304caf Add more documenation for the lookup tables data members.
llvm-svn: 195297
2013-11-21 01:16:31 +00:00
Eric Christopher bca5c63d04 Reorder language in the CompileUnit description and add a comment.
Language may only be a temporary addition.

llvm-svn: 195296
2013-11-21 01:14:00 +00:00
Rui Ueyama dae2ef47f1 [PECOFF] Move files with ".lib" extension to the end of the input file list.
It's allowed to specify library files *before* object files in the command
line. Object files seems to be processed first, and then their undefined
symbols are resolved from the libraries. This patch implements the compatible
behavior.

llvm-svn: 195295
2013-11-21 01:08:53 +00:00
Enrico Granata 5383e81a7f <rdar://problem/15449837>
Change the NSSet data formatter to not use the expression parser to produce synthetic children
In small-scale experimentation with lldb-perf, this improves our performance by around 25%

llvm-svn: 195294
2013-11-21 01:08:05 +00:00
Eric Christopher d89221e7e3 Update comment.
llvm-svn: 195293
2013-11-21 01:01:30 +00:00
Fariborz Jahanian 54c8eaad90 ObjectiveC migrator. use strong instead of
retain attribute for inferred properties.
// rdar://15519923

llvm-svn: 195292
2013-11-21 00:58:17 +00:00
Eric Christopher 0fe676a243 Constify the DIEs used for pubname and pubtype tables. Propagate
through findAttribute etc.

llvm-svn: 195290
2013-11-21 00:48:22 +00:00
Rui Ueyama 2a10b6401b [PECOFF] Do not check if library is already added.
llvm-svn: 195289
2013-11-21 00:43:46 +00:00
Fariborz Jahanian 8c5b4be417 ObjectiveC. Allow toll free bridge cast warnings outside
ARC and in objectiveC/ObjectiveC++ MRR mode as well.
// rdar://15454846

llvm-svn: 195288
2013-11-21 00:39:36 +00:00
Aaron Ballman 18a7838e3e Implemented DefaultIntArgument in the table generator and start using it in semantic analysis. Removes some magic numbers.
llvm-svn: 195287
2013-11-21 00:28:23 +00:00
Nick Kledzik 7cd45f29b2 YAML I/O add support for validate()
MappingTrait template specializations can now have a validate() method which 
performs semantic checking. For details, see <http://llvm.org/docs/YamlIO.html>.

llvm-svn: 195286
2013-11-21 00:28:07 +00:00
Nick Kledzik 4761c60eef revert r194655
llvm-svn: 195285
2013-11-21 00:20:10 +00:00
Rui Ueyama 90bcd114ac Rename allocateString -> allocate.
llvm-svn: 195284
2013-11-21 00:17:31 +00:00
Hans Wennborg feedf8515b [-cxx-abi microsoft] Emit linkonce_odr definitions for declarations of static data members with inline initializers (PR17689)
This makes Clang emit a linkonce_odr definition for 'val' in the code below,
to be compatible with MSVC-compiled code:

  struct Foo {
    static const int val = 1;
  };

Differential Revision: http://llvm-reviews.chandlerc.com/D2233

llvm-svn: 195283
2013-11-21 00:15:56 +00:00
Rui Ueyama 9c9d7d14d1 Reverse the condition for readability.
llvm-svn: 195282
2013-11-20 23:54:52 +00:00
Rui Ueyama 9114439df2 Move member functions to its own cpp file.
llvm-svn: 195281
2013-11-20 23:51:41 +00:00
Richard Smith 698875aec6 Fix new check for missing semicolon after struct definition to deal with the
case where the type in the following declaration is specified as a template-id,
and refactor for clarity.

llvm-svn: 195280
2013-11-20 23:40:57 +00:00
Rui Ueyama 56215d84dc Remove blank return at the end of a function returning void.
llvm-svn: 195279
2013-11-20 23:12:03 +00:00
Fariborz Jahanian 1f92b7f7c4 ObjectiveC ARC. warn in presense of __bridge casting to
or from a toll free bridge cast. // rdar://15454846

llvm-svn: 195278
2013-11-20 22:55:41 +00:00
Aaron Ballman b80f94b41c There is no such thing as __declspec(ms_struct), this is a GNU attribute. Switched the attribute to have the proper spelling, gave it a subject, updated the warning to be more accurate, and updated the test case as appropriate.
llvm-svn: 195277
2013-11-20 22:22:04 +00:00
Rui Ueyama f8b41867c8 [PECOFF] Recognize but ignore /implib and /safeseh for now.
So that the LLD won't print error message saying that it couldn't find
/implib or /safeseh files.

llvm-svn: 195276
2013-11-20 21:57:30 +00:00