Commit Graph

19100 Commits

Author SHA1 Message Date
Anders Carlsson e5a94105eb Move the Info vector into the RTTIBuilder struct. No functionality change.
llvm-svn: 91583
2009-12-17 05:06:03 +00:00
Anders Carlsson 539e584c3c Attempt to fix rtti-layout.cpp on Linux.
llvm-svn: 91581
2009-12-17 04:57:25 +00:00
Anders Carlsson dc9b9cf7b1 Add a (currently failing) RTTI layout test.
llvm-svn: 91580
2009-12-17 04:41:05 +00:00
Ted Kremenek 85bcc986d6 Add failing test case for C++ static analysis.
llvm-svn: 91578
2009-12-17 01:44:13 +00:00
Ted Kremenek 2e2b258158 Fix check in GRExprEngine for the 'main' function to handle NULL IdentifierInfo*'s.
llvm-svn: 91577
2009-12-17 01:20:43 +00:00
Fariborz Jahanian 057a17e4c5 Diagnose duplicate declaration of a property. Fixes
PR5809

llvm-svn: 91575
2009-12-17 00:49:09 +00:00
Eli Friedman 7f4933f6c7 Fix for PR5801: codegen memcpy, memmove, memset directly to LLVM intrinsics.
llvm-svn: 91573
2009-12-17 00:14:28 +00:00
Ted Kremenek d970acb60f Completely remove ObjCObjectRegion (tests pass this time).
llvm-svn: 91572
2009-12-16 23:53:37 +00:00
Fariborz Jahanian 01cbe441b3 Allow pointer convesion of an objective-c pointer to
'void *' to mimic gcc's behavior. (fixes radar 7477351).

llvm-svn: 91570
2009-12-16 23:13:33 +00:00
Eli Friedman 8d0da8042b Fix test.
llvm-svn: 91566
2009-12-16 20:47:15 +00:00
Eli Friedman 6a8dc922b3 Make sure C-specific enum warning doesn't trigger in C++.
llvm-svn: 91563
2009-12-16 20:30:08 +00:00
Daniel Dunbar 15cef0ed42 Fix -fdollars-in-identifiers Clang translation.
llvm-svn: 91562
2009-12-16 20:10:18 +00:00
Eli Friedman 5dd02a0f65 Correctly calcluate abstract-ness in the case where an implicitly declared
method overrides a pure virtual method.

llvm-svn: 91558
2009-12-16 20:00:27 +00:00
Ted Kremenek 3ab9e4cf87 Temporarily revert 91553.
llvm-svn: 91557
2009-12-16 19:46:44 +00:00
Ted Kremenek 023bceaf1b Remove use of ObjCObjectRegion from BasicStoreManager.
llvm-svn: 91553
2009-12-16 19:42:23 +00:00
Douglas Gregor 8cdc2e0590 Fix test case to unbreak testing
llvm-svn: 91551
2009-12-16 19:18:40 +00:00
Douglas Gregor 4f4b186215 When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.

llvm-svn: 91548
2009-12-16 18:50:27 +00:00
Ted Kremenek 22a8a4bfb9 Compute the right extension for preprocessed Objective-C++ files.
llvm-svn: 91547
2009-12-16 18:32:41 +00:00
Fariborz Jahanian 00857fc376 Diagnose property of reference type as unsupported
instead of crashing for now. 

llvm-svn: 91546
2009-12-16 18:03:30 +00:00
Anders Carlsson d681a29ac0 Baby steps towards fixing PR5589. If a class needs a vtable pointer, add one.
llvm-svn: 91545
2009-12-16 17:27:20 +00:00
Nuno Lopes 13c88c7269 implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.
feel free to chage the name to this lengthy argument

