Commit Graph

82539 Commits

Author SHA1 Message Date
Douglas Gregor 4f4946aaaa Whenever we complain about a failed initialization of a function or
method parameter, provide a note pointing at the parameter itself so
the user does not have to manually look for the function/method being
called and match up parameters to arguments. For example, we now get:

t.c:4:5: warning: incompatible pointer types passing 'long *' to
parameter of
      type 'int *' [-pedantic]
  f(long_ptr);
    ^~~~~~~~
t.c:1:13: note: passing argument to parameter 'x' here
void f(int *x);
            ^

llvm-svn: 102038
2010-04-22 00:20:18 +00:00
Anders Carlsson 3eeb741e6c Remove an unused declaration.
llvm-svn: 102037
2010-04-21 23:55:31 +00:00
Dan Gohman ef78c8ebd7 When computing the alignof value for a vector type, ensure that
the alignment is a power of 2, even in the esoteric case of a
vector element which does not have a power-of-2 sizeof value.

llvm-svn: 102036
2010-04-21 23:32:43 +00:00
Douglas Gregor 6b7f12c039 Switch the initialization of Objective-C message parameters (as occurs
during message sends) over to the new initialization code and away
from the C-only CheckSingleAssignmentConstraints. The enables the use
of C++ types in method parameters and message arguments, as well as
unifying more initialiation code overall.

llvm-svn: 102035
2010-04-21 23:24:10 +00:00
Jakob Stoklund Olesen 14b1d758c6 Run LiveVariables instead of computing liveness locally in -regalloc=fast.
This actually makes everything slower, but the plan is to have isel add <kill>
flags the way it is already adding <dead> flags. Then LiveVariables can be
removed again.

When ignoring the time spent in LiveVariables, -regalloc=fast is now twice as
fast as -regalloc=local.

llvm-svn: 102034
2010-04-21 23:18:07 +00:00
Devang Patel b9ab309650 Encode field accessibility.
llvm-svn: 102033
2010-04-21 23:12:37 +00:00
Nick Kledzik 26274da38f improve arm build support on darwin
llvm-svn: 102032
2010-04-21 22:46:53 +00:00
Douglas Gregor 8d4de67e1d Implement parsing for message sends in Objective-C++. Message sends in
Objective-C++ have a more complex grammar than in Objective-C
(surprise!), because

  (1) The receiver of an instance message can be a qualified name such
  as ::I or identity<I>::type.
  (2) Expressions in C++ can start with a type.

The receiver grammar isn't actually ambiguous; it just takes a bit of
work to parse past the type before deciding whether we have a type or
expression. We do this in two places within the grammar: once for
message sends and once when we're determining whether a []'d clause in
an initializer list is a message send or a C99 designated initializer.

This implementation of Objective-C++ message sends contains one known
extension beyond GCC's implementation, which is to permit a
typename-specifier as the receiver type for a class message, e.g.,

  [typename compute_receiver_type<T>::type method];

Note that the same effect can be achieved in GCC by way of a typedef,
e.g.,

  typedef typename computed_receiver_type<T>::type Computed;
  [Computed method];

so this is merely a convenience.

Note also that message sends still cannot involve dependent types or
values.

llvm-svn: 102031
2010-04-21 22:36:40 +00:00
Nick Kledzik 8e7ebea0b9 add explicit alignment directives to assure arm code is 4-byte aligned
llvm-svn: 102030
2010-04-21 22:36:23 +00:00
Evan Cheng 02e816b317 Do not try to optimize a copy that has already been marked for deletion.
llvm-svn: 102027
2010-04-21 20:57:54 +00:00
Douglas Gregor e5798dcb41 Migrate the responsibility for turning the receiver name in an
Objective-C class message expression into a type from the parser
(which was doing so in two places) to Action::getObjCMessageKind()
which, in the case of Sema, reduces the number of name lookups we need
to perform.

llvm-svn: 102026
2010-04-21 20:38:13 +00:00
Anders Carlsson 4bb6e92902 Diagnose access to fields with private constructors.
llvm-svn: 102025
2010-04-21 20:28:29 +00:00
Douglas Gregor 4fdba13072 Eliminate unused code in Sema::ActOnSuperMessage and use early exits
to reduce nesting. No functionality change. 

