Commit Graph

57775 Commits

Author SHA1 Message Date
Mike Stump d74673133d Fix build error.
llvm-svn: 69009
2009-04-14 00:56:59 +00:00
Dale Johannesen 83593f4167 Do not force asm's to be chained if they don't touch
memory and aren't volatile.  This was interfering with
good scheduling.

llvm-svn: 69008
2009-04-14 00:56:56 +00:00
Steve Naroff 323827e8d0 Change dyn_cast<> to isa<>. Pointed out by Anders (thanks).
llvm-svn: 69007
2009-04-14 00:40:09 +00:00
Evan Cheng 9787183b9b Fix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and IsDstPhys which are returned by value and used by callee. This happened to work on the earlier test cases because of a logic error in the caller side.
llvm-svn: 69006
2009-04-14 00:32:25 +00:00
Douglas Gregor 1a0d0b9acc When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.

llvm-svn: 69005
2009-04-14 00:24:19 +00:00
Steve Naroff e4e55d2706 Fix crasher in ASTContext::getObjCEncodingForMethodDecl().
This was exposed as a result of something else that was recently fixed.

llvm-svn: 69004
2009-04-14 00:03:58 +00:00
Douglas Gregor a541485bab Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
expression or statement serialization before we can test them.

llvm-svn: 69002
2009-04-13 22:49:25 +00:00
Daniel Dunbar 097f630dad Make these errors more noticable in build logs.
llvm-svn: 68998
2009-04-13 22:26:09 +00:00
Douglas Gregor 92f056fadf PCH support for functions and their parameters.
llvm-svn: 68997
2009-04-13 22:18:37 +00:00
Bob Wilson 59dbbb2bb4 Change SelectionDAG type legalization to allow BUILD_VECTOR operands to be
promoted to legal types without changing the type of the vector.  This is
following a suggestion from Duncan
(http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/019923.html).
The transformation that used to be done during type legalization is now
postponed to DAG legalization.  This allows the BUILD_VECTORs to be optimized
and potentially handled specially by target-specific code.

It turns out that this is also consistent with an optimization done by the
DAG combiner: a BUILD_VECTOR and INSERT_VECTOR_ELT may be combined by
replacing one of the BUILD_VECTOR operands with the newly inserted element;
but INSERT_VECTOR_ELT allows its scalar operand to be larger than the
element type, with any extra high bits being implicitly truncated.  The
result is a BUILD_VECTOR where one of the operands has a type larger the
the vector element type.

Any code that operates on BUILD_VECTORs may now need to be aware of the
potential type discrepancy between the vector element type and the
BUILD_VECTOR operands.  This patch updates all of the places that I could
find to handle that case.

llvm-svn: 68996
2009-04-13 22:05:19 +00:00
Eli Friedman 20bb5e02a5 Minor work related to removing the assumption that value initialization
implies an all-zero bit pattern.

llvm-svn: 68994
2009-04-13 21:47:26 +00:00
Eli Friedman c08711e840 Minor simplification.
llvm-svn: 68992
2009-04-13 21:41:57 +00:00
Eli Friedman 337cd3a536 PR3461: reject initializer for incomplete type. Based on patch by Tim
Northover.

llvm-svn: 68991
2009-04-13 21:28:54 +00:00
Daniel Dunbar c0a4ea0c02 Remove CheckBuiltinMacros script, obsoleted since we support -dM now.
llvm-svn: 68990
2009-04-13 21:26:41 +00:00
Daniel Dunbar 115b8dd72b Ignore Output directory
llvm-svn: 68989
2009-04-13 21:25:25 +00:00
Douglas Gregor 183671e2d2 PCH support for record decls/types and their fields. Now that we can
handle the definition of __builtin_va_list on x86-64, eliminate the
forced -triple in PCH tests to get better coverage.

llvm-svn: 68988
2009-04-13 21:20:57 +00:00
Daniel Dunbar 4184ac847f Update to use hasAttr() instead of getAttr().
- No functionality change.