llvm-svn: 91543
2009-12-16 16:59:22 +00:00
Douglas Gregor 59ae3c8542 In Sema::CheckInitializerTypes, replace a use of CheckReferenceInit with an InitializationSequence
llvm-svn: 91542
2009-12-16 16:54:16 +00:00
Douglas Gregor 4044489d69 Update C++ status page to reflect reality
llvm-svn: 91541
2009-12-16 16:23:48 +00:00
Nuno Lopes 2af2af219f fix PR5689: add support for 'o' and 'V' asm input operands
llvm-svn: 91540
2009-12-16 14:28:21 +00:00
Nuno Lopes fdb8137a3e fix build
llvm-svn: 91539
2009-12-16 14:20:08 +00:00
John McCall 5750077300 Shift things around so that it's easier to recover from a missing
function in a C++ call using an arbitrary call-expression type.
Actually exploit this to fix the recovery implemented earlier.

The diagnostic is still iffy, though.

llvm-svn: 91538
2009-12-16 12:17:52 +00:00
Daniel Dunbar 282c9b9cc1 Fix pretty stack traces.
llvm-svn: 91537
2009-12-16 11:47:38 +00:00
Zhongxing Xu 6df9f54d6d Add a new kind of region: CXXObjectRegion. Currently it has only one
attribute: the object type. 
Add initial support for visiting CXXThisExpr.
Fix a bunch of 80-col violations.

llvm-svn: 91535
2009-12-16 11:27:52 +00:00
John McCall d681c3959f Introduce a centralized routine in Sema for diagnosing failed lookups (when
used as expressions).  In dependent contexts, try to recover by doing a lookup
in previously-dependent base classes.  We get better diagnostics out, but    
unfortunately the recovery fails:  we need to turn it into a method call  
expression, not a bare call expression.  Thus this is still a WIP.

llvm-svn: 91525
2009-12-16 08:11:27 +00:00
Anders Carlsson 07863b8b6e Use GetAddrOfRTTI everywhere and remove GenerateRTTI and GenerateRTTIRef. With this change, we can now compile and link TableGen.
llvm-svn: 91520
2009-12-16 07:05:41 +00:00
Anders Carlsson 18ada9856f Handle ImplicitValueInitExpr in AggExprEmitter.
llvm-svn: 91519
2009-12-16 06:57:54 +00:00
Zhongxing Xu 82a7beb2e0 remove dead code.
llvm-svn: 91517
2009-12-16 06:39:03 +00:00
Douglas Gregor 723796af7a Eliminate Sema::CheckValueInitialization; its callers now use
InitializationSequence to perform the actual initialization.

Also, introduced the notion of a tree of initialized entities, so that
we can know where an initialization began when dealing with nested
initializations (as occur when performing list initialization). This
will, eventually, be useful for producing better diagnostics when list
initialization fails, because we can show the path from the top-level
object being initialized down to the actual subobject where
initialization failed.

llvm-svn: 91516
2009-12-16 06:35:08 +00:00
Eli Friedman 53b3cde60f Add abort() as a builtin. This has two effects: one, we warn for incorrect
declarations of abort(), and two, we mark it noreturn.  Missing the latter
shows up in one of the "embarassing" tests (from the thread on llvmdev
"detailed comparison of generated code size for LLVM and other compilers").

