Commit Graph

135979 Commits

Author SHA1 Message Date
Matt Beaumont-Gay 53e767bf6b Address feedback from Eli Friedman on r166522.
In particular, we do want to warn on some unused cast subexpressions within
macros.

llvm-svn: 166534
2012-10-24 01:14:28 +00:00
Sean Callanan 3154255fd6 This is a fix for the command option parser.
There was a generic catch-all type for path arguments
called "eArgTypePath," and a specialized version
called "eArgTypeFilename."  It turns out all the
cases where we used eArgTypePath we could have
used Filename or we explicitly meant a directory.

I changed Path to DirectoryName, made it use the
directory completer, and rationalized the uses of
Path.

<rdar://problem/12559915>

llvm-svn: 166533
2012-10-24 01:12:14 +00:00
Nadav Rotem ec57ab374b Change EmitAssemblyHelper to create the target machine early
and use it to initialize the TargetTransformInfo analysis pass.
We need the TTI information for the loop vectorizer.

rdar://12464901

llvm-svn: 166532
2012-10-24 00:53:38 +00:00
Jakub Staszak a6addc2741 Keep coding standard. Don't evaluate getNumOperands() every time.
llvm-svn: 166531
2012-10-24 00:38:25 +00:00
Richard Smith 1f6f455f7c Fix ODR violations: a virtual function must be defined, even if it's never
called. Provide an (asserting) definition of Operator's private destructor.
Remove destructors from all classes derived from Operator. We don't need them
for safety, because their implicit definitions would be ill-formed (they'd call
Operator's private destructor), and we don't need them to avoid emitting
vtables, because we don't do anything with Operator subclasses which would
trigger vtable instantiation.

The Operator hierarchy is still a complete disaster with regard to undefined
behavior, but this at least allows LLVM to link when using Clang's
-fcatch-undefined-behavior with a new vptr-based type checking mechanism.

llvm-svn: 166530
2012-10-24 00:30:41 +00:00
Jordan Rose 1bbd143945 [analyzer] Handle 'SomeVar.SomeEnumConstant', which is legal in C++.
This caused assertion failures analyzing LLVM.

<rdar://problem/12560282>

llvm-svn: 166529
2012-10-23 23:59:08 +00:00
Jordan Rose 746c06d0bc [analyzer] Replace -analyzer-no-eagerly-trim-egraph with graph-trim-interval.
After every 1000 CFGElements processed, the ExplodedGraph trims out nodes
that satisfy a number of criteria for being "boring" (single predecessor,
single successor, and more). Rather than controlling this with a cc1 option,
which can only disable this behavior, we now have an analyzer-config option,
'graph-trim-interval', which can change this interval from 1000 to something
else. Setting the value to 0 disables reclamation.

The next commit relies on this behavior to actually test anything.

llvm-svn: 166528
2012-10-23 23:59:05 +00:00
Chad Rosier a96da4773c [ms-inline asm] Test case for r166526.
llvm-svn: 166527
2012-10-23 23:42:25 +00:00
Chad Rosier a623524487 [ms-inline asm] Offset operator - the size should be based on the size of a
pointer, not the size of the variable.
Part of rdar://12470317

llvm-svn: 166526
2012-10-23 23:42:06 +00:00
Chad Rosier eac2b2003e [ms-inline asm] Clean up comment.
llvm-svn: 166525
2012-10-23 23:34:28 +00:00
Chad Rosier 03c181b021 [ms-inline asm] Update the triple to test r166523.
llvm-svn: 166524
2012-10-23 23:32:21 +00:00
Chad Rosier 146310a1c1 [ms-inline asm] When parsing inline assembly we set the base register to a
non-zero value as we don't know the actual value at this point.  This is
necessary to get the matching correct in some cases.  However, the actual value
set as the base register doesn't matter, since we're just matching not emitting.

llvm-svn: 166523
2012-10-23 23:31:33 +00:00
Matt Beaumont-Gay 493d6d55ba Don't emit -Wunused-value warnings from macro expansions.
llvm-svn: 166522
2012-10-23 23:19:32 +00:00
Douglas Gregor 949cc50962 Tweak include order
llvm-svn: 166521
2012-10-23 23:13:50 +00:00
Douglas Gregor 7959178eb0 Use a .def file for most of the diagnostic options.
llvm-svn: 166520
2012-10-23 23:11:23 +00:00
Michael Liao 6d106b7bfd Clean up code and put transformation on (build_vec (ext x)) into a helper func
llvm-svn: 166519
2012-10-23 23:06:52 +00:00
Fariborz Jahanian 6f5309cf50 Objective-C: check that when a category method is being implemented,
method type in cateogry matches the implementation.
// rdar://12519216

llvm-svn: 166518
2012-10-23 23:06:22 +00:00
Michael J. Spencer 8e95113597 [Support/StringSet] Fix memory leak when inserted key already exists.
llvm-svn: 166517
2012-10-23 22:55:54 +00:00
Douglas Gregor 275e8834c1 Buildbot debugging is fun
llvm-svn: 166516
2012-10-23 22:55:10 +00:00
Kevin Enderby dccdac6a06 Make branch heavy code for generating marked up disassembly simpler
and easier to read by adding a couple helper functions.  Suggestion by
Chandler Carruth and seconded by Meador Inge!

llvm-svn: 166515
2012-10-23 22:52:52 +00:00
Enrico Granata 6c61cbbc49 Better error message for invalid argument to --category - silenced the printout of the raw args when not in verbose mode
llvm-svn: 166514
2012-10-23 22:52:49 +00:00
Douglas Gregor 3f7d548a16 One last unit-test fix
llvm-svn: 166513
2012-10-23 22:43:37 +00:00
Greg Clayton d64dd12fcf Objective C cleanup. Removed an cache that was no longer needed and changes the code that gets the dynamic type and class name to use our new Objective C cache.
llvm-svn: 166512
2012-10-23 22:41:19 +00:00
Douglas Gregor edf8e38701 More unit-test fixes
llvm-svn: 166511
2012-10-23 22:38:58 +00:00
Douglas Gregor cdb4d699a8 Update clang-interpreter example
llvm-svn: 166510
2012-10-23 22:36:49 +00:00
Douglas Gregor d8cfd399fa Fixup unit tests for DiagnosticOptions change
llvm-svn: 166509
2012-10-23 22:31:51 +00:00
Douglas Gregor 811db4eac4 Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.

llvm-svn: 166508
2012-10-23 22:26:28 +00:00
Sean Callanan 7fcf0c131b Added a testcase for runtime types in Objective-C.
llvm-svn: 166507
2012-10-23 22:14:39 +00:00
Enrico Granata 91fe01753d <rdar://problem/12523238> Commit 2 of 3
Adding the new has_children (or MightHaveChildren() in C++) for the existing synthetic children providers
In a few cases, the new call is going to be much more efficient than the previous num_children > 0 check
When the optimization was marginal (e.g. std::vector<>), the choice was to use num_children in order to keep
implementation details in one function instead of duplicating code

Next step is to provide test cases

llvm-svn: 166506
2012-10-23 21:54:53 +00:00
Jordan Rose afaee3c3da CMake: Fix public header search for generating Xcode/MSVC projects.
Previously, we only had support for one level of library under lib/,
with the existence of the two-level lib/StaticAnalyzer/* hardcoded in
the top-level CMakeLists.txt. This became a problem with split of
libRewrite into several libraries -- with the same sub-names as the
libraries in lib/StaticAnalyzer/.

Now, we match up anything under lib/ to the corresponding directory
in include/clang/.

llvm-svn: 166505
2012-10-23 21:54:03 +00:00
Michael Liao 2843625bb5 Fix PR14161
- Check index being extracted to be constant 0 before simplfiying.
  Otherwise, retain the original sequence.

llvm-svn: 166504
2012-10-23 21:40:15 +00:00
Jordan Rose c7b09dd1d1 CMake: Include private headers / tablegen files in generated Xcode projects.
llvm-svn: 166503
2012-10-23 21:36:55 +00:00
Jim Ingham ce0740d8cf Turns out there are 8 bits in a byte.
llvm-svn: 166502
2012-10-23 21:09:09 +00:00
Nadav Rotem 33e034a4b3 Make the indirect branch optimization deterministic. No functionality change.
Patch by Daniel Reynaud.

llvm-svn: 166501
2012-10-23 21:05:33 +00:00
Eli Friedman 9cc8ac523c Fix pretty-printing pseudo-destructor calls. Patch by Grzegorz Jablonski.
llvm-svn: 166500
2012-10-23 20:26:57 +00:00
Eli Friedman 4e2e13edb7 Delete junk that snuck into r166498.
llvm-svn: 166499
2012-10-23 20:23:23 +00:00
Eli Friedman 7d14b3c9b3 Add a new warning -Wmissing-variable-declarations, to warn about variables
defined without a previous declaration.  This is similar to
-Wmissing-prototypes, but for variables instead of functions.

Patch by Ed Schouten.

llvm-svn: 166498
2012-10-23 20:19:32 +00:00
Douglas Gregor b0eea8b54b Switch CodeGenOptions over to a .def file, like we do with LangOptions.
llvm-svn: 166497
2012-10-23 20:05:01 +00:00
Richard Smith 40c180db13 When rebuilding a DependentScopeDeclRefExpr, perform a lookup into the scope
even if it's dependent, in case it now names a member of the current instantiation.

llvm-svn: 166496
2012-10-23 19:56:01 +00:00
Enrico Granata adaf282c76 <rdar://problem/12523238> Commit 1 of 3
This commit enables the new HasChildren() feature for synthetic children providers
Namely, it hooks up the required bits and pieces so that individual synthetic children providers can implement a new (optional) has_children call
Default implementations have been provided where necessary so that any existing providers continue to work and behave correctly

Next steps are:
2) writing smart implementations of has_children for our providers whenever possible
3) make a test case

llvm-svn: 166495
2012-10-23 19:54:09 +00:00
Matt Beaumont-Gay bdcebd323a Silence -Wsign-compare
llvm-svn: 166494
2012-10-23 19:46:36 +00:00
Pete Cooper 41ef09a4b5 Change DenseMap to use a power of 2 growth if one is given instead of the next power of 2. This was causing DenseMaps to grow 4x instead of 2x. I'll keep an eye on the buildbots as this could impact performance
llvm-svn: 166493
2012-10-23 19:34:36 +00:00
Pete Cooper 8ba353da39 Fixed bug in SmallDenseMap where it wouldn't leave enough space for an empty bucket if the number of values was exactly equal to the small capacity. This led to an infinite loop when finding a non-existent element
llvm-svn: 166492
2012-10-23 18:47:35 +00:00
Nadav Rotem 5bed7b4fad Use the AliasAnalysis isIdentifiedObj because it also understands mallocs and c++ news.
PR14158.

llvm-svn: 166491
2012-10-23 18:44:18 +00:00
Bill Wendling 5858b56ce3 Ignore unreachable blocks when doing memory dependence analysis on non-local
loads. It's not really profitable and may result in GVN going into an infinite
loop when it hits constructs like this:

     %x = gep %some.type %x, ...

Found via an LTO build of LLVM.

llvm-svn: 166490
2012-10-23 18:37:11 +00:00
Chad Rosier b8097dec8f [ms-inline asm] Update for r166433.
llvm-svn: 166489
2012-10-23 17:44:40 +00:00
Chad Rosier 37e755cee2 [ms-inline asm] Add an implementation of the offset operator. This is a follow
on patch to r166433.
rdar://12470317

llvm-svn: 166488
2012-10-23 17:43:43 +00:00
Michael Liao c03c03d56e Add custom UINT_TO_FP from v4i8/v4i16/v8i8/v8i16 to v4f32/v8f32
- Replace v4i8/v8i8 -> v8f32 DAG combine with custom lowering to reduce
  DAG combine overhead.
- Extend the support to v4i16/v8i16 as well.

llvm-svn: 166487
2012-10-23 17:36:08 +00:00
Michael Liao 1be96bb5ce Enable lowering ZERO_EXTEND/ANY_EXTEND to PMOVZX from SSE4.1
llvm-svn: 166486
2012-10-23 17:34:00 +00:00
Eric Christopher c33f622c6f Grammar.
llvm-svn: 166485
2012-10-23 17:19:15 +00:00