Commit Graph

8553 Commits

Author SHA1 Message Date
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
Steve Naroff e0064d2e95 Make sure ObjCInterfaceDecl's that are forward declared always contain a valid location.
llvm-svn: 81487
2009-09-11 00:12:01 +00:00
Anders Carlsson fd384d8065 Pass the GlobalDecl to getMangledName, fixes PR4890.
llvm-svn: 81486
2009-09-11 00:11:35 +00:00
Anders Carlsson 73fcc95f0f Pass GlobalDecls to GenerateCode and StartFunction.
llvm-svn: 81485
2009-09-11 00:07:24 +00:00
Anders Carlsson ecf9bf0158 GlobalDecl doesn't have an explicit constructor anymore.
llvm-svn: 81481
2009-09-10 23:43:36 +00:00
Anders Carlsson 38988d7ee0 Add stricter GlobalDecl constructors.
llvm-svn: 81480
2009-09-10 23:38:47 +00:00
Fariborz Jahanian 8d6298b272 Fix a regression where write-barrier was not being generated
for block pointer.

llvm-svn: 81479
2009-09-10 23:38:45 +00:00
Douglas Gregor 8ef65fbd49 Eliminate some "default"s in CheckICE.
llvm-svn: 81477
2009-09-10 23:31:45 +00:00
Anders Carlsson 78b5493994 Look for overloaded arrow operators in base classes.
llvm-svn: 81475
2009-09-10 23:18:36 +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
Daniel Dunbar e2cf8f7b53 Move X86 handling of -m[no-]soft-float and -m[no-]red-zone into AddX86TargetArgs.
llvm-svn: 81470
2009-09-10 22:59:57 +00:00
Daniel Dunbar f492c92761 Change getLLVMArchNameForARM to just get the suffix.
llvm-svn: 81469
2009-09-10 22:59:51 +00:00
Fariborz Jahanian c571f790fc Patch to collect conversion methods in base(s) and derived
class into a candidate set. 

llvm-svn: 81467
2009-09-10 22:26:16 +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
Anders Carlsson 04e1e22fe7 Don't check use of a member function declaration used if the member function is virtual and the member reference expression doesn't explicitly qualify it. Fixes PR4878.
llvm-svn: 81460
2009-09-10 20:48:14 +00:00
Douglas Gregor 7736e2ad98 static_cast, reinterpret_cast, and const_cast can all be used in C++
integral constant expressions (for conversions to integer types,
naturally). I don't *think* that const_casts will ever get to this
point, but I also can't convince myself that they won't... so I've
taken the safe route and allowed the ICE checking code to look at
const_cast.

llvm-svn: 81453
2009-09-10 17:44:23 +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
Fariborz Jahanian d1f1ff3978 Get the size of object to pass to objc_memmove_collectable()
from correct field of TypeInfo.

llvm-svn: 81446
2009-09-10 16:20:31 +00:00
Daniel Dunbar fb58b0aaa9 Add code to mangle the triple for LLVM on ARM.
- I think we should get rid of this distinction though, but I need to discuss with the interested parties.

llvm-svn: 81435
2009-09-10 06:49:20 +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 4fa0811e4c Don't pass -fno-builtin-str{cat,cpy} to clang-cc, I forget we don't support that yet. PR4941.
llvm-svn: 81430
2009-09-10 04:57:27 +00:00
Daniel Dunbar 0f5c542a86 ARM: Pass -mcpu to clang-cc based on -march= and -mcpu=.
llvm-svn: 81429
2009-09-10 04:57:17 +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
Anders Carlsson 10f2c10b83 Make the forwarding member of block byref structs be a pointer to the block byref struct itself.
llvm-svn: 81423
2009-09-10 01:32:12 +00:00
Daniel Dunbar 4eadb60652 Add a check that -static is not used with -dynamic or -mdynamic-no-pic.
llvm-svn: 81421
2009-09-10 01:21:12 +00:00
Daniel Dunbar 64198ef50f Factor out CheckPreprocessing options to share between Clang/CC1 tools.
Also, fix forwarding of -C/-CC to cc1.

llvm-svn: 81420
2009-09-10 01:21:05 +00:00
Douglas Gregor e61ef62cc2 When re-entering a template scope, we may be entering a class template
partial specialization rather than a subclass of TemplateDecl. Fixes a
crash in libstdc++ 4.2's <map>.

llvm-svn: 81407
2009-09-10 00:12:48 +00:00
Douglas Gregor 60e40bb301 Don't bother to perform any initialization for a variable declaration
of class type whose default constructor is trivial. Should un-break
testing on x86_64-pc-linux-gnu.

llvm-svn: 81405
2009-09-09 23:58:28 +00:00
Douglas Gregor 0fea62d0c7 For a C++ delete expression where the operand is of class type that
has a single conversion to pointer-to-object type, implicitly convert
to that pointer-to-object type (C++ [expr.delete]p1).