llvm-svn: 102022
2010-04-21 20:01:04 +00:00
Douglas Gregor 0c78ad9665 Rework the Parser-Sema interaction for Objective-C message
sends. Major changes include:

  - Expanded the interface from two actions (ActOnInstanceMessage,
    ActOnClassMessage), where ActOnClassMessage also handled sends to
    "super" by checking whether the identifier was "super", to three
    actions (ActOnInstanceMessage, ActOnClassMessage,
    ActOnSuperMessage). Code completion has the same changes.
  - The parser now resolves the type to which we are sending a class
    message, so ActOnClassMessage now accepts a TypeTy* (rather than
    an IdentifierInfo *). This opens the door to more interesting
    types (for Objective-C++ support).
  - Split ActOnInstanceMessage and ActOnClassMessage into parser
    action functions (with their original names) and semantic
    functions (BuildInstanceMessage and BuildClassMessage,
    respectively). At present, this split is onyl used by
    ActOnSuperMessage, which decides which kind of super message it
    has and forwards to the appropriate Build*Message. In the future,
    Build*Message will be used by template instantiation.
  - Use getObjCMessageKind() within the disambiguation of Objective-C
    message sends vs. array designators.

Two notes about substandard bits in this patch:
  - There is some redundancy in the code in ParseObjCMessageExpr and
  ParseInitializerWithPotentialDesignator; this will be addressed
  shortly by centralizing the mapping from identifiers to type names
  for the message receiver.
  - There is some #if 0'd code that won't likely ever be used---it
  handles the use of 'super' in methods whose class does not have a
  superclass---but could be used to model GCC's behavior more
  closely. This code will die in my next check-in, but I want it in
  Subversion.

llvm-svn: 102021
2010-04-21 19:57:20 +00:00
Anders Carlsson 43c64af5f0 Keep tack of whether a base in an InitializedEntity is an inherited virtual base or not. Use this in CheckConstructorAccess.
llvm-svn: 102020
2010-04-21 19:52:01 +00:00
Daniel Dunbar 53fac692fa ABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignment
exceeds the minimum ABI alignment.

llvm-svn: 102019
2010-04-21 19:49:55 +00:00
Daniel Dunbar f5dbc072a6 Convert test to FileCheck.
llvm-svn: 102018
2010-04-21 19:34:17 +00:00
Daniel Dunbar 14ec60024c Convert test to FileCheck.
llvm-svn: 102016
2010-04-21 19:10:54 +00:00
Daniel Dunbar 557893d2a8 IRgen/x86-32: Factor out getIndirectResult(), to match x86-64 factoring.
llvm-svn: 102015
2010-04-21 19:10:51 +00:00
Daniel Dunbar 2ba67440b6 IRgen: Add checking that the LLVM and AST record layout offsets agree (for
non-bit-fields).

llvm-svn: 102014
2010-04-21 19:10:49 +00:00
Devang Patel 1a6e399874 Add command line option to disable debug info printing in .s file. This option does not impact debug info generation and preservation through earlier compile starges.
llvm-svn: 102012
2010-04-21 19:08:53 +00:00
Fariborz Jahanian 422cb21862 Improve on source location of diagnostic when default
property synthesis is using a super class ivar.

llvm-svn: 102011
2010-04-21 18:57:20 +00:00
Anders Carlsson a01874bf44 Pass the InitializedEntity to Sema::CheckConstructorAccess and use it to report different diagnostics depending on which entity is being initialized.
llvm-svn: 102010
2010-04-21 18:47:17 +00:00
Bob Wilson 4c7f50afb8 Fix a performance problem with the new SSAUpdater. This showed up in the
GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000.

llvm-svn: 102009
2010-04-21 18:39:03 +00:00
Johnny Chen d85afee134 Modified some assert() msg strings; no other functionality change.
llvm-svn: 102008
2010-04-21 18:37:48 +00:00
Anders Carlsson 34f54d55e2 Comment out an assert for now.
llvm-svn: 102007
2010-04-21 18:03:05 +00:00
Jakob Stoklund Olesen 8a070a540d Add fast register allocator, enabled with -regalloc=fast.
So far this is just a clone of -regalloc=local that has been lobotomized to run
25% faster. It drops the least-recently-used calculations, and is just plain
stupid when it runs out of registers.

The plan is to make this go even faster for -O0 by taking advantage of the short
live intervals in unoptimized code. It should not be necessary to calculate
liveness when most virtual registers are killed 2-3 instructions after they are
born.

