Commit Graph

77509 Commits

Author SHA1 Message Date
Evan Cheng 112a871fe2 Make test less fragile
llvm-svn: 95258
2010-02-03 21:39:04 +00:00
Fariborz Jahanian 80c54b05a0 Fix more rewriting of protocol-quialified 'id' type.
(Fixes radar 7607413).

llvm-svn: 95257
2010-02-03 21:29:28 +00:00
Chris Lattner f914be06d2 stub out a new X86 encoder, which can be tried with
-enable-new-x86-encoder until its stable.

llvm-svn: 95256
2010-02-03 21:24:49 +00:00
Sebastian Redl 2b37272c11 In some contexts, type declarations cannot occur. Pass this information down to ParseClassSpecifier, to make its decision easier. Fixes PR6200.
llvm-svn: 95255
2010-02-03 21:21:43 +00:00
Chris Lattner 2f750f3b5a rename createX86MCCodeEmitter to more accurately reflect what it creates.
llvm-svn: 95254
2010-02-03 21:14:33 +00:00
Chris Lattner 93ddf80eb7 don't inform comment handlers about comments in #if 0 blocks,
doing so invalidates the file guard optimization and is not
in the spirit of "#if 0" because it is supposed to completely
skip everything, even if it isn't lexically valid. Patch by
Abramo Bagnara!

llvm-svn: 95253
2010-02-03 21:06:21 +00:00
Kevin Enderby 00f1e6c030 Added support for X86 instruction prefixes so llvm-mc can assemble them. The
Lock prefix, Repeat string operation prefixes and the Segment override prefixes.
Also added versions of the move string and store string instructions without the
repeat prefixes to X86InstrInfo.td. And finally marked the rep versions of
move/store string records in X86InstrInfo.td as isCodeGenOnly = 1 so tblgen is
happy building the disassembler files.

llvm-svn: 95252
2010-02-03 21:04:42 +00:00
Douglas Gregor 21e771e96e Define two types to be "compatible" in C++ if they are the same, and
remove some age-old FIXMEs and C++ workarounds within the
type-compatibility logic.

llvm-svn: 95249
2010-02-03 21:02:30 +00:00
Chris Lattner 5e854b95f3 Declarators can have grouping parens. This fixes rdar://7608537.
llvm-svn: 95246
2010-02-03 20:41:24 +00:00
Fariborz Jahanian 8c3f06d09c Patch to allow reinterpret_cast on objective-c pointers.
(partial fix for radar 7591784).

llvm-svn: 95245
2010-02-03 20:32:31 +00:00
Daniel Dunbar 45858d2d59 Revert "Numerous changes to selector handling:", this breaks a whole bunch of
working code, for no apparent reason.

llvm-svn: 95244
2010-02-03 20:11:42 +00:00
Devang Patel d231689adb Emit appropriate expression to find virtual base offset.
llvm-svn: 95242
2010-02-03 20:08:48 +00:00
Devang Patel 999b499024 Provide interface to identifiy artificial methods.
llvm-svn: 95240
2010-02-03 19:57:19 +00:00
Sebastian Redl cbdffb1585 Top-level const changes do not make a qualification conversion. Fixes PR6089.
llvm-svn: 95239
2010-02-03 19:36:07 +00:00
Douglas Gregor 2973d406ba When determining whether a function without a prototype is compatible
with a function with a prototype, treat parameters of enumeration type
based on the enumeration type's promotion type.

llvm-svn: 95238
2010-02-03 19:27:29 +00:00
Jeffrey Yasskin 099552a0ca r94686 changed all ModuleProvider parameters to Modules, which made the
1-argument ExecutionEngine::create(Module*) ambiguous with the signature that
used to be ExecutionEngine::create(ModuleProvider*, defaulted_params).  Fixed
by removing the 1-argument create().  Fixes PR6221.

llvm-svn: 95236
2010-02-03 19:18:04 +00:00
Anders Carlsson 66498388a7 Handle reference binding in aggregate initializers. Fixes another 47 tests.
llvm-svn: 95235
2010-02-03 19:13:55 +00:00
Anders Carlsson 9b92ef90f0 Add a band-aid fix for clang self-hosting. A better fix will follow shortly.
llvm-svn: 95232
2010-02-03 18:54:13 +00:00
Jeffrey Yasskin 212badaa60 Make docs less specific about their versions, at Chris's suggestion.
llvm-svn: 95231
2010-02-03 18:49:55 +00:00
Daniel Dunbar c0f5f284d4 Add llvm_supports_darwin_and_target to DejaGNU as well, I'd almost forgotten it
ever existed. :)

llvm-svn: 95230
2010-02-03 18:43:46 +00:00
Jeffrey Yasskin 696d965708 Mention the version in the documentation index and link to the 2.6 docs, which
is what most readers will actually be aiming for.