llvm-svn: 81401
2009-09-09 23:39:55 +00:00
Anders Carlsson 1ca52689e7 Use the right GlobalDecl type for destructors.
llvm-svn: 81398
2009-09-09 23:17:18 +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 3c7b9ca4bf Improve Darwin argument translation to match what the driver driver does.
llvm-svn: 81391
2009-09-09 22:33:15 +00:00
Daniel Dunbar 3b3191f23c Move Clang X86 cpu/feature argument translation into AddX86TargetArgs.
llvm-svn: 81390
2009-09-09 22:33:08 +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 1c28f1e17c Remove gratuitous use of c_str().
llvm-svn: 81388
2009-09-09 22:32:48 +00:00
Daniel Dunbar b617a9f3c7 Use Twine concatenation instead of llvm::format.
llvm-svn: 81387
2009-09-09 22:32:41 +00:00
Daniel Dunbar b4a3e43741 Simplify.
llvm-svn: 81386
2009-09-09 22:32:34 +00:00
Daniel Dunbar 5f620c1fac StringRefize ArgList construction of ArgStrings.
llvm-svn: 81385
2009-09-09 22:32:26 +00:00
Daniel Dunbar 277aa36d68 Suppress build warning.
llvm-svn: 81384
2009-09-09 22:32:15 +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
Ted Kremenek 84c6f0a1e6 Implement: <rdar://problem/7185647> [RegionStore] 'self' cannot be NULL upon entry to a method
Here we implement this as a precondition within GRExprEngine, even though it is
related to how BasicStoreManager and RegionStoreManager model 'self'
differently. Putting this as a high-level precondition is more general, which is
why it isn't in RegionStore.cpp.

llvm-svn: 81378
2009-09-09 20:36:12 +00:00
Daniel Dunbar 3571dd90cf Use AddDarwinArch for passing arch name to assembler.
llvm-svn: 81368
2009-09-09 18:36:27 +00:00
Daniel Dunbar e9ded43d1d Add DarwinTool base class for all Darwin tools, and move AddDarwin[Sub]Arch there.
llvm-svn: 81367
2009-09-09 18:36:20 +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 4a3999fe90 Reflow comments and some minor whitespace fixups.
llvm-svn: 81337
2009-09-09 13:00:44 +00:00
Douglas Gregor 7d98367f30 Fix a thinko
llvm-svn: 81317
2009-09-09 06:04:29 +00:00
Anders Carlsson 71d1d92d37 Make BuildByRefType take a ValueDecl instead of a QualType and an alignment.
llvm-svn: 81315
2009-09-09 02:51:03 +00:00
Douglas Gregor 822514fe39 Allow a declaration of an array to complete a prior, incomplete
declaration of that array in C++.

llvm-svn: 81309
2009-09-09 01:45:28 +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
Fariborz Jahanian 063c7720f4 More objc GC's API work for array of pointers declared
as __strong.

llvm-svn: 81283
2009-09-08 23:38:54 +00:00
Daniel Dunbar faabdc3b81 Change Darwin toolchain lookup to use llvm::Triple.
- -2+1 FIXMEs.

llvm-svn: 81282
2009-09-08 23:37:36 +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 b5c741a427 Delete trailing whitespace.
llvm-svn: 81278
2009-09-08 23:37:08 +00:00
Daniel Dunbar 7b57404dea Simplify.
llvm-svn: 81277
2009-09-08 23:37:02 +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
Daniel Dunbar f26a7ab377 Tweak & reflow comments, and delete trailing whitespace.
llvm-svn: 81275
2009-09-08 23:36:43 +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
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
Chris Lattner 0c79736553 Fix PR4922, where Sema would complete tentative definitions in nondeterminstic
order because it was doing so while iterating over a densemap.

There are still similar problems in other places, for example 
WeakUndeclaredIdentifiers is still written to the PCH file in a nondeterminstic
order, and we emit warnings about #pragma weak in nondeterminstic order.

llvm-svn: 81236
2009-09-08 18:19:27 +00:00
Chris Lattner e6eab983f4 reduce indentation.
llvm-svn: 81234
2009-09-08 18:10:11 +00:00
John McCall d8fe9af3a2 Support templateids in friend declarations. Fixes bug 4859.
llvm-svn: 81233
2009-09-08 17:47:29 +00:00
Daniel Dunbar c09988dda5 Remove FIXMEs for pedantically-gcc-bug-compatible behavior.
- We aren't going to fix these since they haven't caused problems in practice.

 - Similarly, don't forward -object to Darwin ld.

llvm-svn: 81224
2009-09-08 16:39:16 +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
Chris Lattner 870158eebf reject returning a block expr even when it has parens and casts in the way.
llvm-svn: 81176
2009-09-08 00:36:37 +00:00
Daniel Dunbar 49f0e80fdd Remove trailing whitespace.
llvm-svn: 81169
2009-09-07 23:07:56 +00:00
Anders Carlsson 5995a3e8fa BuildCXXConstructExpr now takes a MultiExprArg.
llvm-svn: 81160
2009-09-07 22:23:31 +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 635444bcea More <sstream> removal.
llvm-svn: 81150
2009-09-07 12:33:46 +00:00
Benjamin Kramer b178ab2155 Remove unnecessary #include <sstream>.
llvm-svn: 81147
2009-09-07 11:12:05 +00:00
Mike Stump e73d5ca9a8 Refine vcall offsets. Cleanups. WIP.
llvm-svn: 81143
2009-09-07 04:27:52 +00:00
Daniel Dunbar d027a92431 Use a SetVector for tracking some Obj-C metadata, to ensure deterministic
output.
 - Also, cleanup code to output inline asm references.

llvm-svn: 81139
2009-09-07 00:20:42 +00:00
Anders Carlsson faf1ced5ee Reapply 81096, now with a fix. Spot the bug:
for (unsigned i = numargs; i < NumArgs; ++i)
        Args[0] = 0;

;)

llvm-svn: 81123
2009-09-06 16:54:02 +00:00
Daniel Dunbar 94bcae46d5 Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash when
destroying the CXXConstructExpr.", this is causing test failures across the
board.

