Commit Graph

77186 Commits

Author SHA1 Message Date
Chris Lattner b18093e467 fix PR6187: various load functions in xmmintrin.h were missing 'const'.
emmintrin looks ok.

llvm-svn: 94998
2010-02-01 20:14:14 +00:00
Chris Lattner 94eb4b285b fix PR6195, a bug constant folding scalar -> vector compares.
llvm-svn: 94997
2010-02-01 20:04:40 +00:00
Dale Johannesen 0b30cfc57e fix PR 6157. Testcase pending.
llvm-svn: 94996
2010-02-01 19:54:53 +00:00
Chris Lattner 9306ffa05a cleanups.
llvm-svn: 94995
2010-02-01 19:54:45 +00:00
Ted Kremenek fb20c4121e Use early return as suggested by Cristian Draghici.
llvm-svn: 94994
2010-02-01 19:38:10 +00:00
Chris Lattner 3c46e14137 fix PR6197 - infinite recursion in ipsccp due to block addresses
evaluateICmpRelation wasn't handling blockaddress.

llvm-svn: 94993
2010-02-01 19:35:08 +00:00
Ted Kremenek cd83106151 Format string checking: selectively ignore implicit casts to 'int'
when checking if the format specifier matches the type of the data
argument and the length modifier indicates the data type is 'char' or
'short'.

llvm-svn: 94992
2010-02-01 19:28:15 +00:00
Devang Patel 973f2eb0cd Emit debug info for namespaces.
llvm-svn: 94991
2010-02-01 19:16:32 +00:00
Mon P Wang 72c60c73af Fixed a couple of optimization with EXTRACT_VECTOR_ELT that assumes the result
type is the same as the element type of the vector.  EXTRACT_VECTOR_ELT can
be used to extended the width of an integer type.  This fixes a bug for
Generic/vector-casts.ll on a ppc750.

llvm-svn: 94990
2010-02-01 19:03:18 +00:00
Dan Gohman 36bca4e4ba Update this test for a trivial register allocation difference.
llvm-svn: 94989
2010-02-01 19:00:32 +00:00
John McCall 8b9ed55bfb Note that an overload candidate was non-viable because template argument
deduction failed.  Right now there's a very vague diagnostic for most cases
and a good diagnostic for incomplete deduction.

llvm-svn: 94988
2010-02-01 18:53:26 +00:00
Dan Gohman e5e1b7b05a Generalize target-independent folding rules for sizeof to handle more
cases, and implement target-independent folding rules for alignof and
offsetof. Also, reassociate reassociative operators when it leads to
more folding.

Generalize ScalarEvolution's isOffsetOf to recognize offsetof on
arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr
to getOffsetOfExpr, for consistency with analagous ConstantExpr routines.

Make the target-dependent folder promote GEP array indices to
pointer-sized integers, to make implicit casting explicit and exposed
to subsequent folding.

And add a bunch of testcases for this new functionality, and a bunch
of related existing functionality.

llvm-svn: 94987
2010-02-01 18:27:38 +00:00
Chris Lattner 846a52e228 fix rdar://7590304, a miscompilation of objc apps on arm. The caller
of objc message send was getting marked arm_apcscc, but the prototype
isn't.  This is fine at runtime because objcmsgsend is implemented in
assembly.  Only turn a mismatched caller and callee into 'unreachable'
if the callee is a definition.

llvm-svn: 94986
2010-02-01 18:11:34 +00:00
Chris Lattner 2cecedf081 fix rdar://7590304, an infinite loop in instcombine. In the invoke
case, instcombine can't zap the invoke for fear of changing the CFG.
However, we have to do something to prevent the next iteration of
instcombine from inserting another store -> undef before the invoke
thereby getting into infinite iteration between dead store elim and
store insertion.

Just zap the callee to null, which will prevent the next iteration
from doing anything.

llvm-svn: 94985
2010-02-01 18:04:58 +00:00
Bob Wilson f65ba356e1 Fix pr6198 by moving the isSized() check to an outer conditional.
The testcase from pr6198 does not crash for me -- I don't know what's up with
that -- so I'm not adding it to the tests.

llvm-svn: 94984
2010-02-01 17:41:44 +00:00
Dan Gohman de047f2051 Add a getNUWMul function.
llvm-svn: 94982
2010-02-01 16:38:14 +00:00
Dan Gohman ede94e6850 Add a generalized form of ConstantExpr::getOffsetOf which works for
array types as well as struct types, and which accepts arbitrary
Constant indicies.  