llvm-svn: 95229
2010-02-03 18:23:23 +00:00
Eli Friedman eb1df70bdc Fix for PR6220: compute the correct type for multicharacter literals.
llvm-svn: 95228
2010-02-03 18:21:45 +00:00
Daniel Dunbar e3ee332fe0 llvm-mc: Add --show-inst option, for showing the MCInst inline with the assembly
output.

llvm-svn: 95227
2010-02-03 18:18:30 +00:00
Anders Carlsson b247350ef7 More cleanup.
llvm-svn: 95226
2010-02-03 17:33:16 +00:00
Dan Gohman b44d2abc91 Add "Author Date Id Revision" svn:keyword properties to these files, as
is done with the other html files in doc, to hopefully keep strings like
"Last modified" current.

llvm-svn: 95225
2010-02-03 17:27:31 +00:00
Bob Wilson 04365c5f72 Adjust the heuristics used to decide when SROA is likely to be profitable.
The SRThreshold value makes perfect sense for checking if an entire aggregate
should be promoted to a scalar integer, but it is not so good for splitting
an aggregate into its separate elements.  A struct may contain a large embedded
array along with some scalar fields that would benefit from being split apart
by SROA.  Even if the total aggregate size is large, it may still be good to
perform SROA.  Thus, the most important piece of this patch is simply moving
the aggregate size comparison vs. SRThreshold so that it guards only the
aggregate promotion.

We have also been checking the number of elements to decide if an aggregate
should be split up.  The limit of "SRThreshold/4" seemed rather arbitrary,
and I don't think it's very useful to derive this limit from SRThreshold
anyway.  I've collected some data showing that the current default limit of
32 (since SRThreshold defaults to 128) is a reasonable cutoff for struct
types.  One thing suggested by the data is that distinguishing between structs
and arrays might be useful.  There are (obviously) a lot more large arrays
than large structs (as measured by the number of elements and not the total
size -- a large array inside a struct still counts as a single element given
the way we do SROA right now).  Out of 8377 arrays where we successfully
performed SROA while compiling a large set of benchmarks, only 16 of them had
more than 8 elements.  And, for those 16 arrays, it's not at all clear that
SROA was actually beneficial.  So, to offset the compile time cost of
investigating more large structs for SROA, the patch lowers the limit on array
elements to 8.

This fixes Apple Radar 7563690.

llvm-svn: 95224
2010-02-03 17:23:56 +00:00
Anders Carlsson 3b227bd629 Revert the new reference binding code; I came up with a way simpler solution for the reference binding bug that is preventing self-hosting.
llvm-svn: 95223
2010-02-03 16:38:03 +00:00
David Chisnall 5bb4efdf3c First pass at adding GC support for GNU runtime. GC ivar maps not yet constructed, GC flag not set.
Please don't try using this yet - the runtime support is still very immature and your code will almost certainly crash if you do.  

llvm-svn: 95222
2010-02-03 15:59:02 +00:00
Garrison Venn 8665bcddec Repository access test commit
llvm-svn: 95221
2010-02-03 12:00:02 +00:00
Chandler Carruth 935384217d Teach the allocation function overload handling to deal with templates, and
prevent a crash on templates when looking for an existing declaration of the
predefined global operators. This fixes PR5918.

Added an easy test case for the overload handling, but testing the crash is
a bit trickier. Created a new test that can use multiple runs with a define to
trigger which test case is used so we can test this type of issue.

llvm-svn: 95220
2010-02-03 11:02:14 +00:00
Chandler Carruth 7ceffab64d Fix PR6149 by looking at the qualifiers on the referred to type for non-type
reference template arguments. Adds test cases for the cv-quals of reference
arguments.

llvm-svn: 95217
2010-02-03 09:37:33 +00:00
Douglas Gregor 7dc5c17d92 When a function or variable somehow depends on a type or declaration
that is in an anonymous namespace, give that function or variable
internal linkage.

This change models an oddity of the C++ standard, where names declared
in an anonymous namespace have external linkage but, because anonymous
namespace are really "uniquely-named" namespaces, the names cannot be
referenced from other translation units. That means that they have
external linkage for semantic analysis, but the only sensible
implementation for code generation is to give them internal
linkage. We now model this notion via the UniqueExternalLinkage
linkage type. There are several changes here:

  - Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage
    when the declaration is in an anonymous namespace.
  - Added Type::getLinkage() to determine the linkage of a type, which
    is defined as the minimum linkage of the types (when we're dealing
    with a compound type that is not a struct/class/union).
  - Extended NamedDecl::getLinkage() to consider the linkage of the
    template arguments and template parameters of function template
    specializations and class template specializations.
  - Taught code generation to rely on NamedDecl::getLinkage() when
    determining the linkage of variables and functions, also
    considering the linkage of the types of those variables and
    functions (C++ only). Map UniqueExternalLinkage to internal
    linkage, taking out the explicit checks for
    isInAnonymousNamespace().