llvm-svn: 81100
2009-09-06 01:31:23 +00:00
Anders Carlsson 8284d7caa3 Initialize default CXXConstructExpr arguments to 0. Fixes a crash when destroying the CXXConstructExpr.
llvm-svn: 81096
2009-09-05 22:51:06 +00:00
Ted Kremenek b5850f9c80 Fix buffer overflow reported in PR 4903.
llvm-svn: 81092
2009-09-05 17:59:01 +00:00
Mike Stump b82db12b35 Refine overrides and thunks for virtual bases. Cleanups. WIP.
llvm-svn: 81080
2009-09-05 11:28:33 +00:00
Benjamin Kramer 26db6481c5 Replace some instances of std::string with StringRefs.
llvm-svn: 81079
2009-09-05 09:49:39 +00:00
Mike Stump c9eb1727db Cleanup.
llvm-svn: 81078
2009-09-05 09:24:43 +00:00
Mike Stump 69bbd6ce84 Cleanups.
llvm-svn: 81077
2009-09-05 09:10:58 +00:00
Mike Stump 6363021ab9 Cleanups.
llvm-svn: 81075
2009-09-05 08:47:24 +00:00
Mike Stump 3cdb051425 Cleanups.
llvm-svn: 81074
2009-09-05 08:45:02 +00:00
Mike Stump 5e3ac0249c Cleanups.
llvm-svn: 81073
2009-09-05 08:40:18 +00:00
Mike Stump ea8eea2c45 Cleanups.
llvm-svn: 81072
2009-09-05 08:37:03 +00:00
Mike Stump db14a73606 Cleanups.
llvm-svn: 81071
2009-09-05 08:07:32 +00:00
John McCall cc5e23ca8d Overhaul the mangler to use a visitor pattern, at least for types. We can safely
ignore non-canonical type classes, but apparently we need to know how to mangle
dependent names.

The missing cases are much more obvious now.

llvm-svn: 81070
2009-09-05 07:56:18 +00:00
Mike Stump 001ad31c9a Cleanups. WIP.
llvm-svn: 81069
2009-09-05 07:49:12 +00:00
Anders Carlsson 1b4ebfab2b Pass the ConstructLoc to BuildCXXConstructExpr.
llvm-svn: 81068
2009-09-05 07:40:38 +00:00
Mike Stump 453fe4285d Install thunks later to fixup overrides. Track space taken by vbase
offsets better for thunk refinements.  Cleanups.  WIP.

llvm-svn: 81067
2009-09-05 07:20:32 +00:00
Zhongxing Xu 1309a852d3 pass the correct predecessor node.
llvm-svn: 81066
2009-09-05 06:46:12 +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
Zhongxing Xu d7674a47f9 Do not call FlushReports() in GRBugReporter's dtor. We already call it in
ActionGRExprEngine().

llvm-svn: 81064
2009-09-05 06:06:49 +00:00
Anders Carlsson dc6d2c3cda Report errors for member functions correctly.
llvm-svn: 81063
2009-09-05 05:38:54 +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
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
Douglas Gregor d94105a1c2 Don't generate any code for an explicit call to a trivial destructor.
Now that parsing, semantic analysis, and (I think) code generation of
pseudo-destructor expressions and explicit destructor calls works,
update the example-dynarray.cpp test to destroy the objects it
allocates and update the test to actually compile + link.
The code seems correct, but the Clang-compiled version dies with a
malloc error. Time to debug!

llvm-svn: 81025
2009-09-04 19:04:08 +00:00
Daniel Dunbar 037f389f4d Merge libgcc spec changes for darwin::Link::ConstructJob.
llvm-svn: 81022
2009-09-04 18:35:47 +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
Daniel Dunbar 84e727fb72 Darwin: Pass -iphoneos-version-min to ld when building for ARM.
llvm-svn: 81019
2009-09-04 18:35:21 +00:00
Daniel Dunbar 5ed07fe794 Add -ccc-install-dir option for faking installation path.
llvm-svn: 81017
2009-09-04 18:35:03 +00:00
Daniel Dunbar f0a5b9b126 Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.
llvm-svn: 81016
2009-09-04 18:34:51 +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
Mike Stump 5a522353c3 Add overidding for methods for vtable building for the secondary
vtables.  Add thunk generation.  WIP.

llvm-svn: 81014
2009-09-04 18:27:16 +00:00
Daniel Dunbar 5095b293b7 Remove unused argument.
llvm-svn: 81010
2009-09-04 17:39:02 +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 2d2282e8f9 When searching for a default constructor or copy constructor, skip constructor templates
llvm-svn: 81002
2009-09-04 14:46:39 +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 119b0c7185 Introduce an egregious hack to fix PR4828.
The problem this change addresses is that we treat __is_pod and
__is_empty as keywords in C++, because they are built-in type traits
in GCC >= 4.3. However, GNU libstdc++ 4.2 (and possibly earlier
versions) define implementation-detail struct templates named __is_pod
and __is_empty. 

This commit solves the problem by recognizing

  struct __is_pod

and

  struct __is_empty

as special token sequences. When one of these token sequences is
encountered, the keyword (__is_pod or __is_empty) is implicitly
downgraded to an identifier so that parsing can continue. This is an
egregious hack, but it has the virtue of "just working" whether
someone is using libstdc++ 4.2 or not, without the need for special
flags.

llvm-svn: 80988
2009-09-04 05:53:02 +00:00
Zhongxing Xu bfb000f337 move the check into MarkNoReturnFunction.
llvm-svn: 80980
2009-09-04 02:17:35 +00:00
Zhongxing Xu 1748d8a43d Extract mark-no-return-function code into a function.
llvm-svn: 80979
2009-09-04 02:13:36 +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
Anders Carlsson 0e91275ab4 If the alignment of the chosen field in a union is greater than the alignment of the union, we need to use a packed LLVM struct. Fixes <rdar://problem/7184250>.
llvm-svn: 80964
2009-09-03 22:56:02 +00:00
Douglas Gregor f816bd70ce Implement tree transformations for DeclarationNames. Among other
things, this means that we can properly cope with member access
expressions such as 

  t->operator T()

