Commit Graph

77204 Commits

Author SHA1 Message Date
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
Anders Carlsson
600f737b95 When doing a base-to-derived cast we don't need to null check the derived value if the class offset is 0.
llvm-svn: 94939
2010-01-31 01:43:37 +00:00
Anders Carlsson
84673e200f Some class related cleanup.
llvm-svn: 94938
2010-01-31 01:36:53 +00:00
Evan Cheng
d86d3fe0c3 Do not mark no-return calls tail calls. It'll screw up special calls like longjmp and it doesn't make much sense for performance reason. If my logic is faulty, please let me know.
llvm-svn: 94937
2010-01-31 00:59:31 +00:00
Daniel Dunbar
288edb5bda cindex/Python: Turn off showing IDs by default, they are really slow to compute
pending a hash function. Also added a --max-depth argument, handy for timing and
limiting the volume of output.

llvm-svn: 94936
2010-01-31 00:41:15 +00:00
Daniel Dunbar
baf33fc56f CIndex/USRs: Disable a bogus assert, we don't want CIndex to crash liberally. I
have sent Ted a test case for this.

llvm-svn: 94935
2010-01-31 00:41:05 +00:00
Daniel Dunbar
45dc842a0e cindex/Python: Add a simple example which dumps assorted information about a translation unit.
llvm-svn: 94934
2010-01-30 23:59:14 +00:00
Daniel Dunbar
a7a354e3e3 cindex/Python: Add full support for Diagnostic and FixIt objects, available via TranslationUnit.diagnostics.
Several important FIXMEs remain:
  - We aren't getting all the notes?
  - There is still no way to get diagnostics for invalid inputs.

llvm-svn: 94933
2010-01-30 23:59:02 +00:00
Daniel Dunbar
15635b8f5c cindex/Python: Update SourceLocation and SourceRange structures to match API changes.
Hurray for exposing implementation details!!!

llvm-svn: 94932
2010-01-30 23:58:50 +00:00
Daniel Dunbar
1e079a48ad cindex/Python: Update Index.create for removal of displayDiagnostics.
llvm-svn: 94931
2010-01-30 23:58:39 +00:00
Daniel Dunbar
83a2354c8b CIndex: Fix clang_equalLocations for change to ptr_data field.
llvm-svn: 94930
2010-01-30 23:58:27 +00:00
Daniel Dunbar
8fa74aa21d Simplify.
llvm-svn: 94929
2010-01-30 23:31:57 +00:00
Daniel Dunbar
9ee3a92a75 CIndex: Fix diagnostic callback to not return SourceLocations with a reference to a temporary LangOptions object.
llvm-svn: 94928
2010-01-30 23:31:49 +00:00
Daniel Dunbar
854d36bd9b CIndex: Fix ReportSerializedDiagnostics to honor the DiagnosticClient contract
that diagnostics with a source location should occur inside
{Begin,End}SourceFile.

Note that code completion is currently passing in an invalid LangOptions object
due to its implementation, I need to sort this out with Doug.

llvm-svn: 94927
2010-01-30 23:31:40 +00:00
Anders Carlsson
98323d29b6 Remove the SmallVectors from AsmStmt. Fixes PR6105.
llvm-svn: 94926
2010-01-30 23:19:41 +00:00
Anders Carlsson
9a020f9a3a Use IdentifierInfo * instead of std::string for the AsmStmt names.
llvm-svn: 94925
2010-01-30 22:25:16 +00:00
Daniel Dunbar
6b03ecef0d ASTUnit: Ensure the CompilerInvocation object used in LoadFromCommandLine is
live as long as the ASTUnit. This is useful for clients which want to maintain
pointers to the LangOptions object which ultimately lives in the
CompilerInvocation, although it would be nice to make all of this ownership
stuff more explicit and obvious.

llvm-svn: 94924
2010-01-30 21:47:16 +00:00
Daniel Dunbar
6824225465 CompilerInstance: Change to not contain the CompilerInvocation object.
This allows clients to install their own CompilerInvocation object, which is
important for clients that may wish to create references to things like
LangOptions whose lifetime will extend past that of the CompilerInstance.

llvm-svn: 94923
2010-01-30 21:47:07 +00:00
Anders Carlsson
0c5d7448d8 Fix thinko.
llvm-svn: 94922
2010-01-30 20:48:08 +00:00
Anders Carlsson
66de081f39 Even more AsmStmt cleanup.
llvm-svn: 94921
2010-01-30 20:38:10 +00:00
Anders Carlsson
087bc13d96 More asm cleanup.
llvm-svn: 94920
2010-01-30 20:05:21 +00:00
Benjamin Kramer
31a68e70a5 Simplify FreeBSD version parsing.
llvm-svn: 94919
2010-01-30 19:55:01 +00:00
Anders Carlsson
96fe0b5b96 Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.
llvm-svn: 94918
2010-01-30 19:34:25 +00:00
Anders Carlsson
c7c5baa482 Yay for more StringRefs.
llvm-svn: 94917
2010-01-30 19:12:25 +00:00
Anders Carlsson
0b0a122fde StringRef-ize the TargetInfo::ConstraintInfo constructor.
llvm-svn: 94916
2010-01-30 18:33:31 +00:00
Bruno Cardoso Lopes
193e64c699 Fix PR6144. Reload GP before the emission of CALLSEQ_END to guarantee the right reload order
llvm-svn: 94915
2010-01-30 18:32:07 +00:00
Bruno Cardoso Lopes
7ee71912ed Fix mov.d out register by using the FFR register class directly
llvm-svn: 94914
2010-01-30 18:29:19 +00:00
Anders Carlsson
bd32c434ae Add an assert to make sure that we don't try to mess with overridden methods for class templates.
llvm-svn: 94907
2010-01-30 17:42:34 +00:00
Benjamin Kramer
2ecf8eb2dc PCHReader doesn't implement classof so dyn_casting it will do really weird stuff. Use a static_cast instead.
I don't know if this hack is the right fix. Doug, please take a look.

llvm-svn: 94895
2010-01-30 16:23:25 +00:00
Daniel Dunbar
19b70bd46c Recognize 'q' as a format length modifier (from BSD).
llvm-svn: 94894
2010-01-30 15:49:20 +00:00
Benjamin Kramer
842bf17366 Use StringRef instead of returning a temporary std::string.
This fixes a really nasty bug in Darwin::getDarwinArchName where we were going
StringRef -> temporary std::string -> StringRef (and return the dead StringRef).
The StringRefs from Triple live as long as the Triple itself, that should be
long enough.

Hopefully 2 of 4 MSVC buildbot failures are gone now.

llvm-svn: 94892
2010-01-30 15:01:47 +00:00
Anton Korobeynikov
25df248382 Fix a gross typo: ARMv6+ may or may not support unaligned memory operations.
Even if they are suported by the core, they can be disabled
(this is just a configuration bit inside some register).

Allow unaligned memops on darwin and conservatively disallow them otherwise.

llvm-svn: 94889
2010-01-30 14:08:12 +00:00
Benjamin Kramer
a87bdb793e We don't need to place 0 in the URL string now that we return a StringRef.
- URL can go into read only memory now.
- Compilers will fold away all the strstr calls.

llvm-svn: 94887
2010-01-30 14:01:39 +00:00