Commit Graph

60923 Commits

Author SHA1 Message Date
Nuno Lopes 52c17e7201 fix the menu's links
llvm-svn: 73341
2009-06-14 09:40:09 +00:00
Owen Anderson 2f82e2735a Add an early implementation of a partial inlining pass. The idea behind this
is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.

This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.

llvm-svn: 73338
2009-06-14 08:26:32 +00:00
Douglas Gregor e141633f55 Introduce a SFINAE "trap" that keeps track of the number of errors
that were suppressed due to SFINAE. By checking whether any errors
occur at the end of template argument deduction, we avoid the
possibility of suppressing an error (due to SFINAE) and then
recovering so well that template argument deduction never detects that
there was a problem. Thanks to Eli for the push in this direction.

llvm-svn: 73336
2009-06-14 08:02:22 +00:00
Bruno Cardoso Lopes 2f55027012 Introduce new BinaryObject (blob) class, ELF Writer modified to use it. BinaryObject.h by Aaron Gray
llvm-svn: 73333
2009-06-14 07:53:21 +00:00
Douglas Gregor 33834516f3 Update LLVM.
Implement support for C++ Substitution Failure Is Not An Error
(SFINAE), which says that errors that occur during template argument
deduction do *not* produce diagnostics and do not necessarily make a
program ill-formed. Instead, template argument deduction silently
fails. This is currently implemented for template argument deduction
during matching of class template partial specializations, although
the mechanism will also apply to template argument deduction for
function templates. The scheme is simple:

  - If we are in a template argument deduction context, any diagnostic
    that is considered a SFINAE error (or warning) will be
    suppressed. The error will be propagated up the call stack via the
    normal means.
  - By default, all warnings and errors are SFINAE errors. Add the
    NoSFINAE class to a diagnostic in the .td file to make it a hard
    error (e.g., for access-control violations).

Note that, to make this fully work, every place in Sema that emits an
error *and then immediately recovers* will need to check
Sema::isSFINAEContext() to determine whether it must immediately
return an error rather than recovering.

llvm-svn: 73332
2009-06-14 07:33:30 +00:00
Douglas Gregor ec131d1fd7 Add output of the SFINAE bit for Clang's diagnostics
llvm-svn: 73331
2009-06-14 07:24:49 +00:00
Nick Lewycky be42c11118 Fix "for all intensive purposes" to "for all intents and purposes".
llvm-svn: 73323
2009-06-14 04:08:08 +00:00
Eli Friedman 334046a134 PR4351: Add constant evaluation for constructs like "foo == NULL", where
foo has a constant address.

llvm-svn: 73321
2009-06-14 02:17:33 +00:00
Shantonu Sen f4ba1e62f9 Add myself, test commit
llvm-svn: 73320
2009-06-14 02:03:17 +00:00
Chris Lattner 15ba94987a Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc.  This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.

llvm-svn: 73319
2009-06-14 01:54:56 +00:00
Chris Lattner 5abdec7978 move the various builtins stuff from libast to libbasic. This
fixes a layering violation in lib/Basic/Targets.cpp.

llvm-svn: 73318
2009-06-14 01:05:48 +00:00
Chris Lattner 3d4ead17c7 prune #includes, Builtins.h/cpp no longer depends on libast.
llvm-svn: 73317
2009-06-14 00:52:07 +00:00
Chris Lattner ecd79c6353 move GetBuiltinType from Builtin::Context to ASTContext.
llvm-svn: 73316
2009-06-14 00:45:47 +00:00
Chris Lattner 8e3eed0890 change ParseStatementOrDeclaration to emit the 'missing ;' with
ExpectAndConsume instead of custom diag logic.  This gets us an
insertion hint and positions the ; at the end of the line 
instead of on the next token.  Before:

t.c:5:1: error: expected ';' after return statement
}
^

after:

t.c:4:11: error: expected ';' after return statement
  return 4
          ^
          ;

llvm-svn: 73315
2009-06-14 00:23:56 +00:00
Chris Lattner 34a9566c8c improve localizability by not passing english phrases into
diagnostics in some cases.