llvm-svn: 91515
2009-12-16 06:28:21 +00:00
Anders Carlsson ce5b95c05a More FullExpr work.
llvm-svn: 91514
2009-12-16 06:21:35 +00:00
Anders Carlsson a5ca598ce6 More work on the FullExpr class.
llvm-svn: 91513
2009-12-16 06:10:22 +00:00
Ted Kremenek 9bcc264494 Teach RetainSummaryManager::getSummary(FunctionDecl* FD) that 'FD->getIdentifier()' will not always return a non-null IdentifierInfo*.
llvm-svn: 91512
2009-12-16 06:06:43 +00:00
Ted Kremenek 2d251557ef Teach OSAtomicChecker that a FunctionDecl's name isn't always a simple IdentifierInfo*.
llvm-svn: 91511
2009-12-16 06:03:24 +00:00
Ted Kremenek 85763180e7 Teach NoReturnFunctionChecker that FunctionDecl::getIdentifier() is not guaranteed to return a non-null IdentifierInfo*.
llvm-svn: 91510
2009-12-16 05:58:28 +00:00
Ted Kremenek 73aad9af2d Teach CheckerVisitor about CXXOperatorCallExpr.
llvm-svn: 91509
2009-12-16 05:52:19 +00:00
Ted Kremenek 0de851a4f2 Teach CFRecStmtDeclVisitor about CXXMethodDecl.
llvm-svn: 91508
2009-12-16 05:50:26 +00:00
Anders Carlsson b7e93e268f Mangle CXXOperatorCallExprs, fixes PR5796.
llvm-svn: 91507
2009-12-16 05:48:46 +00:00
Zhongxing Xu 686b8458f4 Expose C++ methods to GRExprEngine.
llvm-svn: 91506
2009-12-16 05:29:59 +00:00
Ted Kremenek dca6816d6a Add logic for computing preprocessor file extensions for C++ files.
llvm-svn: 91505
2009-12-16 05:02:47 +00:00
Douglas Gregor 2610ea4da9 Make GRSubEngine.h standalone
llvm-svn: 91504
2009-12-16 03:49:50 +00:00
Douglas Gregor 7c3bbdfd28 Fix semantic diagnostics that embed English works, from Nicola Gigante!
llvm-svn: 91503
2009-12-16 03:45:30 +00:00
Mike Stump 64a03454c6 Refine a little. WIP.
llvm-svn: 91502
2009-12-16 03:25:12 +00:00
Ted Kremenek 4cad5fc035 Add (initial?) static analyzer support for handling C++ references.
This change was a lot bigger than I originally anticipated; among
other things it requires us storing more information in the CFG to
record what block-level expressions need to be evaluated as lvalues.

The big change is that CFGBlocks no longer contain Stmt*'s by
CFGElements.  Currently CFGElements just wrap Stmt*, but they also
store a bit indicating whether the block-level expression should be
evalauted as an lvalue.  DeclStmts involving the initialization of a
reference require us treating the initialization expression as an
lvalue, even though that information isn't recorded in the AST.
Conceptually this change isn't that complicated, but it required
bubbling up the data through the CFGBuilder, to GRCoreEngine, and
eventually to GRExprEngine.

The addition of CFGElement is also useful for when we want to handle
more control-flow constructs or other data we want to keep in the CFG
that isn't represented well with just a block of statements.

In GRExprEngine, this patch introduces logic for evaluating the
lvalues of references, which currently retrieves the internal "pointer
value" that the reference represents.  EvalLoad does a two stage load
to catch null dereferences involving an invalid reference (although
this could possibly be caught earlier during the initialization of a
reference).

Symbols are currently symbolicated using the reference type, instead
of a pointer type, and special handling is required creating
ElementRegions that layer on SymbolicRegions (see the changes to
RegionStoreManager).

Along the way, the DeadStoresChecker also silences warnings involving
dead stores to references.  This was the original change I introduced
(which I wrote test cases for) that I realized caused GRExprEngine to
crash.

llvm-svn: 91501
2009-12-16 03:18:58 +00:00
Mike Stump 11ba8d989c Add some documentation for recent checkins. WIP.
llvm-svn: 91500
2009-12-16 03:18:14 +00:00
Mike Stump b85ffb689e Add an addition check for undefined behavior for when we hit a
__builtin_unreachable.  WIP.

llvm-svn: 91499
2009-12-16 03:07:12 +00:00
Mike Stump 3f6f9febad Implement additional undefined checks for additional loads and stores. WIP.
llvm-svn: 91498
2009-12-16 02:57:00 +00:00
Anders Carlsson afb2dade0c Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action::FullExpr to Action::MakeFullExpr to avoid name clashes.
llvm-svn: 91494
2009-12-16 02:09:40 +00:00
John McCall 0db42252f7 Successive anonymous namespaces name the same scope. I misinterpreted the
standard the last time.  Fixes PR5766.