where T is a template parameter (or other dependent type).

llvm-svn: 80957
2009-09-03 22:13:48 +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
Fariborz Jahanian 59a1cd4a06 Mark constructors used in initialization of base(s) and fields
as referecned with location where they are used. Still
need to look at destructor aspects of them.

llvm-svn: 80950
2009-09-03 21:32:41 +00:00
Fariborz Jahanian 3501bcec7d Issue diagnostics in variety of situations involving
reference/const data members when user has declared
the constructor. This necessitated some non-minor
refactoring.

llvm-svn: 80934
2009-09-03 19:36:46 +00:00
Daniel Dunbar fe07aecd37 Don't use '%ll', this doesn't workin on Win32.
llvm-svn: 80933
2009-09-03 19:23:49 +00:00
Steve Naroff c0683b909a Add ASTUnit::getOriginalSourceFileName() and use in clang_getTranslationUnitSpelling().
llvm-svn: 80932
2009-09-03 18:19:54 +00:00
Douglas Gregor c26e0f626b Improved handling for dependent, qualified member access expressions, e.g.,
t->Base::f

where t has a dependent type. We save the nested-name-specifier in the
CXXUnresolvedMemberExpr then, during instantiation, substitute into
the nested-name-specifier with the (transformed) object type of t, so
that we get name lookup into the type of the object expression.

Note that we do not yet retain information about name lookup into the
lexical scope of the member access expression, so several regression
tests are still disabled.

llvm-svn: 80925
2009-09-03 16:14:30 +00:00
Douglas Gregor b3286fe685 Save/load POSIXThreads flag for PCH
llvm-svn: 80916
2009-09-03 14:36:33 +00:00
Daniel Dunbar 3a0637b06b Revert "Visit function/method bodies and issue callback for parameters and local
variables.", this is breaking x86_64-apple-darwin10 and Linux tests.

llvm-svn: 80896
2009-09-03 05:59:50 +00:00
Daniel Dunbar 2d9c740cc5 Revert "Remove redundant local variable (use newly created instance data).", the
previous commit this depends on is breaking x86_64-apple-darwin10 and Linux tests.

llvm-svn: 80895
2009-09-03 05:59:35 +00:00
Daniel Dunbar a77eaeb1e6 Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

llvm-svn: 80883
2009-09-03 04:54:28 +00:00
Ted Kremenek 17a0296a09 Fix 80 column violations.
llvm-svn: 80873
2009-09-03 03:02:58 +00:00
David Chisnall 2c5bef2a74 Fixed bug introduced in r79900 where FreeBSD was turned into NetBSD, transposing the ABIs and breaking both platforms.
llvm-svn: 80870
2009-09-03 01:48:05 +00:00
Ted Kremenek b117fd9168 Fix regression introduced in r80786 and reported in PR 4867. We should use
'dyn_cast' instead of 'cast' as the denominator value could be UnknownVal (and
is not guaranteed to be a DefinedVal).

llvm-svn: 80869
2009-09-03 01:48:03 +00:00
Zhongxing Xu 677e6a2faf remove a debug output I introduced in the last commit.
llvm-svn: 80865
2009-09-03 01:31:59 +00:00
Mike Stump 850cc1c5a4 Update.
llvm-svn: 80864
2009-09-03 01:30:36 +00:00
Anders Carlsson 496335ea1a Add CastExpr::getCastKindName and use it in the StmtDumper.
llvm-svn: 80862
2009-09-03 00:59:21 +00:00
Steve Naroff 517ea46e2e Remove redundant local variable (use newly created instance data).
llvm-svn: 80861
2009-09-03 00:43:52 +00:00
Fariborz Jahanian f15d4b6050 This patch does the following.
1) Issue digsnostics in non-fragile ABI, when an expression
   evaluates to an interface type (except when it is used to
   access a non-fragile ivar).
2) Issue unsupported error in fragile ABI when an expression
   evaluates to an interface type (except when it is used to
   access a fragile ivar).

llvm-svn: 80860
2009-09-03 00:43:07 +00:00
Steve Naroff ef3cf2a576 Visit function/method bodies and issue callback for parameters and local variables.
Add clang_getTranslationUnitSpelling().

llvm-svn: 80859
2009-09-03 00:32:06 +00:00
Douglas Gregor 64792e021d Add a wicked little test-case that illustrates what we have to deal
with to properly support member access expressions in templates. This
test is XFAIL'd, because we get it completely wrong, but I've made the
minimal changes to the representation to at least avoid a crash.

llvm-svn: 80856
2009-09-02 23:58:38 +00:00
Douglas Gregor e5feb51624 Don't try to CodeGen using directives, from Anders Johnsen
llvm-svn: 80853
2009-09-02 23:49:23 +00:00
Fariborz Jahanian cc043a7154 Minor refactoring of my last patch.
llvm-svn: 80847
2009-09-02 23:11:48 +00:00
Fariborz Jahanian 3117e2b9d4 Referenced instatiated default constructors
must be defined. Fixed pr4853.

llvm-svn: 80846
2009-09-02 23:02:57 +00:00
Douglas Gregor b7bfe79412 Rewrite of our handling of name lookup in C++ member access expressions, e.g.,
x->Base::f

We no longer try to "enter" the context of the type that "x" points
to. Instead, we drag that object type through the parser and pass it
into the Sema routines that need to know how to perform lookup within
member access expressions.

