Commit Graph

99783 Commits

Author SHA1 Message Date
Greg Clayton 6da4ca83b0 Added the start of opcode emulation for ARM instructions. This class is designed
to be fed 4 callbacks: read/write memory, and read/write registers. After this,
you can tell the object to read an instruction. This will cause the class to read
the PC, and read and instruction. Then you can emulate the instruction by calling
EvaluateInstruction. This will cause the class to figure out exactly what an opcode
does, and call the read/write mem/regs functions with actual values which allows one
to emulate an instruction without running a process, or it allows one to watch the
context information (the memory write is a pushing register 3 onto the stack at offset
12) so it can be used for generating call frame information. This way, in the future,
we will have one class that can be used to emulate instructions and generate our
unwind info from assembly.

llvm-svn: 123998
2011-01-21 22:02:52 +00:00
Venkatraman Govindaraju ef8cf45eb1 Sparc backend:
Rename FLUSH to FLUSHW.
 Output "ta 3" instead of a "flushw" instruction if v8 instruction set is used.

llvm-svn: 123997
2011-01-21 22:00:00 +00:00
Douglas Gregor 626fbeda90 Generalize the NRVO move-construction-based initialization routine. No functionality change
llvm-svn: 123996
2011-01-21 21:08:57 +00:00
Ted Kremenek 2959fdd087 Add basic fixits for -Wuninitialized-experimental
to suggest initializations for pointer and
ObjC pointer types.

llvm-svn: 123995
2011-01-21 19:41:46 +00:00
Ted Kremenek 39fa056342 Enhance -Wuninitialized-experimental diagnostics
to issue the warning at an uninitialized variable's
declaration, but to issue notes at possible
uninitialized uses (which could be multiple).

llvm-svn: 123994
2011-01-21 19:41:41 +00:00
Owen Anderson a834200dbe Just because we have determined that an (fcmp | fcmp) is true for A < B,
A == B, and A > B, does not mean we can fold it to true.  We still need to
check for A ? B (A unordered B).

llvm-svn: 123993
2011-01-21 19:39:42 +00:00
Douglas Gregor f282a76fab Implement the preference for move-construction over copy-construction
when returning an NRVO candidate expression. For example, this
properly picks the move constructor when dealing with code such as

  MoveOnlyType f() { MoveOnlyType mot; return mot; }

The previously-XFAIL'd rvalue-references test case now works, and has
been moved into the appropriate paragraph-specific test case.

llvm-svn: 123992
2011-01-21 19:38:21 +00:00
Evan Cheng 2f2435d026 Last round of fixes for movw + movt global address codegen.
1. Fixed ARM pc adjustment.
2. Fixed dynamic-no-pic codegen
3. CSE of pc-relative load of global addresses.

It's now enabled by default for Darwin.

llvm-svn: 123991
2011-01-21 18:55:51 +00:00
Renato Golin 83758d5cd7 Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.
llvm-svn: 123990
2011-01-21 18:25:47 +00:00
Daniel Dunbar fee882c203 clang_darwin: We don't need clear_cache for use with Clang on ARM/Darwin.
llvm-svn: 123989
2011-01-21 18:23:47 +00:00
Daniel Dunbar e1e6acecb3 clang_darwin: Build with -fno-builtin, primarily to avoid issues with defining possible builtin functions.
llvm-svn: 123988
2011-01-21 18:23:42 +00:00
Daniel Dunbar 384a842085 clang_darwin: Start building an armv7 slice for cc_kext.
llvm-svn: 123987
2011-01-21 18:23:37 +00:00
Daniel Dunbar 77b059e32b clang_darwin: Build cckext bits with -mthumb.
llvm-svn: 123986
2011-01-21 18:23:32 +00:00
Daniel Dunbar d8baa2b4b0 Fix typo.
llvm-svn: 123985
2011-01-21 18:23:27 +00:00
Johnny Chen 661ba65dd8 Add test cases for the scenario of selecting a frame index while stopped, and
then doing a thread step-out.  This should lead us to the caller frame of the
frame we just selected.

llvm-svn: 123984
2011-01-21 18:23:16 +00:00
Douglas Gregor 732abf1128 We love parentheses
llvm-svn: 123983
2011-01-21 18:20:49 +00:00
Douglas Gregor 5d36900d7a Promote the static getNRVOCandidate() function, which computed the
NRVO candidate for a return statement, to
Sema::getCopyElisionCandidate(), and teach it enough to also determine
the NRVO candidate for a throw expression. We still don't use the
latter information, however.

Along the way, implement core issue 1148, which eliminates copy
elision from catch parameters and clarifies that copy elision cannot
occur from function parameters (which we already implemented).

llvm-svn: 123982
2011-01-21 18:05:27 +00:00
Douglas Gregor 6381402fe1 Implement core issue 1164, which concerns the partial ordering of
f(T&) and f(T&&).