llvm-svn: 91493
2009-12-16 02:06:49 +00:00
Douglas Gregor 85dabae6ad Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization. 

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.

llvm-svn: 91492
2009-12-16 01:38:02 +00:00
Fariborz Jahanian e8d28904b0 Diagnose attempting to assign to a sub-structure of an ivar
using objective-c property. (fixes radar 7449707)

llvm-svn: 91474
2009-12-15 23:59:41 +00:00
Ted Kremenek 9158fb748c Remove ValueManager::getRegionValueSymbolValOrUnknown(). It was just extra veneer on top of getRegionValueSymbolVal().
llvm-svn: 91471
2009-12-15 23:23:27 +00:00
John McCall e9f92a017c Link up member-class redeclarations during template instantiation.
This test courtesy of LLVM.

llvm-svn: 91462
2009-12-15 22:29:06 +00:00
Daniel Dunbar 5618e98f33 Update tests to use %clang instead of 'clang', and forcibly disable use of '
clang ' or ' clang -cc1 ' or ' clang-cc ' in test lines (by substituting them to
garbage).

llvm-svn: 91460
2009-12-15 22:01:24 +00:00
Fariborz Jahanian 2b9fc83db5 Fixes a code gen bug related to accessing a now
non-existing 'isa' field of a non-existing struct type
all related to legacy type definition for 'id' which we have
dropped in clang in favor of a built-in type.
(fixes radar 7470820).

llvm-svn: 91455
2009-12-15 21:34:52 +00:00
Anders Carlsson 6e997b2993 ShouldDestroyTemporaries? I don't think so.
llvm-svn: 91450
2009-12-15 20:51:39 +00:00
Chris Lattner 1316249ad2 enable reuse of MacroArgs objects. This is a small (2.5%) win
on PR5610 (2.185 -> 2.130s).  The big issue is that this is making
insanely huge macro argument lists with over a million tokens in it.
The reason that mallco and free are so expensive is that we are 
actually going to the kernel to get it, and switching to a bump 
pointer allocator won't change this in an interesting way.

llvm-svn: 91449
2009-12-15 20:48:12 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Anders Carlsson 714d0969b3 If a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates.
llvm-svn: 91439
2009-12-15 19:16:31 +00:00
Nate Begeman ac8183a830 Support OpenCL 1.1 odd-length vector component accessors.
For hi/odd of an odd-length vector, the last component is undefined.  Since
we shuffle with an undef vector, no CodeGen needs to change to support this.

llvm-svn: 91437
2009-12-15 18:13:04 +00:00
Mike Stump 4ec1237106 Add testcase for recent checkin.
Patch by Chip Davis.

llvm-svn: 91436
2009-12-15 18:02:45 +00:00
Fariborz Jahanian d1a2d5719a Implement conditional block invocation rewrite
and some clean up and a block rewriter test.

llvm-svn: 91435
2009-12-15 17:30:20 +00:00
Douglas Gregor 906db8a546 Fix some diagnostic-related FIXMEs, from Nicola Gigante
llvm-svn: 91433
2009-12-15 16:44:32 +00:00
Douglas Gregor dce7d0e8d9 Elaborated types are specifier types, based on a patch from Cornelius
llvm-svn: 91431
2009-12-15 16:28:32 +00:00
Zhongxing Xu 765f3e4f35 Add comments.
llvm-svn: 91430
2009-12-15 09:32:42 +00:00
Zhongxing Xu 950978a44b Remove displayProgress parameter.
llvm-svn: 91429
2009-12-15 09:09:49 +00:00
Chris Lattner 13b3928d62 move isPodLike<clang::QualType> out to Type.h. We don't
want some clients of QualType to think it's a pod and some to 
not know it is.

llvm-svn: 91424
2009-12-15 07:30:12 +00:00
Chris Lattner 2f3da9b205 update to match LLVM API change:
Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.