We now implement most of the crazy name lookup rules in C++
[basic.lookup.classref] for non-templated code, including performing
lookup both in the context of the type referred to by the member
access and in the scope of the member access itself and then detecting
ambiguities when the two lookups collide (p1 and p4; p3 and p7 are
still TODO). This change also corrects our handling of name lookup
within template arguments of template-ids inside the
nested-name-specifier (p6; we used to look into the scope of the
object expression for them) and fixes PR4703.

I have disabled some tests that involve member access expressions
where the object expression has dependent type, because we don't yet
have the ability to describe dependent nested-name-specifiers starting
with an identifier.

llvm-svn: 80843
2009-09-02 22:59:36 +00:00
Anders Carlsson 35dca26835 Fix an assertion when initializing a union using a member initializer. (We weren't casting from the union type to the initializer type correctly).
llvm-svn: 80837
2009-09-02 21:14:47 +00:00
John McCall f8bd861ce9 Borrow a friend class's previous declaration's access specifier regardless of
whether the current context is dependent.

Thanks to Anders for pointing this out.

llvm-svn: 80828
2009-09-02 19:32:14 +00:00
Anders Carlsson 2e56cc6e6c Fix a codegen crash when a class template has a constructor that does member initialization of an anonymous union.
llvm-svn: 80826
2009-09-02 19:17:55 +00:00
Anders Carlsson 09a3774cd3 Packed unions should be packed. Fixes an assert Daniel reported.
llvm-svn: 80808
2009-09-02 17:51:33 +00:00
Fariborz Jahanian fc60ca8801 Allow null initialization of scalara data members
in constructors's initializer list. pr4854

llvm-svn: 80802
2009-09-02 17:10:17 +00:00
Zhongxing Xu 6e4232c79c Refactor the check for bad divide into a checker.
Also fix a checker context bug: the Dst set is not always empty initially. 
Because in GRExprEngine::CheckerVisit(), *CurrSet is used repeatedly. 
So we removed the Dst.empty() condition in ~CheckerContext() when deciding
whether to do autotransision.

llvm-svn: 80786
2009-09-02 13:26:26 +00:00
Douglas Gregor c707da6866 Document how we intepret C++ DR 382
llvm-svn: 80785
2009-09-02 13:12:51 +00:00
Douglas Gregor 12bbfe1d31 When parsing typename specifiers (with either the identifier or
simple-template-id form), check whether the scope specifier is
computable as a declaration context rather than checking whether it is
dependent, so that we properly cope with members of the current
instantiation. 

Improve testing for typename specifiers that terminate in a
simpe-template-id.

llvm-svn: 80783
2009-09-02 13:05:45 +00:00
Zhongxing Xu 79affb7b94 Refactor bad callee check into a Checker.
Now bad callee is checked as a PreVisit to the CallExpr.

llvm-svn: 80771
2009-09-02 08:10:35 +00:00
Zhongxing Xu 656b10a1fa Still use BadArg bugtype in the checker. This saves us implement registerInitialVisitors
in the BugReport. 

When all internal bug checking logic are moved to checkers, BuiltinBug will
not reference GRExprEngine, and FlushReports() will be not necessary, since
all bugs are emitted into the equivalent classes immediately.

For now just add a ctor with no arguments.

llvm-svn: 80770
2009-09-02 07:09:39 +00:00
Ted Kremenek cf768cd202 Replace uses of ImmutableSet in SymbolReaper with DenseSet. This was
motivated from Shark profiles that shows that 'markLive' was very
heavy when using --analyzer-store=region.  On my benchmark file, this
reduces the analysis time for --analyzer-store=region from 19.5s to
13.5s and for --analyzer-store=basic from 5.3s to 3.5s.  For the
benchmark file, this is a reduction of about 30% analysis time for
both analysis modes (a huge win).

llvm-svn: 80765
2009-09-02 06:03:18 +00:00
Ted Kremenek ad5a600a24 Implement: <rdar://problem/6337100> CWE-338: Use of cryptographically weak prng
Patch by Geoff Keating!

llvm-svn: 80752
2009-09-02 02:47:41 +00:00
John McCall e94dd7ccf5 When adding a friend class declaration to the lookup tables, use the access specifier
of any previous declaration in case we replace it in a class's declaration table.
Fixes bug 4858.  This sort of thing makes me reconsider putting friend declarations in
declaration lists.

llvm-svn: 80750
2009-09-02 02:15:17 +00:00
John McCall e8dbaef730 Fix a little crasher in friend decls. Thanks again to Eli for finding this.
llvm-svn: 80748
2009-09-02 01:07:03 +00:00
Mike Stump 3f707e9f14 Add mangling for covariant thunks.
llvm-svn: 80747
2009-09-02 00:56:18 +00:00
John McCall 2dc078f24e Ensure that the tag decls of friend decls aren't added to the friending class's
decl list, and remove some workarounds that were due to this.  Thanks to Eli for
pointing this out and providing the test case.

llvm-svn: 80745
2009-09-02 00:55:30 +00:00
Mike Stump a119813218 Shorten name.
llvm-svn: 80744
2009-09-02 00:28:47 +00:00
Mike Stump 9cc7d30435 Add mangling for thunks.
llvm-svn: 80743
2009-09-02 00:25:38 +00:00
Fariborz Jahanian 086ac11606 It is illegal to derefrercne to an interface in
objc's non-fragile ABI.

llvm-svn: 80739
2009-09-02 00:00:05 +00:00
Mike Stump 2348e62498 More overriding base work and some cleanups. WIP.
llvm-svn: 80737
2009-09-01 23:22:44 +00:00
Fariborz Jahanian 5083e2623b After a conversation with Doug. I added a fix me to
where we build the constructor's initializer list.

llvm-svn: 80735
2009-09-01 23:08:16 +00:00
Mike Stump 40dc64bcfc Split out overriding. WIP.
llvm-svn: 80732
2009-09-01 22:20:28 +00:00
Anders Carlsson c82555fb85 Handle member expressions that return references correctly.
llvm-svn: 80723
2009-09-01 21:18:52 +00:00
Anders Carlsson 783ab50b33 Assert that we don't have any virtual bases. We can emit dtors for polymorphics classes just fune.
llvm-svn: 80722
2009-09-01 21:12:16 +00:00
Douglas Gregor a3a3f6fecd In CXXBaseOrMemberInitializer, don't confuse CtorTocall with
AnonUnionMember. Fixes PR4826.

llvm-svn: 80721
2009-09-01 21:04:42 +00:00
Anders Carlsson f1ae6d45dd Use the correct cast kinds for bit casts and function to pointer decay. Fixes PR4827.
llvm-svn: 80720
2009-09-01 20:52:42 +00:00
Anders Carlsson 6904f644e7 Add a CK_FunctionToPointerDecay cast kind.
llvm-svn: 80719
2009-09-01 20:37:18 +00:00
Anders Carlsson 6b8b4b459d We can generate constructors/destructors with base classes and non-trivial fields just fine now.
llvm-svn: 80701
2009-09-01 18:33:46 +00:00
Douglas Gregor 2ffd96549d Implement proper substitution for OverloadedFunctionDecls, but substituting each of the functions in the overload set
llvm-svn: 80692
2009-09-01 17:53:10 +00:00
Douglas Gregor d51896311d Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons
llvm-svn: 80690
2009-09-01 17:22:34 +00:00
Fariborz Jahanian 1a50477385 Fixed a property getter ir-gen crash.
llvm-svn: 80681
2009-09-01 17:02:21 +00:00
Douglas Gregor 32e2c8472e Fix a crasher involving template instantiation of non-dependent
expressions making use of an overloaded operator. Thanks for the test
case, Anders!

llvm-svn: 80679
2009-09-01 16:58:52 +00:00
Daniel Dunbar 6cdf83c192 Add driver support for -emit-ast and AST compilation steps.
- <rdar://problem/7185031> Add 'clang' option '-emit-ast'

llvm-svn: 80678
2009-09-01 16:57:46 +00:00
Anders Carlsson bcec05c9fd Don't assume that a base is always a RecordType, it can also be a TemplateSpecializationType. Also, make sure to get the instantiated union member.
llvm-svn: 80662
2009-09-01 06:22:14 +00:00
Anders Carlsson 62215c4fb5 Add pretty stack traces when instantiating functions and static data members.
llvm-svn: 80661
2009-09-01 05:12:24 +00:00
Anders Carlsson 17dc7e2007 Handle member initializers that point to fields in anonymous structs.
llvm-svn: 80659
2009-09-01 04:31:02 +00:00
Anders Carlsson 5da848427a Don't assert when instantiating member references to fields in anonymous structs.
llvm-svn: 80657
2009-09-01 04:26:58 +00:00
Eli Friedman 1c277d0fe8 PR4836, part 2: CodeGen for __builtin_isnan.
llvm-svn: 80655
2009-09-01 04:19:44 +00:00
Douglas Gregor 84f14dd674 Preliminary AST representation and semantic analysis for
explicitly-specified template argument lists in member reference
expressions, e.g.,

  x->f<int>()

llvm-svn: 80646
2009-09-01 00:37:14 +00:00
Ted Kremenek 3aff920676 Sentence-case bug category.
llvm-svn: 80644
2009-09-01 00:17:12 +00:00
Douglas Gregor f4b34ba326 Remember to write the qualifier of a MemberExpr to the PCH file when we get to C++ PCH
llvm-svn: 80643
2009-08-31 23:44:04 +00:00
Douglas Gregor f405d7e6f1 Eliminate CXXAdornedMemberExpr entirely. Instead, optionally allocate
space within the MemberExpr for the nested-name-specifier and its
source range. We'll do the same thing with explicitly-specified
template arguments, assuming I don't flip-flop again.

llvm-svn: 80642
2009-08-31 23:41:50 +00:00
John McCall 759e32bdc6 Fix bug 4784 and allow friend declarations to properly extend
existing declaration chains.

llvm-svn: 80636
2009-08-31 22:39:49 +00:00
Devang Patel 124095bb18 Rename DIBlock as DILexicalBlock.
llvm-svn: 80634
2009-08-31 22:00:32 +00:00
Douglas Gregor 96ee789d33 Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we will
also be adding explicit template arguments as an additional
"adornment". No functionality change.

llvm-svn: 80628
2009-08-31 21:41:48 +00:00
Douglas Gregor fbc1823451 Add parsing for references to member function templates with explicit
template argument lists, e.g., x.f<int>().

Semantic analysis will be a separate commit.

llvm-svn: 80624
2009-08-31 21:16:32 +00:00
Eli Friedman 7e4faaccda PR4836, part 1: add Sema support for __builtin_isnan and friends; they
are apparently used by Solaris libc despite the fact that clang claims 
to be compatible with gcc 4.2, which doesn't support them.

llvm-svn: 80610
2009-08-31 20:06:00 +00:00
Douglas Gregor f14b46f9a8 Implement template instantiation for member operator access.
llvm-svn: 80609
2009-08-31 20:00:26 +00:00
Douglas Gregor 522fbc4969 Support explicit C++ member operator syntax, from James Porter!
llvm-svn: 80608
2009-08-31 19:52:13 +00:00
Fariborz Jahanian 879d726608 Re-implemented generation of objc_memmove_collectable
API for copying GC'able aggregates (Next runtime only).

llvm-svn: 80607
2009-08-31 19:33:16 +00:00
Daniel Dunbar 6733a7ec15 Fix a -Asserts warning.
llvm-svn: 80606
2009-08-31 19:16:38 +00:00
David Chisnall 5778fce141 Updated GNU runtime non-fragile ABI.
Added -fconstant-string-class= option.
Added __has_feature() test for non-fragile ABI.

llvm-svn: 80591
2009-08-31 16:41:57 +00:00
Anders Carlsson b533df02b5 More missing member goodness.
llvm-svn: 80491
2009-08-30 07:09:50 +00:00
Anders Carlsson 0d2a51b61f Improve missing error messages as suggested by Doug.
llvm-svn: 80489
2009-08-30 06:49:43 +00:00
Anders Carlsson 5167a4644d Use DiagnoseMissingMember for UsingDecls.
llvm-svn: 80470
2009-08-30 00:58:45 +00:00
Anders Carlsson 896c230a19 Improve diagnostics for missing members. This renames the err_typecheck_no_member to err_typecheck_no_member_deprecated. The idea is that err_typecheck_no_member_deprecated should be phased out and any call sites that reference it should call DiagnoseMissingMember instead.
llvm-svn: 80469
2009-08-30 00:54:35 +00:00
Eli Friedman 744a249493 Unbreak tests. I'll look into why this is necessary later.
llvm-svn: 80468
2009-08-30 00:53:54 +00:00
Argyrios Kyrtzidis 321995b5e5 Fix the start source location for type-specs like long, short, etc.
llvm-svn: 80448
2009-08-29 22:39:34 +00:00
Eli Friedman 15e05261d4 Make instantiating initializers for classes with a dependent base type
work correctly.

The change in lib/AST/DeclCXX.cpp is mostly a large reindentation; I 
couldn't figure out a good way to avoid it.

llvm-svn: 80446
2009-08-29 22:22:07 +00:00
Eli Friedman 033e8d4ae6 Make IRGen for initializing a member reference work correctly.
llvm-svn: 80439
2009-08-29 20:58:20 +00:00
Anders Carlsson adf36b2379 Add a workaround for decls that come from friend decls pointing to undeclared classes.
llvm-svn: 80438
2009-08-29 20:47:47 +00:00
Anders Carlsson 6df9e076ea In DeclPrinter, assert when asked to print AS_None.
llvm-svn: 80437
2009-08-29 20:36:12 +00:00
Fariborz Jahanian 0a484d007b Patch to ir-gen user-defined conversions used in expressions
[12.3.2-p3]

llvm-svn: 80436
2009-08-29 20:33:32 +00:00
Anders Carlsson 7b194b780d Set the access specifier for using decls.
llvm-svn: 80435
2009-08-29 19:54:19 +00:00
Anders Carlsson 4bb87ce33e Improve instantiation of UnresolvedUsingDecls.
llvm-svn: 80434
2009-08-29 19:37:28 +00:00
Fariborz Jahanian 3df8767869 Patch for code gen. for c-style cast which ends in
using class's conversion functions [12.3.2-p2]

llvm-svn: 80433
2009-08-29 19:15:16 +00:00
Eli Friedman 9ab0319b2b Get rid of mostly-unused, buggy method.
llvm-svn: 80432
2009-08-29 19:09:59 +00:00
John McCall 5966088621 Fix the breakage by handling indirect instantiations. This would be much
improved if there were a consistent name for getInstantiatedFromMemberX()
across all classes.  Cheap refactor if someone wants to do it, but let's get the
buildbots happy first.

llvm-svn: 80425
2009-08-29 08:11:13 +00:00
Anders Carlsson 705539441b Instantiate member and base initializers. Patch by Anders Johnsen! (tweaked slightly by me)
llvm-svn: 80422
2009-08-29 05:16:22 +00:00
Eli Friedman 2624be4fd4 Fix a couple issues with parsing invalid nested-name-specifiers.
llvm-svn: 80421
2009-08-29 04:08:08 +00:00
John McCall 75c03bbb0c For consistency, just make friend declarations AS_public.
llvm-svn: 80420
2009-08-29 03:50:18 +00:00
John McCall 970d530a84 Ensure code generation for friend declarations in class templates.
llvm-svn: 80418
2009-08-29 03:16:09 +00:00
Zhongxing Xu 6fd66d4588 Refactor undefined argument checking into a Checker.
llvm-svn: 80417
2009-08-29 02:11:01 +00:00
Anders Carlsson 1e172e068f Store the SourceLocation of right parentheses in member initializers. Patch by Anders Johnsen!
llvm-svn: 80416
2009-08-29 01:31:33 +00:00
Anders Carlsson 6e1ca8315c Don't assert that friend declarations must have access specifiers for now.
llvm-svn: 80415
2009-08-29 01:13:02 +00:00
Anders Carlsson 938b10079a CreateDeclRefExprs that point to UnresolvedUsingDecls.
llvm-svn: 80413
2009-08-29 01:06:32 +00:00
Anders Carlsson a884e67485 Add another check for UnresolvedUsingDecl.
llvm-svn: 80412
2009-08-29 00:56:38 +00:00
Mike Stump beefdc8948 iGenerate vcalls as we build up the methods. WIP.
llvm-svn: 80405
2009-08-28 23:22:54 +00:00
Douglas Gregor 90820ee62a Make sure we actually found a redeclaration before complaining about attributes added to a redeclaration in C++
llvm-svn: 80403
2009-08-28 22:54:55 +00:00
Anders Carlsson 601d6e4c7b Add printing of access specifiers to DeclPrinter. The formatting is pretty bad but it works :)
llvm-svn: 80402
2009-08-28 22:39:52 +00:00
Douglas Gregor c37709b3c5 Remove #if 0'd code that is clearly not needed
llvm-svn: 80399
2009-08-28 22:06:43 +00:00
Fariborz Jahanian 2fee79a9a1 path to ir-gen 12.3.1 Conversion by constructor
llvm-svn: 80398
2009-08-28 22:04:50 +00:00
Douglas Gregor f3db003358 Don't crash when instantiating templates containing anonymous structs/unions
llvm-svn: 80397
2009-08-28 22:03:51 +00:00
Douglas Gregor 11395b66c6 Test instantiation of static data members that live within nested
member templates.

