Commit Graph

5333 Commits

Author SHA1 Message Date
John McCall e1f2ec28d8 When stringizing a NamedDecl for a diagnostic, treat the template
specialization types differently.

llvm-svn: 81512
2009-09-11 06:45:03 +00:00
John McCall 7f41d98928 Support elaborated dependent types and diagnose tag mismatches.
llvm-svn: 81504
2009-09-11 04:59:25 +00:00
Zhongxing Xu dc299bc481 Start to add a new transfer function that inlines callee. To be continued.
llvm-svn: 81501
2009-09-11 04:13:42 +00:00
Anders Carlsson 0b209a8632 Instantiate PredefinedExprs correctly. Patch by Sam Weinig!
llvm-svn: 81498
2009-09-11 01:22:35 +00:00
Daniel Dunbar 33a004e9eb Swizzle the target triple based on -mthumb, and update clang-cc to recognize
thumb-foo-bar as an ARM target.

llvm-svn: 81497
2009-09-11 01:14:50 +00:00
Douglas Gregor 73341c4e63 Diagnose VLAs as an error in C++.
Also, treat the GNU __null as an integral constant expression to match
GCC's behavior.

llvm-svn: 81490
2009-09-11 00:18:58 +00:00
Daniel Dunbar 7848592ec6 Initial handling of -m{soft-float,hard-float,float-abi=} for ARM.
llvm-svn: 81471
2009-09-10 23:00:09 +00:00
Fariborz Jahanian 2cde203392 Non fragile ABI for GNU runtime. Patch bu David Chisnall.
llvm-svn: 81462
2009-09-10 21:48:21 +00:00
Douglas Gregor 7f737c0015 When performing unqualified name lookup into a DeclContext, also look into
all of the parent DeclContexts that aren't represented within the
Scope chain. This fixes some name-lookup problems in out-of-line
definitions of members of nested classes.

llvm-svn: 81451
2009-09-10 16:57:35 +00:00
Zhongxing Xu 7e3431b5cf Make AnalysisManager stateless. Now other analyzer components only depends on
local node information.

llvm-svn: 81433
2009-09-10 05:44:00 +00:00
Daniel Dunbar 2ffe029a61 Implement Darwin/ARM behavior for defaulting to -fno-builtin-str{cat,cpy}.
llvm-svn: 81425
2009-09-10 03:37:02 +00:00
Daniel Dunbar 9000c3ff6d Recognize and ignore -Woverloaded-virtual.
llvm-svn: 81419
2009-09-10 01:20:58 +00:00
Daniel Dunbar cb5f2cf694 Fix dependencies for DiagnosticGroups.td.
llvm-svn: 81418
2009-09-10 01:20:50 +00:00
Douglas Gregor 5d3507d39c Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.

llvm-svn: 81394
2009-09-09 23:08:42 +00:00
Daniel Dunbar 1ce81538f1 Change Get{File,Program}Path to return an std::string (instead of a sys::Path).
llvm-svn: 81389
2009-09-09 22:33:00 +00:00
Daniel Dunbar 5f620c1fac StringRefize ArgList construction of ArgStrings.
llvm-svn: 81385
2009-09-09 22:32:26 +00:00
Anders Carlsson e9766d559b If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.
llvm-svn: 81383
2009-09-09 21:33:21 +00:00
Daniel Dunbar e7af341454 Push bound architecture name into TranslateArgs.
llvm-svn: 81366
2009-09-09 18:36:12 +00:00
Daniel Dunbar b5d86bbd76 Push bound architecture name into Compilation::getArgsForToolChain.
llvm-svn: 81365
2009-09-09 18:36:01 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Mike Stump 030867b97e Remove tab characters.
llvm-svn: 81340
2009-09-09 13:12:01 +00:00
Douglas Gregor 308047d3a5 Initial stab at implement dependent member references to member
templates, e.g.,
  
  x.template get<T>

We can now parse these, represent them within an UnresolvedMemberExpr
expression, then instantiate that expression node in simple cases.

This allows us to stumble through parsing LLVM's Casting.h.

llvm-svn: 81300
2009-09-09 00:23:06 +00:00
Daniel Dunbar 9c3f7c4a4b Validate arguments to -arch.
llvm-svn: 81281
2009-09-08 23:37:30 +00:00
Daniel Dunbar 1ef3f2aa3a Rename HostInfo::getToolChain to HostInfo::CreateToolChain, and don't recreate
the default tool chain when binding the default architecture.

llvm-svn: 81279
2009-09-08 23:37:19 +00:00
Daniel Dunbar 953b8d1f15 Fix ShouldUseClangCompiler to use llvm::Triple.
- -1 FIXME, and fixes 'clang -arch armv4t ...', for example.

llvm-svn: 81276
2009-09-08 23:36:55 +00:00
Douglas Gregor 5b5559b272 Make sure to access APValue's data via a char array (rather than
through an array of void*), so that we don't run afoul of the
strict-aliasing rules in C++ 3.10p15. Unfortunately, GCC 4.4 still
complains about this code.

llvm-svn: 81251
2009-09-08 19:57:33 +00:00
Fariborz Jahanian b17a190186 Fixes a regression in generating objc's GC API
in assiging to c pointer types with a GC'able
attribute.