llvm-svn: 91422
2009-12-15 07:26:51 +00:00
Daniel Dunbar f6da2951b6 Add -W[no-]variadic-macros support.
llvm-svn: 91415
2009-12-15 05:29:09 +00:00
Daniel Dunbar 3031aea9cd Forward -isysroot to clang -cc1.
llvm-svn: 91414
2009-12-15 04:55:58 +00:00
Daniel Dunbar 95d40a6701 Fix a COVTCTII (crash-on-valid-that-clang-thinks-is-invalid, duh),
note_previous_decl was used where note_previous_declaration was intended. Better
names or PR5785 might be nice.

llvm-svn: 91413
2009-12-15 04:24:24 +00:00
Ted Kremenek 29f3808667 Until we can make the dead stores checker smarter, dont' emit dead store warnings for C++ objects (whose constructors/destructors have possible side-effects).
llvm-svn: 91412
2009-12-15 04:12:12 +00:00
Eli Friedman 2151725325 Fix a small bug in ComputeMethodVtableIndices.
llvm-svn: 91411
2009-12-15 03:31:17 +00:00
Eli Friedman 8d83842761 Really fix this test.
llvm-svn: 91409
2009-12-15 03:22:41 +00:00
Mike Stump feb1945fee This patch should fix PR2461. It allows clang to apply the noreturn
attribute to function pointers. It also fixes Sema to check function
pointers for the noreturn attribute when checking for fallthrough.

Patch by Chip Davis, with a slight fix to pass the testsuite.

llvm-svn: 91408
2009-12-15 03:11:10 +00:00
Ted Kremenek f65a0c6768 scan-build/ccc-analyzer: start analyzing C++ FTW.
llvm-svn: 91398
2009-12-15 02:35:54 +00:00
Eli Friedman a2761ba52f Fix test broken by my last commit.
llvm-svn: 91396
2009-12-15 02:20:06 +00:00
John McCall 9003406096 Diagnose the use of typedefs for template specialization types in the scope
specifiers for out-of-line declarations, e.g.
  typedef Temp<int> MyTemp;
  template <> MyTemp::foo;

llvm-svn: 91395
2009-12-15 02:19:47 +00:00
Eli Friedman d777cccb47 Don't force the emission of destructor definitions.
llvm-svn: 91394
2009-12-15 02:06:15 +00:00
Chris Lattner d19564b109 set up the machinery for a MacroArgs cache hanging off Preprocessor.
We creating and free thousands of MacroArgs objects (and the related
std::vectors hanging off them) for the testcase in PR5610 even though
there are only ~20 live at a time.  This doesn't actually use the 
cache yet.

llvm-svn: 91391
2009-12-15 01:51:03 +00:00
Ted Kremenek c98cdd175a Start the ball rolling on C++ support in the static analyzer. For
now, don't construct CFGs that contain C++ try/catch statements, and
have GRExprEngine abort a path if it encounters a C++ construct it
doesn't understand (which is mostly everything at this point).

llvm-svn: 91389
2009-12-15 01:38:04 +00:00
Mike Stump cf16d2cc42 Fix spacing.
llvm-svn: 91386
2009-12-15 01:22:35 +00:00
Daniel Dunbar 34e0b8cdee Driver: Pass -resource-dir to clang -cc1, since the driver presumably already found itself.
llvm-svn: 91384
2009-12-15 01:02:52 +00:00
Mike Stump 9a4e0128a8 Ensure we preserve line information for each trap for
-fcatch-undefined-behavior if we aren't optimizing.  WIP.

llvm-svn: 91382
2009-12-15 00:59:40 +00:00
Mike Stump e8c3b3eca4 Switch codegen for -fcatch-undefined-bahavior over to __builtin_trap
instead of abort to improve codesize and codegen.

llvm-svn: 91374
2009-12-15 00:35:12 +00:00
Ted Kremenek 1668046db1 Update checker build.
llvm-svn: 91373
2009-12-15 00:32:46 +00:00
Daniel Dunbar a5a166d01a Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.