llvm-svn: 80396
2009-08-28 21:41:19 +00:00
Douglas Gregor d99bb43068 Fix and test template instantiation for nested member templates.
llvm-svn: 80394
2009-08-28 21:09:48 +00:00
Douglas Gregor 39cacdb04b Tighten up the conversion from a single-level template argument list
to a multi-level template argument list by making it explicit. The
forced auditing of callers found a bug in the instantiation of member
classes inside member templates.

I *love* static type systems.

llvm-svn: 80391
2009-08-28 20:50:45 +00:00
Douglas Gregor 6533292684 Remove the conversion from a multi-level template argument list back to a single template argument list. We no longer need this crutch
llvm-svn: 80390
2009-08-28 20:33:09 +00:00
Douglas Gregor 01afeeff1d Implement template instantiation for member class templates.
When performing template instantiation of the definitions of member
templates (or members thereof),  we build a data structure containing
the template arguments from each "level" of template
instantiation. During template instantiation, we substitute all levels
of template arguments simultaneously. 

llvm-svn: 80389
2009-08-28 20:31:08 +00:00
Ted Kremenek 52ac2b5735 retain/release checker: [CIContext createCGImage...] and friends returned CF
objects that are not automatically garbage collected. This fixes
<rdar://problem/7174400>.

llvm-svn: 80387
2009-08-28 19:52:12 +00:00
Anders Carlsson df5a1c8b5d Improve support for using decls in the decl printer.
llvm-svn: 80386
2009-08-28 19:16:39 +00:00
Anders Carlsson 01ff6d7094 Check for UnresolvedUsingDecl when determining if a declaration is a redeclaration or not.
llvm-svn: 80383
2009-08-28 17:57:07 +00:00
Fariborz Jahanian b1771e4e74 patch to prevent crash in hopelessly incorrect
method definition with labels.