llvm-svn: 68987
2009-04-13 21:08:27 +00:00
Dan Gohman 6c1426308c Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalize
it accordingly. Thanks to Jakob Stoklund Olesen for pointing
out how this might be useful.

llvm-svn: 68986
2009-04-13 21:06:25 +00:00
Douglas Gregor c3b1dd163b Print the number (and percentage) of identifiers read from the PCH file as part of its statistics
llvm-svn: 68985
2009-04-13 20:50:16 +00:00
Douglas Gregor 85c0fcd66d Introduce PCH (de-)serialization for most compound types, excluding
Objective-C types and record types for the moment.

llvm-svn: 68984
2009-04-13 20:46:52 +00:00
Daniel Dunbar a431deb03c Reapply 68936, turned out to that clang's better debug info exposed a
codegenerator bug.

llvm-svn: 68983
2009-04-13 20:46:33 +00:00
Steve Naroff fb46e8658c Move/update recent FIXME (wrt UTF-8 checking for ObjC @-strings).
llvm-svn: 68982
2009-04-13 20:26:29 +00:00
Bob Wilson f6c2195383 Refactor some code in SelectionDAGLegalize::ExpandBUILD_VECTOR.
llvm-svn: 68981
2009-04-13 20:20:30 +00:00
Chris Lattner 648fa92fe1 upgrade "extra tokens at end of directive" to warn by default.
llvm-svn: 68980
2009-04-13 20:19:36 +00:00
Evan Cheng f0843803a0 PR3934: Fix a bogus two-address pass assertion.
llvm-svn: 68979
2009-04-13 20:04:24 +00:00
Bill Wendling 7aba8e30c4 Get rid of some compile warnings.
llvm-svn: 68978
2009-04-13 19:45:05 +00:00
Douglas Gregor afbe7d53f5 Add a static APInt::getNumWords
llvm-svn: 68977
2009-04-13 19:43:10 +00:00
Fariborz Jahanian b6d5b54839 In objc2's None-Fragile ABI, one cannot use the super class ivar for
setter/getter synthesis.

llvm-svn: 68976
2009-04-13 19:30:37 +00:00
Steve Naroff 84073ec51f Fixed crasher in <rdar://problem/6780904> [irgen] Assertion failed: (Result == conversionOK && "UTF-8 to UTF-16 conversion failed"), function GetAddrOfConstantCFString, file CodeGenModule.cpp, line 1063.
Still a diagnostic related FIXME (will discuss with Daniel/Fariborz offline).

llvm-svn: 68975
2009-04-13 19:08:08 +00:00
Douglas Gregor 1daeb69f95 Add PCH support for enumerations and enumerators.
llvm-svn: 68974
2009-04-13 18:14:40 +00:00
Devang Patel 0431504fb2 Right now, Debugging information to encode scopes (DW_TAG_lexical_block) relies on DBG_LABEL. Unfortunately this intefers with the quality of optimized code.
This patch updates dwarf writer to encode scoping information in DWARF only in FastISel mode.