This fixes much of PR5792, which, as discovered by Anders Carlsson, is
actually the reason behind the pass-manager assertion that causes the
majority of clang-on-clang regression test failures. With this fix,
Clang-built-Clang+LLVM passes 88% of its regression tests (up from
67%). The specific numbers are:

LLVM:
  Expected Passes    : 4006
  Expected Failures  : 32
  Unsupported Tests  : 40
  Unexpected Failures: 736

Clang:
  Expected Passes    : 1903
  Expected Failures  : 14
  Unexpected Failures: 75

Overall:
  Expected Passes    : 5909
  Expected Failures  : 46
  Unsupported Tests  : 40
  Unexpected Failures: 811

Still to do:
  - Improve testing
  - Check whether we should allow the presence of types with
  InternalLinkage (in addition to UniqueExternalLinkage) given
  variables/functions internal linkage in C++, as mentioned in
  PR5792. 
  - Determine how expensive the getLinkage() calls are in practice;
  consider caching the result in NamedDecl.
  - Assess the feasibility of Chris's idea in comment #1 of PR5792.

llvm-svn: 95216
2010-02-03 09:33:45 +00:00
Chandler Carruth 54a0f48e0b Add FlatStore.cpp (from r95214) to CMake build. Don't forget about it! =D
llvm-svn: 95215
2010-02-03 09:31:39 +00:00
Zhongxing Xu 5df3f53616 Add skeleton of flat store manager.
llvm-svn: 95214
2010-02-03 09:10:32 +00:00
Zhongxing Xu f5e0e3c3a7 Remove redundant declaration.
llvm-svn: 95213
2010-02-03 09:05:21 +00:00
Zhongxing Xu dcfa2576b0 Add constructors.
llvm-svn: 95212
2010-02-03 09:04:11 +00:00
Douglas Gregor 4a2f5464a7 Look through CXXExprWithTemporaries when digging out the original
initializer. Grrr....

llvm-svn: 95211
2010-02-03 09:01:59 +00:00
Chris Lattner 3bcbdb8a28 reapply r95206, this time actually delete the code I'm replacing in the third stub case.
llvm-svn: 95209
2010-02-03 06:42:38 +00:00
Chris Lattner 37fad99a05 revert r95206, it is apparently causing bootstrap failure on i386-darwin9
llvm-svn: 95208
2010-02-03 06:41:18 +00:00
Chris Lattner 44f7325de5 print instruction encodings with the existing comment facilities,
so that llvm-mc -show-encoding prints like this:

	hlt                                                 ## encoding: [0xf4]

instead of like this:

	hlt
                     # encoding: [0xf4]

llvm-svn: 95207
2010-02-03 06:28:13 +00:00
Chris Lattner 3eef965b06 make the x86 backend emit darwin stubs through mcstreamer
instead of textually.

llvm-svn: 95206
2010-02-03 06:21:16 +00:00
Chris Lattner 082f484074 make MachineModuleInfoMachO hold non-const MCSymbol*'s instead
of const ones.  non-const ones aren't very useful, because you can't
even, say, emit them.

llvm-svn: 95205
2010-02-03 06:18:30 +00:00
Chris Lattner 78c8eaa4cb update for llvm api change.
llvm-svn: 95203
2010-02-03 05:55:22 +00:00
Chris Lattner edcf065a29 change addPassesToEmitFile to return true on failure instead of its input,
add -filetype=null for performance testing and remove -filetype=dynlib,
which isn't planned to be implemented.

llvm-svn: 95202
2010-02-03 05:55:08 +00:00
Chris Lattner eb1e610d00 remove a big chunk of #if 0 code.
llvm-svn: 95201
2010-02-03 05:28:17 +00:00
Ted Kremenek d960564b76 Fix regression in RegionStore due to recent changes in
RegionStoreManager::InvalidateRegions() by adjusting the worklist to
iterate over BindingKeys instead of MemRegions.  We also only need to
do the actual invalidation work on base regions, and for non-base
regions just blow away their bindings.

llvm-svn: 95200
2010-02-03 04:16:00 +00:00
Sam Weinig a16b0dd1ae Implement Doug's suggestion. Eliminate the Stmts pointer from CXXTryStmt and instead allocate the statements after the object.
llvm-svn: 95199
2010-02-03 03:56:39 +00:00
Evan Cheng 27a41d5473 Revert 94937 and move the noreturn check to codegen.
llvm-svn: 95198
2010-02-03 03:55:59 +00:00
Sean Callanan 6a6f9cc634 Fixed the disassembler so it accepts multiple
instructions on a single line.  Also made it a
bit more forgiving when it reports errors.

llvm-svn: 95197
2010-02-03 03:46:41 +00:00
John McCall df951bddb8 Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits
as undefined.  Fixes an assertion in APFloat::toString noticed by Dale.

llvm-svn: 95196
2010-02-03 03:42:44 +00:00