llvm-svn: 123981
2011-01-21 17:29:42 +00:00
Douglas Gregor bf2f961a35 Add unique_ptr example to test the use of rvalue references. I'll grow
this example further as more rvalue-reference features come online.

llvm-svn: 123980
2011-01-21 17:06:29 +00:00
Douglas Gregor cc73795cd8 Add test for overload resolution's preference for binding an rvalue
reference to an rvalue rather than binding a const-qualified lvalue
reference to that rvalue.

llvm-svn: 123979
2011-01-21 16:48:38 +00:00
Douglas Gregor e916d0508b Eliminate an unused variable
llvm-svn: 123978
2011-01-21 16:37:29 +00:00
Douglas Gregor 95273c3a22 Update the reference-binding implementation used for overload
resolution to match the latest C++0x working paper's semantics. The
implementation now matching up with the reference-binding
implementation used for initialization.

llvm-svn: 123977
2011-01-21 16:36:05 +00:00
Oscar Fuentes 6495595382 Handles libffi on the CMake build.
Patch by arrowdodger!

llvm-svn: 123976
2011-01-21 15:42:54 +00:00
Bruno Cardoso Lopes 4bd612384a Fix the encoding of QADD/SUB, QDADD/SUB. While qadd16, qadd8 use "rd, rn, rm",
qadd and qdadd uses "rd, rm, rn", the same applies to the 'sub' variants. This
is described in ARM manuals and matches the encoding used by the gnu assembler.

llvm-svn: 123975
2011-01-21 14:07:40 +00:00
Venkatraman Govindaraju 0594789f07 Implement support for byval arguments in Sparc backend.
llvm-svn: 123974
2011-01-21 14:00:01 +00:00
Nick Lewycky ae0275e018 SCCP doesn't actually preserve the CFG. It will delete and insert terminator
instructions.

llvm-svn: 123973
2011-01-21 08:38:09 +00:00
Michael J. Spencer e12c8a802f Revert "Object: Renable the tests now that none of the build bots complain about aliasing."
This reverts commit 281f3901b7b0869929caf8946c1ad1228bc38922.

llvm-svn: 123972
2011-01-21 06:27:04 +00:00
Andrew Trick bd428ec50f Enable support for precise scheduling of the instruction selection
DAG. Disable using "-disable-sched-cycles".

For ARM, this enables a framework for modeling the cpu pipeline and
counting stalls. It also activates several heuristics to drive
scheduling based on the model. Scheduling is inherently imprecise at
this stage, and until spilling is improved it may defeat attempts to
schedule. However, this framework provides greater control over
tuning codegen.

Although the flag is not target-specific, it should have very little
affect on the default scheduler used by x86. The only two changes that
affect x86 are:
- scheduling a high-latency operation bumps the current cycle so independent
  operations can have their latency covered. i.e. two independent 4
  cycle operations can produce results in 4 cycles, not 8 cycles.
- Two operations with equal register pressure impact and no
  latency-based stalls on their uses will be prioritized by depth before height
  (height is irrelevant if no stalls occur in the schedule below this point).

llvm-svn: 123971
2011-01-21 06:19:05 +00:00
Greg Clayton 481cef25dc Added support for stepping out of a frame. If you have 10 stack frames, and you
select frame #3, you can then do a step out and be able to go directly to the
frame above frame #3! 

Added StepOverUntil and StepOutOfFrame to the SBThread API to allow more powerful
stepping.

llvm-svn: 123970
2011-01-21 06:11:58 +00:00
Andrew Trick 47ff14b091 Convert -enable-sched-cycles and -enable-sched-hazard to -disable
flags. They are still not enable in this revision.

Added TargetInstrInfo::isZeroCost() to fix a fundamental problem with
the scheduler's model of operand latency in the selection DAG.

Generalized unit tests to work with sched-cycles.

llvm-svn: 123969
2011-01-21 05:51:33 +00:00
Chris Lattner b5e15d1907 fix PR9013, an infinite loop in instcombine.
llvm-svn: 123968
2011-01-21 05:29:50 +00:00
Douglas Gregor 4edf1c8968 More testing to C++0x [temp.deduct.call]p3
llvm-svn: 123967
2011-01-21 05:24:25 +00:00
Douglas Gregor cba72b1f62 Implement the special template argument deduction rule for T&& in a
call (C++0x [temp.deduct.call]p3).

As part of this, start improving the reference-binding implementation
used in the computation of implicit conversion sequences (for overload
resolution) to reflect C++0x semantics. It still needs more work and
testing, of course.