llvm-svn: 68973
2009-04-13 18:13:16 +00:00
Daniel Dunbar f3d0dccfff Revert 68936, LLVM still isn't ready to handle debug info + optimization.
llvm-svn: 68972
2009-04-13 18:03:39 +00:00
Anders Carlsson 1235bbce7e Use the new guard variable mangling function and get rid of the old code.
llvm-svn: 68971
2009-04-13 18:03:33 +00:00
Anders Carlsson 0c08f6fdde Add support for mangling guard variables.
llvm-svn: 68969
2009-04-13 18:02:10 +00:00
Steve Naroff 42959b2660 Change diagnostic as a result of researching <rdar://problem/6779809> missing interface name in "error: cannot declare variable inside a class, protocol or category ''.
Since ObjC 2.0 class "extensions" have a null name, the diagnostic above is actually "correct". Nevertheless, it is confusing. Decided to remove the name entirely (from my perspective, it didn't add any value). Also simplified the text of the diagnostic a bit.

llvm-svn: 68967
2009-04-13 17:58:46 +00:00
Daniel Dunbar 2cba6be499 Fix assertion failure in PTH when tokens followed a closing #endif.
- Ted, please check.

 - Missing test case because PTH won't reliably cache the tokens in a
   test case. *cough*

llvm-svn: 68966
2009-04-13 17:57:49 +00:00
Douglas Gregor a8854654ac Make the reading of the line table from a PCH file more robust against
the unlikely event that the filename IDs in the stored line table end
up being different from the filename IDs in the newly-created line
table.

llvm-svn: 68965
2009-04-13 17:12:42 +00:00
Devang Patel 80be3511ed Reapply 68847.
Now debug_inlined section is covered by TAI->doesDwarfUsesInlineInfoSection(), which is false by default.

llvm-svn: 68964
2009-04-13 17:02:03 +00:00
Douglas Gregor 4c7626e7b6 Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files.

llvm-svn: 68963
2009-04-13 16:31:14 +00:00
Dan Gohman 57d6bd36b2 Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
   and in some cases a temporary register.
 - Add address-mode matching for turning (X>>(8-n))&(255<<n), where
   n is a valid address-mode scale value, into an h-register extract
   and a scaled-offset address.
 - Replace X86's MOV32to32_ and related instructions with the new
   target-independent COPY_TO_SUBREG instruction.

On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.

These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.

llvm-svn: 68962
2009-04-13 16:09:41 +00:00
Dan Gohman 60a446ab02 Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.
This will be used to replace things like X86's MOV32to32_.

Enhance ScheduleDAGSDNodesEmit to be more flexible and robust
in the presense of subregister superclasses and subclasses. It
can now cope with the definition of a virtual register being in
a subclass of a use.

Re-introduce the code for recording register superreg classes and
subreg classes. This is needed because when subreg extracts and
inserts get coalesced away, the virtual registers are left in
the correct subclass.

llvm-svn: 68961
2009-04-13 15:38:05 +00:00
Douglas Gregor a07ebc5b95 Factor the internals of SourceManager (specially, LineTableInfo) into a separate Internals header. No functionality change
llvm-svn: 68960
2009-04-13 15:31:25 +00:00
Dan Gohman f20462c217 Remove x86's special-case handling for ISD::TRUNCATE and
ISD::SIGN_EXTEND_INREG. Tablegen-generated code can handle
these cases, and the scheduling issues observed earlier
appear to be resolved now.

llvm-svn: 68959
2009-04-13 15:29:31 +00:00
Dan Gohman e9432dcc0d Fix copy+pastos in comments.
llvm-svn: 68958
2009-04-13 15:28:29 +00:00
Dan Gohman e14b8d9853 Generalize getRegisterClassForRegister to handle registers
in multiple classes in the case that the classes are all
in subset/superset relations. This function is used by the
fast-isel emitter, which always wants the super-most set.

llvm-svn: 68957
2009-04-13 15:24:11 +00:00
Dan Gohman 1d50407932 Don't abort on an aliasing physical register that does not have
a live interval. This is needed for some upcoming subreg changes.

llvm-svn: 68956
2009-04-13 15:22:29 +00:00
Dan Gohman 4d62ff1483 When assigning a physical register to a MachineOperand, set
the subreg field to 0, since the subreg field is only used
for virtual register subregs. This doesn't change
current functionality; it just eliminates bogus noise from
debug output.

llvm-svn: 68955
2009-04-13 15:21:32 +00:00
Dan Gohman 9e3eb7bcd9 List the l registers before h registers, for consistency.
llvm-svn: 68954
2009-04-13 15:18:42 +00:00
Dan Gohman 85abd983f2 Add an assertion to verify that a copy was actually emitted.
llvm-svn: 68953
2009-04-13 15:16:56 +00:00
Douglas Gregor 712a351c42 Make the selection of type declarations in Sema::getTypeName
deterministic when faced with an ambiguity. This eliminates the
annoying test/SemaCXX/using-directive.cpp failure.

llvm-svn: 68952
2009-04-13 15:14:38 +00:00