llvm-svn: 91370
2009-12-15 00:06:45 +00:00
Douglas Gregor 7dc42e5d4c Implement value initialization in InitializationSequence; untested
WIP, yet again.

llvm-svn: 91368
2009-12-15 00:01:57 +00:00
Mike Stump 68943780a6 Add documentation for recently added code. WIP.
llvm-svn: 91367
2009-12-14 23:53:10 +00:00
John McCall 2079d0b974 Fix PR5716 by bandaging over the solution until we can come back to it.
I apologize for friend declarations.

llvm-svn: 91359
2009-12-14 23:19:40 +00:00
Fariborz Jahanian 3914ee8fcd Make test more generic.
llvm-svn: 91349
2009-12-14 22:17:35 +00:00
Ted Kremenek 814c416636 Fix: <rdar://problem/7468209> SymbolManager::isLive() should not crash on captured block variables that are passed by reference
llvm-svn: 91348
2009-12-14 22:15:06 +00:00
Mike Stump 590d18f103 We have to allow one to form an address for one past the end. WIP.
llvm-svn: 91347
2009-12-14 22:14:31 +00:00
Chris Lattner ffbf2de1d8 move the VarargsElided member of MacrosArgs to shrink the MacroArgs struct
on 64-bit targets.  Pass Preprocessor into create/destroy methods of MacroArgs
even though it isn't used yet.

llvm-svn: 91345
2009-12-14 22:12:52 +00:00
Chris Lattner d2fa78d0bd fix typo
llvm-svn: 91343
2009-12-14 22:02:43 +00:00
Mike Stump ba6a0c40c4 Add support for detecting undefined shift behavior. WIP.
llvm-svn: 91341
2009-12-14 21:58:14 +00:00
Fariborz Jahanian 9ac0a04b29 Patch to fix 32-bit @try failure with internal assertion when compiling
an Objective-C rethrow nested inside another try/catch block. (fixes radar 7466728).

llvm-svn: 91335
2009-12-14 21:35:01 +00:00
Douglas Gregor 4881735736 Remove accidental commit containing local paths for the LLVM-Code-Syntax test
llvm-svn: 91326
2009-12-14 20:58:24 +00:00
Douglas Gregor 4f84661c43 Minor cleanups for constructor initialization in InitializationSequence
llvm-svn: 91325
2009-12-14 20:57:13 +00:00
Mike Stump f8858af909 Simplifiy.
llvm-svn: 91324
2009-12-14 20:52:00 +00:00
Douglas Gregor 1e7ffa7571 Constructor initialization for InitializationSequence. Untested WIP.
llvm-svn: 91323
2009-12-14 20:49:26 +00:00
Douglas Gregor d196a58b55 Improve template instantiation for object constructions in several ways:
- During instantiation, drop default arguments from constructor and
    call expressions; they'll be recomputed anyway, and we don't want
    to instantiate them twice.
  - Rewrote the instantiation of variable initializers to cope with
    non-dependent forms properly.

Together, these fix a handful of problems I introduced with the switch
to always rebuild expressions from the source code "as written."

llvm-svn: 91315
2009-12-14 19:27:10 +00:00
Fariborz Jahanian d83359ac82 Make test pass in all cases.
llvm-svn: 91309
2009-12-14 18:38:32 +00:00
Fariborz Jahanian df9f4c6655 Fixes an incomplete test case.
llvm-svn: 91304
2009-12-14 18:18:29 +00:00
Fariborz Jahanian a01b67d7b0 Make tests use the new clang -cc1 flag.
llvm-svn: 91303
2009-12-14 18:00:56 +00:00
Fariborz Jahanian 6ec5119b5f Make tests use the new clang cc1 flag.
llvm-svn: 91300
2009-12-14 17:51:07 +00:00
Fariborz Jahanian c749f2b62f Make tests use the new clang -cc1 flag.
llvm-svn: 91299
2009-12-14 17:47:10 +00:00
Fariborz Jahanian 0a47cdfeef Make tests use the new clang -cc1 flag.
llvm-svn: 91298
2009-12-14 17:43:07 +00:00
Fariborz Jahanian 0399c1c9c0 Change tests to use clang -cc1...
llvm-svn: 91297
2009-12-14 17:36:25 +00:00
Douglas Gregor 540c3b0e50 Implement user-defined conversions in InitializationSequence. WPI that
isn't turned on anyway yet, so it cannot be tested.