llvm-svn: 123966
2011-01-21 05:18:22 +00:00
Chris Lattner f4ca47bda8 update obsolete comment.
llvm-svn: 123965
2011-01-21 05:08:26 +00:00
Michael J. Spencer 2d9860cbec Object: Renable the tests now that none of the build bots complain about aliasing.
llvm-svn: 123964
2011-01-21 05:07:13 +00:00
Nick Lewycky 6a083cf820 Don't try to pull vector bitcasts that change the number of elements through
a select. A vector select is pairwise on each element so we'd need a new
condition with the right number of elements to select on. Fixes PR8994.

llvm-svn: 123963
2011-01-21 02:30:43 +00:00
Michael J. Spencer 0324b67267 Object: Fix type punned pointer issues by making DataRefImpl a union and using intptr_t.
llvm-svn: 123962
2011-01-21 02:27:02 +00:00
Peter Collingbourne 9f2a9909ae Sema: process non-inheritable attributes on function declarations early
This allows us to simplify the handling for the overloadable attribute,
removing a number of FIXMEs.

llvm-svn: 123961
2011-01-21 02:08:54 +00:00
Peter Collingbourne b331b267b1 Sema: support for processing non-inheritable declaration attributes early
llvm-svn: 123960
2011-01-21 02:08:45 +00:00
Peter Collingbourne ab8bc06373 Generalise support for non-inheritable attributes
Inheritable attributes on declarations may be inherited by any later
redeclaration at merge time.  By contrast, a non-inheritable attribute
will not be inherited by later redeclarations.  Non-inheritable
attributes may be semantically analysed early, allowing them to
influence the redeclaration/overloading process.

Before this change, the "overloadable" attribute received special
handling to be treated as non-inheritable, while all other attributes
were treated as inheritable.  This patch generalises the concept,
while removing a FIXME.  Some CUDA location attributes are also marked
as non-inheritable in order to support special overloading semantics
(to be introduced in a later patch).

The patch introduces a new Attr subclass, InheritableAttr, from
which all inheritable attributes derive.  Non-inheritable attributes
simply derive from Attr.

N.B. I did not review every attribute to determine whether it should
be marked non-inheritable.  This can be done later on an incremental
basis, as this change does not affect default functionality.

llvm-svn: 123959
2011-01-21 02:08:36 +00:00
Peter Collingbourne 4fbd74ba02 tblgen: Add support for non-inheritable attributes
This patch makes the necessary changes to TableGen to support
non-inheritable attributes.

llvm-svn: 123958
2011-01-21 02:08:26 +00:00
Greg Clayton e221f82b40 Fixed up the SBValue::GetExpressionPath() to be more correct under more
circumstances.

llvm-svn: 123957
2011-01-21 01:59:00 +00:00
Nick Lewycky 39b12c059d Add a constant folding of casts from zero to zero. Fixes PR9011!
While here, I'd like to complain about how vector is not an aggregate type
according to llvm::Type::isAggregateType(), but they're listed under aggregate
types in the LangRef and zero vectors are stored as ConstantAggregateZero.

llvm-svn: 123956
2011-01-21 01:12:09 +00:00
Douglas Gregor 9b175e0512 Add more reference-binding examples from the C++0x working paper, all of which seem to be working fine
llvm-svn: 123955
2011-01-21 01:11:43 +00:00
Fariborz Jahanian 252a47f635 Move cheking of kext into canDevirtualizeMemberFunctionCalls().
Improve on test case. Per Doug's comment. wip.

llvm-svn: 123954
2011-01-21 01:04:41 +00:00
Douglas Gregor bed28f7629 Improve the diagnostic that complains about binding an rvalue
reference to an lvalue.

llvm-svn: 123953
2011-01-21 01:04:33 +00:00
Douglas Gregor 24f2e8ec00 More work to bring reference binding up to the latest C++0x
specification. In particular, an rvalue reference can bind to an
initializer expression that is an lvalue if the referent type and the
initializer expression type are not reference-related. This is a newer
formulation to the previous "rvalue references can never bind to
lvalues" rule.

llvm-svn: 123952
2011-01-21 00:52:42 +00:00
Douglas Gregor d412fe598b When performing reference binding via a conversion function, perform
type checking based on the actual reference type we're trying to bind
the result to, rather than stripping the reference.

llvm-svn: 123950
2011-01-21 00:27:08 +00:00
Evan Cheng 028ccbfcbf Don't be overly aggressive with CSE of "ldr constantpool". If it's a pc-relative
value, the "add pc" must be CSE'ed at the same time. We could follow the same
approach as T2 by adding pseudo instructions that combine the ldr + "add pc".
But the better approach is to use movw + movt (which I will enable soon), so
I'll leave this as a TODO.

llvm-svn: 123949
2011-01-20 23:55:07 +00:00
Fariborz Jahanian 4ad7afa019 Initialize a variable, found by Ted.
llvm-svn: 123948
2011-01-20 23:34:25 +00:00