Commit Graph

122009 Commits

Author SHA1 Message Date
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
Eli Friedman c9751069f5 Make sure Sema creates a field for 'this' captures. (Doug, please double-check that this is correct.)
llvm-svn: 150292
2012-02-11 02:51:16 +00:00
Argyrios Kyrtzidis d0e58e9be8 [libclang] For a reference of an implicit template instantiation just give
a reference for the instantiation decl. Also test that its location is correct
after previous commit.

llvm-svn: 150291
2012-02-11 02:00:00 +00:00
Argyrios Kyrtzidis e378948c8a For class template implicit instantiation, also update its location to point
to the pattern template that it came from, otherwise we had this situation:

template <typename T1, typename T2>
struct S {
};

template <typename T>
struct S<T, int> {
};

void f() {
  S<int, int> s; // location of declaration "S<int, int>" was of "S<T1, T2>" not "S<T, int>"
}

llvm-svn: 150290
2012-02-11 01:59:57 +00:00
Sean Callanan d4a7c123f3 Made the "--no-inlines" option on
"target modules lookup" also work with the
"--function" option, so you can search for
functions that aren't inlined.  This is the
same query that the expression parser makes, so
it's good for diagnosing situations where the
expression parser doesn't find a function you
think should be there.

llvm-svn: 150289
2012-02-11 01:22:21 +00:00
Jakob Stoklund Olesen fd338e9777 Allow Post-RA LICM to hoist reserved register reads.
When using register masks, registers like %rip are clobbered by the
register mask. LICM should still be able to hoist instructions reading
%rip from a loop containing calls.

llvm-svn: 150288
2012-02-11 00:44:19 +00:00
Jakob Stoklund Olesen 17402e3d5a Handle register masks in local live range splitting.
Again the goal is to produce identical assembly with register mask
operands enabled.

llvm-svn: 150287
2012-02-11 00:42:18 +00:00
Jakob Stoklund Olesen c8046c02c2 Don't read PreRegAlloc before it is initialized.
llvm-svn: 150286
2012-02-11 00:40:36 +00:00
Sean Callanan f6172c2cbc Make the output from "target modules lookup -n"
prettier.

llvm-svn: 150285
2012-02-11 00:24:04 +00:00
Eli Friedman 7e7da2d285 const-qualify CXXRecordDecl::getCaptureFields.
llvm-svn: 150284
2012-02-11 00:18:00 +00:00
Douglas Gregor 28be7c5e20 Add simple semantic test for C++11 [expr.prim.lambda]p16, which covers recursive capture. This is far more interesting for IRgen.
llvm-svn: 150283
2012-02-10 23:38:02 +00:00
Douglas Gregor f0d495100c Implement C++11 [expr.lambda.prim]p13, which prohibits lambdas in
default arguments if in fact those lambdas capture any entity.

llvm-svn: 150282
2012-02-10 23:30:22 +00:00
Fariborz Jahanian cb1d9f3706 objc translator: more modern metadata stuff.
llvm-svn: 150281
2012-02-10 23:18:24 +00:00
Eli Friedman 4286fba606 Set UserLabelPrefix and MCountName correctly for DragonFly BSD. Patch by Sascha Wildner.
Setting UserLabelPrefix correctly fixes PR11949.

llvm-svn: 150280
2012-02-10 23:02:29 +00:00
Sean Callanan 9df05fbb7f Extended function lookup to allow the user to
indicate whether inline functions are desired.
This allows the expression parser, for instance,
to filter out inlined functions when looking for
functions it can call.

llvm-svn: 150279
2012-02-10 22:52:19 +00:00
David Blaikie 59fe3f89cb Support all null pointer literals in format strings.
llvm-svn: 150276
2012-02-10 21:07:25 +00:00
Fariborz Jahanian 6b83daefd3 objctive-c translator: modern metadata for ivars. wip.
llvm-svn: 150275
2012-02-10 20:47:10 +00:00
Jim Grosbach 1c9dd2974f Revert r150222, as the clang driver now handles this properly.
Now that the clang driver passes the CPU and feature information to
the backend when processing assembly files (150273), this isn't necessary.

llvm-svn: 150274
2012-02-10 20:38:46 +00:00
Jim Grosbach 576452b830 Have the driver pass CPU and target feature information to cc1as.
When creating the MCSubtargetInfo, the assembler driver uses the CPU and
feature string to construct a more accurate model of what instructions
are and are not legal.

rdar://10840476

llvm-svn: 150273
2012-02-10 20:37:10 +00:00
Sean Callanan 49bce8ecdb Improved detection of object file types, moving
detection of kernels into the object file and
adding a new category for raw binary images.
Fixed all clients who previously searched for
sections manually, making them use the object
file's facilities instead.

llvm-svn: 150272
2012-02-10 20:22:35 +00:00
Greg Clayton 1ada7bc09d Fixed incorrect #include directives.
llvm-svn: 150271
2012-02-10 20:13:26 +00:00
Argyrios Kyrtzidis 4701cf61d7 [libclang] Indexing API: fully index using decls and directives.
llvm-svn: 150268
2012-02-10 20:10:48 +00:00
Argyrios Kyrtzidis e5dc5b31f2 [libclang] Indexing API: Fully index implict template instantiations.
llvm-svn: 150267
2012-02-10 20:10:44 +00:00
Argyrios Kyrtzidis 9e0cd46d93 Add ArrayRef goodness in MultiplexASTMutationListener.
llvm-svn: 150266
2012-02-10 20:10:38 +00:00