llvm-svn: 81244
2009-09-08 19:45:47 +00:00
Anders Carlsson 2fb0824197 Vastly improve PredefinedExpr output, both in Sema and CodeGen. Patch by Sam Weinig!
llvm-svn: 81237
2009-09-08 18:24:21 +00:00
John McCall d8fe9af3a2 Support templateids in friend declarations. Fixes bug 4859.
llvm-svn: 81233
2009-09-08 17:47:29 +00:00
Anders Carlsson 6816affaa4 Handle variadic constructors better. Share code between BuildCXXConstructExpr and BuildCXXTemporaryObjectExpr.
llvm-svn: 81181
2009-09-08 01:48:42 +00:00
Anders Carlsson 6d5de59d09 Clean up the CXXConstructExpr constructor, add Arg getters.
llvm-svn: 81178
2009-09-08 01:23:37 +00:00
Anders Carlsson 85ec4ffaf5 Check that the destination type of a static_cast expression is a complete type.
llvm-svn: 81151
2009-09-07 18:25:47 +00:00
Benjamin Kramer 26db6481c5 Replace some instances of std::string with StringRefs.
llvm-svn: 81079
2009-09-05 09:49:39 +00:00
John McCall b2e195a585 Start emitting ElaboratedTypes in C++ mode. Support the effort in various
ways:  remove elab types during desugaring, enhance pretty-printing to allow
tags to be suppressed without suppressing scopes, look through elab types
when associating a typedef name with an anonymous record type.

llvm-svn: 81065
2009-09-05 06:31:47 +00:00
Anders Carlsson 657bad441e Use a separate diagnostic for default function argument expressions.
llvm-svn: 81062
2009-09-05 05:14:19 +00:00
Zhongxing Xu 88f07cd49c Refactor builtin function evaluation code into its own function.
llvm-svn: 81061
2009-09-05 05:00:57 +00:00
Daniel Dunbar dc7f7b7ac3 Add missing include.
llvm-svn: 81059
2009-09-05 00:48:32 +00:00
John McCall fcc33b074b Basic support for representing elaborated type specifiers
directly in the AST.  The current thinking is to create these
only in C++ mode for efficiency.  But for now, they're not being
created at all; patch to follow.

This will let us do things like verify that tags match during
template instantation, as well as signal that an elaborated type
specifier was used for clients that actually care.

Optimally, the TypeLoc hierarchy should be adjusted to carry tag
location information as well.

llvm-svn: 81057
2009-09-05 00:15:47 +00:00
Douglas Gregor 34ec2ef159 Improve the AST representation and semantic analysis for extern
templates. We now distinguish between an explicit instantiation
declaration and an explicit instantiation definition, and know not to
instantiate explicit instantiation declarations. Unfortunately, there
is some remaining confusion w.r.t. instantiation of out-of-line member
function definitions that causes trouble here.
 

llvm-svn: 81053
2009-09-04 22:48:11 +00:00
Mike Stump 35337557af Cleanup.
llvm-svn: 81024
2009-09-04 18:54:10 +00:00
Daniel Dunbar 2b5f6817e0 Tweak darwin::Link::AddLinkArgs.
llvm-svn: 81021
2009-09-04 18:35:41 +00:00
Daniel Dunbar 91dbfd6666 Implement darwin::Link::AddDarwinArch for ARM.
llvm-svn: 81020
2009-09-04 18:35:31 +00:00
Douglas Gregor bddb73fa1d If a destructor is referenced or a pseudo-destructor expression is
formed without a trailing '(', diagnose the error (these expressions
must be immediately called), emit a fix-it hint, and fix the code.

llvm-svn: 81015
2009-09-04 18:29:40 +00:00
Douglas Gregor ad8a336b40 Implement AST, semantics, and CodeGen for C++ pseudo-destructor
expressions, e.g.,

  p->~T()

when p is a pointer to a scalar type. 

We don't currently diagnose errors when pseudo-destructor expressions
are used in any way other than by forming a call.

llvm-svn: 81009
2009-09-04 17:36:40 +00:00
Steve Naroff ef9618b75f Implement accessors clang_getCursorKind(), clang_getCursorDecl().
Implement clang_getCursor() - wired up to Argiris's work.
Implement callbacks for CXCursor_ObjCProtocolRef.

llvm-svn: 81004
2009-09-04 15:44:05 +00:00
Douglas Gregor 43e75176ec Parse extern templates, pass that information all the way to Sema,
then drop it on the floor.

llvm-svn: 80989
2009-09-04 06:33:52 +00:00
Douglas Gregor f6a5411fd0 Actually initialize HasQualifier and HasExplicitTemplateArgumentList in the EmptyShell constructor for MemberExpr. Should clear up some valgrind failures in PCH reading
llvm-svn: 80984
2009-09-04 05:04:07 +00:00
John McCall 06f6fe8df7 Correctly handle elaborated template ids. Still not handled properly for friends.
llvm-svn: 80977
2009-09-04 01:14:41 +00:00
Fariborz Jahanian 37d065680b Patch to instantiate destructors used to destruct
base and data members when they are needed.

llvm-svn: 80967
2009-09-03 23:18:17 +00:00
Douglas Gregor 2b6ca46c6b Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.

llvm-svn: 80953
2009-09-03 21:38:09 +00:00