Commit Graph

122032 Commits

Author SHA1 Message Date
Sebastian Redl d74dd49065 Proper initializer list support for new expressions and type construct expressions. Array new still missing.
llvm-svn: 150346
2012-02-12 18:41:05 +00:00
Douglas Gregor 1a22d2889b Lambdas have a deleted default constructor and a deleted copy
assignment operator, per C++ [expr.prim.lambda]p19. Make it so.

llvm-svn: 150345
2012-02-12 17:34:23 +00:00
Sebastian Redl 0501c63609 Change the way we store initialization kinds so that all direct inits can distinguish between list and parens form. This allows us to correctly diagnose the last test cases from litb.
llvm-svn: 150343
2012-02-12 16:37:36 +00:00
Sebastian Redl 5a41f68fe2 Employ DirectList initialized entities to properly sort through some initialization edge cases.
llvm-svn: 150342
2012-02-12 16:37:24 +00:00
Nadav Rotem 34ca89afa8 This patch addresses the problem of poor code generation for the zext
v8i8 -> v8i32 on AVX machines. The codegen often scalarizes ANY_EXTEND nodes.
The DAGCombiner has two optimizations that can mitigate the problem. First,
if all of the operands of a BUILD_VECTOR node are extracted from an ZEXT/ANYEXT
nodes, then it is possible to create a new simplified BUILD_VECTOR which uses
UNDEFS/ZERO values to eliminate the scalar ZEXT/ANYEXT nodes.
Second, another dag combine optimization lowers BUILD_VECTOR into a shuffle
vector instruction.

In the case of zext v8i8->v8i32 on AVX, a value in an XMM register is to be
shuffled into a wide YMM register.

This patch modifes the second optimization and allows the creation of
shuffle vectors even when the newly generated vector and the original vector
from which we extract the values are of different types.

llvm-svn: 150340
2012-02-12 15:05:31 +00:00
Tobias Grosser 0b6c613a10 CodeGen: Maintain a valid CFG during code generation
Before this change we built the CFG such that it was only valid after code was
fully generated. During code generation itself, it was often incomplete. After
this change always maintain a valid CFG. This will later allow us to use the
SCEVExpander during code generation. This is the first step to get rid of the
independent blocks pass.

llvm-svn: 150339
2012-02-12 12:09:53 +00:00
Tobias Grosser 194beea739 CodeGen: Remove unused instruction
llvm-svn: 150338
2012-02-12 12:09:49 +00:00
Tobias Grosser 8518bbe39f CodeGen: Always name merge block
llvm-svn: 150337
2012-02-12 12:09:46 +00:00
Tobias Grosser bd608a8949 CodeGen: Start variable names with uppercase letter.
llvm-svn: 150336
2012-02-12 12:09:41 +00:00
Tobias Grosser 0dbbdd7637 Codegen: Give split and merge basic blocks better names
llvm-svn: 150335
2012-02-12 12:09:37 +00:00
Tobias Grosser d855cc5720 CodeGen: Further improve style
llvm-svn: 150334
2012-02-12 12:09:32 +00:00
Tobias Grosser b1c9599faa CodeGen: Move generation of OpenMP out of the way
We also fix some style issues. This change contains no functional change.

llvm-svn: 150333
2012-02-12 12:09:27 +00:00
Benjamin Kramer 22a0fdf24b StringSwitchify the rest of Triple.cpp.
llvm-svn: 150332
2012-02-12 10:56:52 +00:00
Chandler Carruth ff6f356b95 Switch a bunch of manual if-chains to use StringSwitch. Clean them up in
the process. Some of these are still a bit gross.

Still, this cuts 80 some lines out of this ridiculous file. ;]

llvm-svn: 150331
2012-02-12 09:27:38 +00:00
Michael J. Spencer 9dc864b6ce Fix broken link. I believe this has been broken for at least 7 months.
llvm-svn: 150329
2012-02-12 09:11:39 +00:00
Craig Topper e24c94af81 Remove more vector_shuffle patterns.
llvm-svn: 150328
2012-02-12 08:14:35 +00:00
Eli Bendersky c7d23ddbbb Expose the ELFObjectFile class directly in the Object/ELF.h header, similarly
to what's done for MachO and COFF. This allows advanced uses of the class to
be implemented outside the Object library. In particular, the DyldELFObject
subclass is now moved into its logical home - ExecutionEngine/RuntimeDyld.

This patch was reviewed by Michael Spencer.

llvm-svn: 150327
2012-02-12 06:12:10 +00:00
Nick Lewycky c1572e4c90 Handle InvokeInst in EvaluateBlock. Don't try to support exceptions, it's just
that no optz'ns have run yet to convert invokes to calls.