llvm-svn: 80381
2009-08-28 17:52:37 +00:00
Douglas Gregor a654dd8ae8 Collect multiple levels of template arguments into a new type,
MultiLevelTemplateArgumentList. This is a baby step toward
instantiating member templates; no intended functionality change yet.

llvm-svn: 80380
2009-08-28 17:37:35 +00:00
Anders Carlsson d20e795a5b Fix this for real.
llvm-svn: 80377
2009-08-28 16:57:08 +00:00
Anders Carlsson f2bc7c386e Allow explicit ctors for casts.
llvm-svn: 80374
2009-08-28 16:22:20 +00:00
Anders Carlsson 759b78951e When doing overload resolution, expressions that are value dependent but not type dependent and of integral type should not be treated as null pointer constants.
llvm-svn: 80369
2009-08-28 15:55:56 +00:00
Anders Carlsson 228eea36a3 Pass InOverloadResolution all the way down to IsPointerConversion.
llvm-svn: 80368
2009-08-28 15:33:32 +00:00
Anders Carlsson 4bd7875b9c Instantiate unresolved using declarations.
llvm-svn: 80366
2009-08-28 15:18:15 +00:00
Fariborz Jahanian 8b899e4247 ir-gen related patch for type conversion
with class type conversion methods. WIP.