llvm-svn: 94981
2010-02-01 16:37:38 +00:00
Bruno Cardoso Lopes aa8c429a53 MulOp is actually a Mips specific node, so do the match using Opcode. This fixes PR6192
llvm-svn: 94977
2010-02-01 12:16:39 +00:00
Zhongxing Xu d41dacdcbf Add an immutable interval map, prepared to be used by flat memory model
in the analyzer. WIP.

llvm-svn: 94976
2010-02-01 10:43:31 +00:00
Sean Callanan bc7bd4bf40 Whoops, left some debugging code in that broke
a buildbot.  Removed.

llvm-svn: 94975
2010-02-01 09:02:24 +00:00
Sean Callanan 328f60f08c Added the enhanced disassembly library's implementation and
fleshed out the .exports file.  I still have to fix several
details of operand parsing, but the basic functionality is
there and usable.

llvm-svn: 94974
2010-02-01 08:49:35 +00:00
Zhongxing Xu 7120eb77d1 Simplify code. We can compare TNew with T in one batch.
llvm-svn: 94973
2010-02-01 07:32:52 +00:00
Sam Weinig deb55d5123 Fix for PR5185. C99 [*] VLA notation should be disallowed in function definitions.
llvm-svn: 94972
2010-02-01 05:02:49 +00:00
John McCall 760af170ff Access checking for implicit user-defined conversions.
llvm-svn: 94971
2010-02-01 03:16:54 +00:00
Evan Cheng ed8ca56eeb Undo r94946 now all the tests are passing again.
llvm-svn: 94970
2010-02-01 02:13:39 +00:00
Bruno Cardoso Lopes 1cb8b33d61 Fix stack size bug while using o32 abi
llvm-svn: 94969
2010-02-01 02:03:24 +00:00
Sebastian Redl 35351a9554 Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list.
llvm-svn: 94968
2010-01-31 22:27:38 +00:00
Eli Friedman a682427e42 Switch expressions like T() and T(1,2) over to new-style initialization. I'm
not quite sure what we want to do about the AST representation; comments
welcome.

llvm-svn: 94967
2010-01-31 20:58:15 +00:00
Eli Friedman 604179775a Simplify EmitMemberInitializer; no intended functionality change.
llvm-svn: 94965
2010-01-31 19:07:50 +00:00
Anders Carlsson ab0ddb57b1 Start creating CXXBindReferenceExpr nodes when binding complex types to references.
llvm-svn: 94964
2010-01-31 18:34:51 +00:00
Anders Carlsson 8abde4b447 Diagnose binding a non-const reference to a vector element.
llvm-svn: 94963
2010-01-31 17:18:49 +00:00
Chandler Carruth cd6d426075 Fix my dyslexia.
llvm-svn: 94958
2010-01-31 11:52:52 +00:00
Chandler Carruth 764cf41d92 Add a test case for a fixed PR just to ensure we don't regress.
llvm-svn: 94957
2010-01-31 11:51:51 +00:00
Chandler Carruth 3a693b7428 Return early, reduce indentation, and simplify line breaks. No functionality
change.

PS: I'm under the impression formatting-only patches don't need pre-commit
review, but feel free to yell at me if I should post these first! =D

llvm-svn: 94956
2010-01-31 11:44:02 +00:00
Johnny Chen b3562f7cf6 For MVNr and MVNs, we need to set Inst{25} = 0 so as not to confuse the decoder.
llvm-svn: 94955
2010-01-31 11:22:28 +00:00
Chandler Carruth 00216980fb Really trivial patch to accept pointer to const void in indirect goto. Despite
the lack of documentation, this matches the behavior of GCC.

llvm-svn: 94954
2010-01-31 10:26:25 +00:00
Chandler Carruth 724a8a1fef Fix PR6159 and several other problems with value-dependent non-type template
arguments. This both prevents meaningless checks on these arguments and ensures
that they are represented as an expression by the instantiation.

Cleaned up and added standard text to the relevant test case. Also started
adding tests for *rejected* cases. At least one FIXME here where (I think) we
allow something we shouldn't. More to come in the area of rejecting crazy
arguments with decent diagnostics. Suggestions welcome for still better
diagnostics on these errors!