llvm-svn: 150326
2012-02-12 05:09:35 +00:00
Argyrios Kyrtzidis 75627ad8ba Fix the rewriter that broke with r149987.
r149987 changed the way parsing happens inside an @implementation;
it aggregates the declarations inside and reports them together as a DeclGroup.
This had the side effect that function declarations were reported together with
their definition, while the rewriter expected for function declarations to be
reported immediately to the consumer and thus not have a body.

Fix this by having the rewriter actually check with isThisDeclarationADefinition()
to make sure the body comes from the current decl before rewriting it.

llvm-svn: 150325
2012-02-12 04:48:45 +00:00
Nick Lewycky f285256f72 false is totally null!
llvm-svn: 150324
2012-02-12 02:17:18 +00:00
Nick Lewycky 4b273cb7ea Remove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI calls
to TargetLibraryInfo and use one of them in GlobalOpt.

llvm-svn: 150323
2012-02-12 02:15:20 +00:00
Nick Lewycky cf6aae686d Pass TargetData and TargetLibraryInfo through to the constant folder. Fixes a
few fixme's when TLI was added.

llvm-svn: 150322
2012-02-12 01:13:18 +00:00
Craig Topper d40d9eb2b3 Remove more vector_shuffle patterns.
llvm-svn: 150321
2012-02-12 01:07:34 +00:00
Nick Lewycky 1480f1d3f9 Fix function name in comment to match actual name. Fix comments that are using
doxy-style on local variables to not do so. Fix one 80-col violation.

llvm-svn: 150320
2012-02-12 00:52:26 +00:00
Nick Lewycky 4231c41c64 Don't traverse the PHI nodes twice. No functionality change!
llvm-svn: 150319
2012-02-12 00:47:24 +00:00
Sebastian Redl a935179ab7 Represent C++ direct initializers as ParenListExprs before semantic analysis
instead of having a special-purpose function.

- ActOnCXXDirectInitializer, which was mostly duplication of
  AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days
  ago), is dropped completely.
- MultiInitializer, which was an ugly hack I added, is dropped again.
- We now have the infrastructure in place to distinguish between
  int x = {1};
  int x({1});
  int x{1};
-- VarDecl now has getInitStyle(), which indicates which of the above was used.
-- CXXConstructExpr now has a flag to indicate that it represents list-
   initialization, although this is not yet used.
- InstantiateInitializer was renamed to SubstInitializer and simplified.
- ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which
  always produces a ParenListExpr. Placed that so far failed to convert that
  back to a ParenExpr containing comma operators have been fixed. I'm pretty
  sure I could have made a crashing test case before this.

The end result is a (I hope) considerably cleaner design of initializers.
More importantly, the fact that I can now distinguish between the various
initialization kinds means that I can get the tricky generalized initializer
test cases Johannes Schaub supplied to work. (This is not yet done.)

This commit passed self-host, with the resulting compiler passing the tests. I
hope it doesn't break more complicated code. It's a pretty big change, but one
that I feel is necessary.

llvm-svn: 150318
2012-02-11 23:51:47 +00:00
Sebastian Redl 46afb55177 Drive-by fix of incorrect diagnostic, and a test case for said diagnostic. The double error is unfortunate, but I really don't see an alternative whose effort is worth it.
llvm-svn: 150317
2012-02-11 23:51:21 +00:00
Sebastian Redl 82ace98d55 Fix parsing new expressions using init lists. Probably still do the wrong thing in cases involving array new.
Show that many cases using initializer list constructors work, in that they parse and pass semantic analysis.

llvm-svn: 150316
2012-02-11 23:51:08 +00:00
Anna Zaks 41b84847bf [analyzer] Malloc Checker: reduce false negatives rate by assuming that
a pointer cannot escape through calls to system functions. Also, stop
after reporting the first use-after-free.

llvm-svn: 150315
2012-02-11 23:46:36 +00:00
Craig Topper 330ca97700 Remove more vector_shuffle patterns.
llvm-svn: 150314
2012-02-11 23:31:01 +00:00
Anna Zaks 3aa5225d5e [analyzer] Malloc Checker: Report a leak when we are returning freed
memory.
(As per one test case, the existing checker thought that this could
cause a lot of false positives - not sure if that's valid, to be
verified.)

llvm-svn: 150313
2012-02-11 21:44:39 +00:00
Anna Zaks d3571e5ad3 [analyzer] Malloc checker: Leak bugs should be suppressed by sinks.
Resolves a common false positive, where we were reporting a leak inside
asserts