llvm-svn: 91294
2009-12-14 17:27:33 +00:00
Fariborz Jahanian 5dc61d7ab5 Test uses the new clang.
llvm-svn: 91292
2009-12-14 17:14:55 +00:00
Fariborz Jahanian 4ee3981574 Tests use the new clang.
llvm-svn: 91290
2009-12-14 17:13:18 +00:00
Douglas Gregor db121bad2a When rebuilding CXXConstructExprs after a transformation, use
CompleteConstructorCall to perform type-checking.

llvm-svn: 91279
2009-12-14 16:27:04 +00:00
Zhongxing Xu 27f686f8ec Replace clang-cc with clang -cc1.
llvm-svn: 91272
2009-12-14 06:34:20 +00:00
Chris Lattner 7c027ee4c2 teach clang to recover gracefully from conflict markers left in source
files: PR5238.

llvm-svn: 91270
2009-12-14 06:16:57 +00:00
Nate Begeman 67dfd4236a Revert mmx palignr to use an intrinsic, since mmx shuffle patterns are missing.
llvm-svn: 91269
2009-12-14 05:15:02 +00:00
Chris Lattner f290e005e4 this was a couple bugzillas too
llvm-svn: 91267
2009-12-14 05:03:13 +00:00
Chris Lattner 4c53c40a4c fix rdar://7466570 - Be more bug compatible with GCC when it comes to
expanding directives withing macro expansions.  This is undefined behavior
according to 6.10.3p11, so we might as well be undefined in ways similar to
GCC.

llvm-svn: 91266
2009-12-14 05:00:18 +00:00
Chris Lattner b8132253c8 filecheckize
llvm-svn: 91265
2009-12-14 04:57:53 +00:00
Nate Begeman 72ec6bc6f4 Support x86's PALIGNR instruction without the use of a palignr intrinsic.
llvm-svn: 91264
2009-12-14 04:57:03 +00:00
Chris Lattner 8cf1f935c2 formatting changes.
llvm-svn: 91263
2009-12-14 04:54:40 +00:00
Chris Lattner 676268e45a reduce indentation.
llvm-svn: 91262
2009-12-14 04:26:45 +00:00
Zhongxing Xu cf86de4067 Use insert to avoid destroying existing nodes.
llvm-svn: 91258
2009-12-14 02:13:39 +00:00
Anders Carlsson e66e2942fc Mangle unary, binary and ternary expressions correctly.
llvm-svn: 91257
2009-12-14 01:45:37 +00:00
Anders Carlsson 8911229187 Rename dump to dumpDeclContext, so that call RD->dump() won't dump the decl context by default.
llvm-svn: 91256
2009-12-14 00:51:04 +00:00
Anders Carlsson c67974ccb1 Simplify BuildSimpleType in the RTTBuilder to avoid using an std::vector.
llvm-svn: 91255
2009-12-13 23:47:29 +00:00
Douglas Gregor 1aa450a078 Fix PR5756 a different, better way: we don't have a "pointer
conversion to void*" according to C++ [over.ics.rank]p4b2 if the type
we're converting from is not a pointer.

llvm-svn: 91254
2009-12-13 21:37:05 +00:00
Douglas Gregor 202eb8fcfd Don't assume that all conversions to a void pointer are converting
from a PointerType. Fixes PR5756.

llvm-svn: 91253
2009-12-13 21:29:20 +00:00
Douglas Gregor b08f1a7b32 Fix template instantiation for non-dependent calls to overloaded call
operators. Fixes PR5266.