llvm-svn: 73314
2009-06-14 00:07:48 +00:00
Chris Lattner d50fea52af Simplify mangleFunctionDecl by unnesting a crazy condition. This fixes
the check for extern "c" system headers, which should prevent functiondecls
from being mangled.

llvm-svn: 73311
2009-06-13 23:34:16 +00:00
Chris Lattner a744527773 add a handy predicate.
llvm-svn: 73310
2009-06-13 23:31:51 +00:00
Eli Friedman 3192cc8526 Fix the calling convention for structs/unions containing SSE vectors on
x86-32.  This is slightly messy, but I think it's consistent with gcc.

llvm-svn: 73306
2009-06-13 21:37:10 +00:00
Chris Lattner b3c4fb5cac declare an 'operator delete' to match operator new, this avoids many many
warnings when building with VC++, patch by AlisdairM!

llvm-svn: 73305
2009-06-13 20:51:38 +00:00
Chris Lattner 084776d08b fix typo
llvm-svn: 73304
2009-06-13 20:35:58 +00:00
Daniel Dunbar 2f554fadcd Don't include system headers when overriding triple.
llvm-svn: 73301
2009-06-13 20:02:26 +00:00
Daniel Dunbar c0467f36f2 Force Obj-C runtime version for this test
llvm-svn: 73300
2009-06-13 19:40:25 +00:00
Nick Lewycky 47b71c5844 Unlike the other instructions, GEP really does need to look at the type of a
pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review!

llvm-svn: 73299
2009-06-13 19:09:52 +00:00
Daniel Dunbar c54e242fb4 Switch to the new test runner.
- TestRunner.sh still needs to be moved over.

 - Please let me know if you find problems / missing features.

llvm-svn: 73298
2009-06-13 18:28:48 +00:00
Anders Carlsson 40c1d49615 Have CheckClassTemplatePartialSpecializationArgs take a TemplateArgumentListBuilder. No functionality change.
llvm-svn: 73297
2009-06-13 18:20:51 +00:00
Chris Lattner 60ac6b9dce a couple minor tweaks
llvm-svn: 73296
2009-06-13 18:11:10 +00:00
Sanjiv Gupta c16c947071 The subprogram descriptor for a function may be missing (llvm-ld linking two static functions with same name), so pick up the compilation unit for the function from the first valid debug loc of its instructions.
This patch also emits debug info for structure (aggregate types in 
general) types.

llvm-svn: 73295
2009-06-13 17:35:54 +00:00
Dan Gohman 426901aa19 Teach SCEVExpander's visitAddRecExpr to reuse an existing canonical
induction variable when the addrec to be expanded does not require
a wider type. This eliminates the need for IndVarSimplify to
micro-manage SCEV expansions, because SCEVExpander now
automatically expands them in the form that IndVarSimplify considers
to be canonical. (LSR still micro-manages its SCEV expansions,
because it's optimizing for the target, rather than for
other optimizations.)

Also, this uses the new getAnyExtendExpr, which has more clever
expression simplification logic than the IndVarSimplify code it
replaces, and this cleans up some ugly expansions in code such as
the included masked-iv.ll testcase.

llvm-svn: 73294
2009-06-13 16:25:49 +00:00
Dan Gohman 8db2edcf7f Add a ScalarEvolution::getAnyExtendExpr utility function for performing
extension with unspecified bits.

llvm-svn: 73293
2009-06-13 15:56:47 +00:00
Eli Friedman 9782caa369 Allow initializing a vector with a vector in addition to allowing a list
of the elements.  Issue reported on cfe-dev by Mattias Holm.

llvm-svn: 73292
2009-06-13 10:38:46 +00:00
Evan Cheng 185c9ef0a2 Add a ARM specific pre-allocation pass that re-schedule loads / stores from
consecutive addresses togther. This makes it easier for the post-allocation pass
to form ldm / stm.

This is step 1. We are still missing a lot of ldm / stm opportunities because
of register allocation are not done in the desired order. More enhancements
coming.