llvm-svn: 150312
2012-02-11 21:02:40 +00:00
Anna Zaks bb1ef9011d [analyzer] MallocChecker: refactor/improve the symbol escape logic.
We use the same logic here as the RetainRelease checker.

llvm-svn: 150311
2012-02-11 21:02:35 +00:00
Fariborz Jahanian 088959a28b objective-c translator. more modern abi stuff, focusing on ivar related
meta-data.

llvm-svn: 150310
2012-02-11 20:10:52 +00:00
Richard Smith b24f06780c Implement core issue 5: a temporary created for copy-initialization has a
cv-unqualified type. This is essential in order to allow move-only objects of
const-qualified types to be copy-initialized via a converting constructor.

llvm-svn: 150309
2012-02-11 19:22:50 +00:00
Richard Smith 4c7b490d19 Make sure to try instantiating a templated type which is used in an _Atomic
before complaining that it's incomplete.

llvm-svn: 150308
2012-02-11 18:03:45 +00:00
Anton Korobeynikov c6b4017ce2 Add support for implicit TLS model used with MS VC runtime.
Patch by Kai Nacke!

llvm-svn: 150307
2012-02-11 17:26:53 +00:00
Ryan Govostes 55011c017c [analyzer] New checker for assignment of non-0/1 values to Boolean variables.
llvm-svn: 150306
2012-02-11 16:32:09 +00:00
Benjamin Kramer 915e3d9568 Don't mix declarations and code.
llvm-svn: 150305
2012-02-11 16:01:02 +00:00
Benjamin Kramer 428704eb52 Make the EDis tables const.
llvm-svn: 150304
2012-02-11 14:51:07 +00:00
Benjamin Kramer 478e8de8ef Reuse the enum names from X86Desc in the X86Disassembler.
This requires some gymnastics to make it available for C code. Remove the names
from the disassembler tables, making them relocation free.

llvm-svn: 150303
2012-02-11 14:50:54 +00:00
Bill Wendling 911fdf47cd Document the new module flags.
llvm-svn: 150301
2012-02-11 11:59:36 +00:00
Bill Wendling 66f02413ef [WIP] Initial code for module flags.
Module flags are key-value pairs associated with the module. They include a
'behavior' value, indicating how module flags react when mergine two
files. Normally, it's just the union of the two module flags. But if two module
flags have the same key, then the resulting flags are dictated by the behaviors.

Allowable behaviors are:

     Error
       Emits an error if two values disagree.

     Warning
       Emits a warning if two values disagree.

     Require
       Emits an error when the specified value is not present
       or doesn't have the specified value. It is an error for
       two (or more) llvm.module.flags with the same ID to have
       the Require behavior but different values. There may be
       multiple Require flags per ID.

     Override
       Uses the specified value if the two values disagree. It
       is an error for two (or more) llvm.module.flags with the
       same ID to have the Override behavior but different
       values.

llvm-svn: 150300
2012-02-11 11:38:06 +00:00
Craig Topper 981c6cf7b3 Remove some patterns for matching vector_shuffle instructions since vector_shuffles should be custom lowered before isel.
llvm-svn: 150299
2012-02-11 07:43:35 +00:00
Andrew Trick ee874db886 Add TargetPassConfig hooks for scheduling/bundling.
In case the MachineScheduling pass I'm working on doesn't work well
for another target, they can completely override it. This also adds a
hook immediately after the RegAlloc pass to cleanup immediately after
vregs go away. We may want to fold it into the postRA hook later.

llvm-svn: 150298
2012-02-11 07:11:32 +00:00
Andrew Trick e79956479a comment
llvm-svn: 150297
2012-02-11 07:11:29 +00:00
Craig Topper 11826a6e10 Fix shuffle lowering code to stop creating temporary DAG nodes to do shuffle mask checks on. This seemed to be confusing things such that vector_shuffle ops to got through to iselection. This is another step towards removing the vector_shuffle handling patterns from isel.
llvm-svn: 150296
2012-02-11 06:24:48 +00:00
Eli Friedman 9436352a82 Implement warning for non-wide string literals with an unexpected encoding. Downgrade error for non-wide character literals with an unexpected encoding to a warning for compatibility with gcc and older versions of clang. <rdar://problem/10837678>.
llvm-svn: 150295
2012-02-11 05:08:10 +00:00
Chandler Carruth 9b5f8ddcf8 Begin refactoring to use the newly added triple predicates for
simplicity. Also addresses a FIXME, although not one that could be
observed.

llvm-svn: 150294
2012-02-11 03:31:12 +00:00
Eli Friedman 9fbeba0d8e Basic support for referring to captured variables from lambdas. Some simple examples seem to work. Tests coming up soon.
llvm-svn: 150293
2012-02-11 02:57:39 +00:00