llvm-svn: 91252
2009-12-13 20:44:55 +00:00
Anders Carlsson 399f499f0c Don't use a cookie if the global placement new function is used.
llvm-svn: 91251
2009-12-13 20:34:34 +00:00
Anders Carlsson adbe4249d6 Fix regression in my last commit - if a struct has a trivial destructor but no usual deallocation function we don't need a cookie.
llvm-svn: 91249
2009-12-13 20:10:12 +00:00
Anders Carlsson 21122cf657 More array cookie improvements.
llvm-svn: 91247
2009-12-13 20:04:38 +00:00
Anders Carlsson f5af8dead7 If the usual array deallocation function of a class takes two arguments, we need to pass the number of bytes allocated to the deallocation function, just not the number of bytes in a single element.
llvm-svn: 91246
2009-12-13 18:48:07 +00:00
Anders Carlsson f5056f8545 Fix test.
llvm-svn: 91245
2009-12-13 18:30:34 +00:00
Anders Carlsson 7e0b207e54 More improvements to checking allocation and deallocation functions.
llvm-svn: 91244
2009-12-13 17:53:43 +00:00
Anders Carlsson e7025c55a4 Change the RTTIBuilder's finish member function to take a pointer to the constants array + the length of the array.
llvm-svn: 91241
2009-12-13 16:38:01 +00:00
Daniel Dunbar 8d4a202aad Lift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix CIndex to pass in the right directory (previously it was using the path to the main executable, which generally is wrong).
llvm-svn: 91238
2009-12-13 03:46:13 +00:00
Daniel Dunbar d613677ec9 CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.
llvm-svn: 91237
2009-12-13 03:45:58 +00:00
Daniel Dunbar 85d2f8f875 Use clang -cc1 in test, to improve determinism.
llvm-svn: 91236
2009-12-13 02:20:49 +00:00
Daniel Dunbar 18a72959f5 Tests: Fix some bugs in clang_f_opts, options were out of order but it worked
because it had two inputs, except on Win32 where /dev/null doesn't exist.

llvm-svn: 91235
2009-12-13 02:00:23 +00:00
Chandler Carruth 8abbc657a9 Silence some release build warnings.
llvm-svn: 91234
2009-12-13 01:37:04 +00:00
Daniel Dunbar efa39f7db1 Backend: Switch to using TargetOptions or TargetMachine to set some options instead of llvm::cl.
llvm-svn: 91229
2009-12-12 23:01:36 +00:00
Fariborz Jahanian 751c1e7b24 patch to add a property from a protocol to a class that adopts the protocol.
(fixes radar 7466494).

llvm-svn: 91227
2009-12-12 21:26:21 +00:00
Ted Kremenek 3b90ed2628 Update checker build.
llvm-svn: 91222
2009-12-12 19:06:20 +00:00
Douglas Gregor 6131b44183 Rework the way we handle template instantiation for
implicitly-generated AST nodes. We previously built instantiated nodes
for each of these AST nodes, then passed them on to Sema, which was
not prepared to see already-type-checked nodes (see PR5755). In some
places, we had ugly workarounds to try to avoid re-type-checking
(e.g., in VarDecl initializer instantiation).

Now, we skip implicitly-generated nodes when performing instantiation,
preferring instead to build just the AST nodes that directly reflect
what was written in the source code. This has several advantages:

  - We don't need to instantiate anything that doesn't have a direct
    correlation to the source code, so we can have better location
    information.
  - Semantic analysis sees the same thing at template instantiation
    time that it would see for a non-template.
  - At least one ugly hack (VarDecl initializers) goes away.

Fixes PR5755.

llvm-svn: 91218
2009-12-12 18:16:41 +00:00
Zhongxing Xu c0484fa611 Add initial support for realloc() in MallocChecker.
llvm-svn: 91216
2009-12-12 12:29:38 +00:00