llvm-svn: 73291
2009-06-13 09:12:55 +00:00
Chris Lattner b6f77af532 implement and document a new __has_feature and __has_builtin magic
builtin preprocessor macro.  This appears to work with two caveats:
1) builtins are registered in -E mode, and 2) target-specific builtins
are unconditionally registered even if they aren't supported by the
target (e.g. SSE4 builtin when only SSE1 is enabled).

llvm-svn: 73289
2009-06-13 07:13:28 +00:00
Douglas Gregor a5d5c749b1 Move a bunch of tests into temp.param, and write a few tests for paragraphs that hadn't been touched before
llvm-svn: 73288
2009-06-13 06:59:07 +00:00
Daniel Dunbar 4be788c56a Add some random C++ standard tests.
llvm-svn: 73287
2009-06-13 06:16:36 +00:00
Douglas Gregor 7a1095f243 Add the structure for a C++ test suite that mimics the structure of the C++ standard
llvm-svn: 73286
2009-06-13 06:06:53 +00:00
Eli Friedman 9a0e23c495 Fix for PR4382: allow instantiating dependent nested name specifiers.
I'm not completely sure this is the right way to fix this issue, but it seems 
reasonable, and it's consistent with the non-template code for this 
construct.

llvm-svn: 73285
2009-06-13 04:51:30 +00:00
Anders Carlsson 20ee0ed4ea If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383.
llvm-svn: 73284
2009-06-13 02:59:33 +00:00
Devang Patel 64e6529e76 llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a function. If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available. LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics.
Apply defensive patch to preserve at least one lexical scope till the end of function.

llvm-svn: 73282
2009-06-13 02:16:18 +00:00
Anders Carlsson 15201f19ba More work on type parameter packs.
llvm-svn: 73281
2009-06-13 02:08:00 +00:00
Zhongxing Xu 70b27e6f8b Stop tracking non-compound value for struct. It may be caused by imprecise cast
logic.

llvm-svn: 73279
2009-06-13 01:31:11 +00:00
Douglas Gregor 4f024b2046 Remove a bunch of unnecessary template argument deduction code that was
obviously written by someone who didn't read C++ [temp.class.spec].

llvm-svn: 73276
2009-06-13 00:59:32 +00:00
Anders Carlsson c8cbb2d08c Move template type argument checking out into a separate function. No functionality change.
llvm-svn: 73275
2009-06-13 00:33:33 +00:00
Douglas Gregor 91772d1d76 When some template parameters of a class template partial
specialization cannot be deduced, produce a warning noting that the
affected class template partial specialization will never be used.

llvm-svn: 73274
2009-06-13 00:26:55 +00:00
Chris Lattner 4ca97c3b9e Fix PR4372, another case where non-prototyped functions can prevent
always_inline from working.

llvm-svn: 73273
2009-06-13 00:26:38 +00:00
Anders Carlsson aa73b9135a Improvements to TemplateArgumentListBuilder to make it work better with parameter packs.
llvm-svn: 73272
2009-06-13 00:08:58 +00:00
Bruno Cardoso Lopes 77444cba6d Type change cleanup on JCE and MCE. Patch by Aaron Gray
llvm-svn: 73271
2009-06-12 23:51:56 +00:00
Dan Gohman 32cbbec335 Adjust this test's regex strings so that they work regardless
of the target's pointer size. This avoids the need for -m32 on
the llvm-gcc command-line, which some targets may not support.

llvm-svn: 73270
2009-06-12 23:31:14 +00:00
Anders Carlsson 327865db53 A parameter pack must always come last in a class template.
llvm-svn: 73269
2009-06-12 23:20:15 +00:00
Anders Carlsson 508caaec3b No need to mark the parameter as invalid, just ignore the default argument.
llvm-svn: 73268
2009-06-12 23:13:22 +00:00
Anders Carlsson f986ba7528 Address more comments from Doug.
llvm-svn: 73267
2009-06-12 23:09:56 +00:00