llvm-svn: 80365
2009-08-28 15:11:24 +00:00
John McCall aa74a0c3b5 Omnibus friend decl refactoring. Instead of cloning AST classes for friend
declarations of same, introduce a single AST class and add appropriate bits
(encoded in the namespace) for whether a decl is "real" or not.  Much hackery
about previously-declared / not-previously-declared, but it's essentially
mandated by the standard that friends alter lookup, and this is at least
fairly non-intrusive.

Refactor the Sema methods specific to friends for cleaner flow and less nesting.

Incidentally solve a few bugs, but I remain confident that we can put them back.

llvm-svn: 80353
2009-08-28 07:59:38 +00:00
Anders Carlsson f038fc2c12 Create UnresolvedUsingDecls.
llvm-svn: 80346
2009-08-28 05:49:21 +00:00
Anders Carlsson 696a3f199b Factor declaration building out to Sema::BuildUsingDeclaration.
llvm-svn: 80337
2009-08-28 05:40:36 +00:00
Anders Carlsson 8305c1fa97 Check in UnresolvedUsingDecl.
llvm-svn: 80336
2009-08-28 05:30:28 +00:00
Ted Kremenek 198a8c5f95 Use SymbolicRegion instead of CodeTextRegion for symbolic function
pointers.  Most logic cares first about whether or not a region is
symbolic, and second if represents code.  This should fix a series of
silent corner case bugs (as well as simplify a bunch of code).

llvm-svn: 80335
2009-08-28 04:49:15 +00:00