llvm-svn: 94953
2010-01-31 10:01:20 +00:00
Douglas Gregor 7ae2d7758f Rework base and member initialization in constructors, with several
(necessarily simultaneous) changes:

  - CXXBaseOrMemberInitializer now contains only a single initializer
    rather than a set of initialiation arguments + a constructor. The
    single initializer covers all aspects of initialization, including
    constructor calls as necessary but also cleanup of temporaries
    created by the initializer (which we never handled
    before!).

  - Rework + simplify code generation for CXXBaseOrMemberInitializers,
    since we can now just emit the initializer as an initializer.

  - Switched base and member initialization over to the new
    initialization code (InitializationSequence), so that it

  - Improved diagnostics for the new initialization code when
    initializing bases and members, to match the diagnostics produced
    by the previous (special-purpose) code.

  - Simplify the representation of type-checked constructor initializers in
    templates; instead of keeping the fully-type-checked AST, which is
    rather hard to undo at template instantiation time, throw away the
    type-checked AST and store the raw expressions in the AST. This
    simplifies instantiation, but loses a little but of information in
    the AST.

  - When type-checking implicit base or member initializers within a
    dependent context, don't add the generated initializers into the
    AST, because they'll look like they were explicit.

  - Record in CXXConstructExpr when the constructor call is to
  initialize a base class, so that CodeGen does not have to infer it
  from context. This ensures that we call the right kind of
  constructor.

There are also a few "opportunity" fixes here that were needed to not
regress, for example:

  - Diagnose default-initialization of a const-qualified class that
    does not have a user-declared default constructor. We had this
    diagnostic specifically for bases and members, but missed it for
    variables. That's fixed now.

  - When defining the implicit constructors, destructor, and
    copy-assignment operator, set the CurContext to that constructor
    when we're defining the body.

llvm-svn: 94952
2010-01-31 09:12:51 +00:00
Benjamin Kramer 43a645cd93 Try to unbreak MSVC build.
llvm-svn: 94951
2010-01-31 09:01:55 +00:00
Evan Cheng b33dbc5019 Change TAILJMP's to be varargs and transfer implicit uses over from TCRETURN's. Otherwise the missing uses can make post-regalloc scheduling do bad things. This fixes 403.gcc.
llvm-svn: 94950
2010-01-31 07:28:44 +00:00
Evan Cheng 9adc6f46cf Fix a missing check from my last commit.
llvm-svn: 94949
2010-01-31 07:27:31 +00:00
Chandler Carruth 234c129fba Fix PR6156 and test several of the basic aspects of non-type template arguments
when implicitly supplied to the injected class name.

llvm-svn: 94948
2010-01-31 07:24:03 +00:00
Chandler Carruth 9b1fa25432 Handle instantiation of templates with non-type arguments expressed with an
explicit '&' by introducing an address-of operator prior to checking the
argument's type.

llvm-svn: 94947
2010-01-31 07:09:11 +00:00
Evan Cheng 7f62def0f9 Avoid recursive sibcall's.
llvm-svn: 94946
2010-01-31 06:44:49 +00:00
Eli Friedman 0de0b3677a Remove a completed item, add a couple new ones.
llvm-svn: 94945
2010-01-31 04:55:32 +00:00
Eli Friedman 690c7f4dfd Remove test which is no longer relevant.
llvm-svn: 94944
2010-01-31 04:40:45 +00:00
Eli Friedman a2cc2875fc Simplify/generalize the xor+add->sign-extend instcombine.
llvm-svn: 94943
2010-01-31 04:29:12 +00:00
Anders Carlsson 6276b2506d When performing a derived-to-base cast that we know will not change the offset, we don't need to null check the input pointer. Fixes PR5965.
llvm-svn: 94942
2010-01-31 02:39:02 +00:00
Eli Friedman 37a8197b61 Add a small transform: transform -(X<<Y) to (-X<<Y) when the shift has a single
use and X is free to negate.

llvm-svn: 94941
2010-01-31 02:30:23 +00:00
Sean Callanan 9aeccadce4 Moved InstallLexer() from the X86-specific AsmLexer
to the TargetAsmLexer class so that clients can
actually use the TargetAsmLexer they get from a
Target.

llvm-svn: 94940
2010-01-31 02:28:18 +00:00