llvm-svn: 102006
2010-04-21 18:02:42 +00:00
Fariborz Jahanian 6db6ce4fe4 Fix typo.
llvm-svn: 102005
2010-04-21 17:09:27 +00:00
Devang Patel 0940a8085e Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
llvm-svn: 102004
2010-04-21 16:32:19 +00:00
Dan Gohman a029cbe93f Make ScalarEvolution::getConstant support pointer types, for consistency
with ScalarEvolution's overall approach to pointer types.

llvm-svn: 102003
2010-04-21 16:04:04 +00:00
Duncan Sands fe29117f6c Dragonegg will be released along side llvm-2.7.
llvm-svn: 102001
2010-04-21 13:51:48 +00:00
Benjamin Kramer 3aac9c5edb Add more const to ConstExprIterator.
llvm-svn: 101999
2010-04-21 12:21:20 +00:00
John McCall bf814c79b6 I failed to notice that my last patch wasn't doing as much as it could
because EmitBranch actually clears the insert point.  This version
actually accomplishes what I initially wanted.

llvm-svn: 101998
2010-04-21 11:18:06 +00:00
John McCall e683359fc9 Teach EmitBlock to put the target block immediately after the current block
(if there's a current block).  The chief advantage of doing this is that it
lets us pick blocks (e.g. EH blocks) to push to the end of the function so
that fallthrough happens consistently --- i.e. it gives us the flexibility
of ordering blocks as we please without having to change the order in which
we generate code.  There are standard (?) optimization passes which can do some
of that for us, but better to generate reasonable code to begin with.

llvm-svn: 101997
2010-04-21 10:29:06 +00:00
John McCall 2188696d98 Miscellaneous codegen cleanups. Mostly, don't create new basic blocks
just to save the current insertion state!  This change significantly
simplifies the IR CFG in exceptions code.

llvm-svn: 101996
2010-04-21 10:05:39 +00:00
Chris Lattner a668b45ebd final hacking for tonight, still more to go.
llvm-svn: 101995
2010-04-21 06:42:24 +00:00
Zhongxing Xu 105dfb5a72 CXXNamedCastExpr is actually an abstract expression.
llvm-svn: 101994
2010-04-21 06:32:25 +00:00
Chris Lattner 1dcca8bd5e continue the process of detangling this.
llvm-svn: 101992
2010-04-21 06:23:40 +00:00
Douglas Gregor 3ecc665505 Sink the _GNU_SOURCE definition down into the target configuration,
and only define it where we know we need it---Linux and Cygwin. Thanks
to Chris for the prodding.

llvm-svn: 101989
2010-04-21 05:52:38 +00:00
Douglas Gregor 58c65652a8 Reword the note we emit when suppressing template instantiation contexts, per John's advice
llvm-svn: 101988
2010-04-21 05:40:43 +00:00
Chris Lattner 87e049558e rough pass moving stuff into relevant sections, still much
editing to do.

llvm-svn: 101987
2010-04-21 05:17:40 +00:00
Blaine Garst b4d7aa6fd6 update copyright notices
llvm-svn: 101986
2010-04-21 04:34:46 +00:00
Chris Lattner 52791c2bc9 remove ldc, rubinious, macruby, icedtea, llvm-lua, which
don't have updates for 2.7.

llvm-svn: 101985
2010-04-21 04:28:21 +00:00
Evan Cheng 4158a0ff6b Implement -disable-non-leaf-fp-elim which disable frame pointer elimination
optimization for non-leaf functions. This will be hooked up to gcc's
-momit-leaf-frame-pointer option. rdar://7886181

llvm-svn: 101984
2010-04-21 03:18:23 +00:00
Zhongxing Xu f29231ece0 The second check point in the old test case was invalid.
llvm-svn: 101983
2010-04-21 02:22:25 +00:00
John McCall 465dfb2705 Use const_cast instead of a C cast. Safer, plus it suppresses a gcc warning.
llvm-svn: 101982
2010-04-21 02:20:33 +00:00
Zhongxing Xu 3affbe6b50 Use the right predecessor.
llvm-svn: 101981
2010-04-21 02:20:10 +00:00
Zhongxing Xu d80755dac2 Add initial support for C++ delete expr.
llvm-svn: 101980
2010-04-21 02:17:31 +00:00
Evan Cheng 9c8cd8c061 isel (i32 anyext i16) as insert_subreg when 16-bit ops are being promoted.
llvm-svn: 101979
2010-04-21 01:47:12 +00:00
Evan Cheng 873310f635 Trim include.
llvm-svn: 101978
2010-04-21 01:39:06 +00:00