]> granicus.if.org Git - clang/log
clang
14 years agoRefine a little. WIP.
Mike Stump [Wed, 16 Dec 2009 03:25:12 +0000 (03:25 +0000)]
Refine a little.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91502 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd (initial?) static analyzer support for handling C++ references.
Ted Kremenek [Wed, 16 Dec 2009 03:18:58 +0000 (03:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91501 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some documentation for recent checkins. WIP.
Mike Stump [Wed, 16 Dec 2009 03:18:14 +0000 (03:18 +0000)]
Add some documentation for recent checkins.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91500 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd an addition check for undefined behavior for when we hit a
Mike Stump [Wed, 16 Dec 2009 03:07:12 +0000 (03:07 +0000)]
Add an addition check for undefined behavior for when we hit a
__builtin_unreachable.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91499 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement additional undefined checks for additional loads and stores. WIP.
Mike Stump [Wed, 16 Dec 2009 02:57:00 +0000 (02:57 +0000)]
Implement additional undefined checks for additional loads and stores.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91498 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCheck in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action...
Anders Carlsson [Wed, 16 Dec 2009 02:09:40 +0000 (02:09 +0000)]
Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action::FullExpr to Action::MakeFullExpr to avoid name clashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91494 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSuccessive anonymous namespaces name the same scope. I misinterpreted the
John McCall [Wed, 16 Dec 2009 02:06:49 +0000 (02:06 +0000)]
Successive anonymous namespaces name the same scope.  I misinterpreted the
standard the last time.  Fixes PR5766.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91493 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch the C++ new expression over to InitializationSequence, rather
Douglas Gregor [Wed, 16 Dec 2009 01:38:02 +0000 (01:38 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDiagnose attempting to assign to a sub-structure of an ivar
Fariborz Jahanian [Tue, 15 Dec 2009 23:59:41 +0000 (23:59 +0000)]
Diagnose attempting to assign to a sub-structure of an ivar
using objective-c property. (fixes radar 7449707)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91474 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove ValueManager::getRegionValueSymbolValOrUnknown(). It was just extra veneer...
Ted Kremenek [Tue, 15 Dec 2009 23:23:27 +0000 (23:23 +0000)]
Remove ValueManager::getRegionValueSymbolValOrUnknown().  It was just extra veneer on top of getRegionValueSymbolVal().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91471 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLink up member-class redeclarations during template instantiation.
John McCall [Tue, 15 Dec 2009 22:29:06 +0000 (22:29 +0000)]
Link up member-class redeclarations during template instantiation.
This test courtesy of LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91462 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate tests to use %clang instead of 'clang', and forcibly disable use of '
Daniel Dunbar [Tue, 15 Dec 2009 22:01:24 +0000 (22:01 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91460 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a code gen bug related to accessing a now
Fariborz Jahanian [Tue, 15 Dec 2009 21:34:52 +0000 (21:34 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91455 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoShouldDestroyTemporaries? I don't think so.
Anders Carlsson [Tue, 15 Dec 2009 20:51:39 +0000 (20:51 +0000)]
ShouldDestroyTemporaries? I don't think so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91450 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoenable reuse of MacroArgs objects. This is a small (2.5%) win
Chris Lattner [Tue, 15 Dec 2009 20:48:12 +0000 (20:48 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91449 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
Daniel Dunbar [Tue, 15 Dec 2009 20:14:24 +0000 (20:14 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the underlyin...
Anders Carlsson [Tue, 15 Dec 2009 19:16:31 +0000 (19:16 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91439 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport OpenCL 1.1 odd-length vector component accessors.
Nate Begeman [Tue, 15 Dec 2009 18:13:04 +0000 (18:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91437 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd testcase for recent checkin.
Mike Stump [Tue, 15 Dec 2009 18:02:45 +0000 (18:02 +0000)]
Add testcase for recent checkin.

Patch by Chip Davis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91436 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement conditional block invocation rewrite
Fariborz Jahanian [Tue, 15 Dec 2009 17:30:20 +0000 (17:30 +0000)]
Implement conditional block invocation rewrite
and some clean up and a block rewriter test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91435 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix some diagnostic-related FIXMEs, from Nicola Gigante
Douglas Gregor [Tue, 15 Dec 2009 16:44:32 +0000 (16:44 +0000)]
Fix some diagnostic-related FIXMEs, from Nicola Gigante

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91433 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoElaborated types are specifier types, based on a patch from Cornelius
Douglas Gregor [Tue, 15 Dec 2009 16:28:32 +0000 (16:28 +0000)]
Elaborated types are specifier types, based on a patch from Cornelius

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91431 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd comments.
Zhongxing Xu [Tue, 15 Dec 2009 09:32:42 +0000 (09:32 +0000)]
Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91430 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove displayProgress parameter.
Zhongxing Xu [Tue, 15 Dec 2009 09:09:49 +0000 (09:09 +0000)]
Remove displayProgress parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91429 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove isPodLike<clang::QualType> out to Type.h. We don't
Chris Lattner [Tue, 15 Dec 2009 07:30:12 +0000 (07:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91424 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoupdate to match LLVM API change:
Chris Lattner [Tue, 15 Dec 2009 07:26:51 +0000 (07:26 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91422 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd -W[no-]variadic-macros support.
Daniel Dunbar [Tue, 15 Dec 2009 05:29:09 +0000 (05:29 +0000)]
Add -W[no-]variadic-macros support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91415 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoForward -isysroot to clang -cc1.
Daniel Dunbar [Tue, 15 Dec 2009 04:55:58 +0000 (04:55 +0000)]
Forward -isysroot to clang -cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91414 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a COVTCTII (crash-on-valid-that-clang-thinks-is-invalid, duh),
Daniel Dunbar [Tue, 15 Dec 2009 04:24:24 +0000 (04:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91413 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUntil we can make the dead stores checker smarter, dont' emit dead store warnings...
Ted Kremenek [Tue, 15 Dec 2009 04:12:12 +0000 (04:12 +0000)]
Until we can make the dead stores checker smarter, dont' emit dead store warnings for C++ objects (whose constructors/destructors have possible side-effects).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91412 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a small bug in ComputeMethodVtableIndices.
Eli Friedman [Tue, 15 Dec 2009 03:31:17 +0000 (03:31 +0000)]
Fix a small bug in ComputeMethodVtableIndices.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91411 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReally fix this test.
Eli Friedman [Tue, 15 Dec 2009 03:22:41 +0000 (03:22 +0000)]
Really fix this test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91409 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThis patch should fix PR2461. It allows clang to apply the noreturn
Mike Stump [Tue, 15 Dec 2009 03:11:10 +0000 (03:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91408 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoscan-build/ccc-analyzer: start analyzing C++ FTW.
Ted Kremenek [Tue, 15 Dec 2009 02:35:54 +0000 (02:35 +0000)]
scan-build/ccc-analyzer: start analyzing C++ FTW.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91398 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix test broken by my last commit.
Eli Friedman [Tue, 15 Dec 2009 02:20:06 +0000 (02:20 +0000)]
Fix test broken by my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91396 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDiagnose the use of typedefs for template specialization types in the scope
John McCall [Tue, 15 Dec 2009 02:19:47 +0000 (02:19 +0000)]
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;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91395 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't force the emission of destructor definitions.
Eli Friedman [Tue, 15 Dec 2009 02:06:15 +0000 (02:06 +0000)]
Don't force the emission of destructor definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91394 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoset up the machinery for a MacroArgs cache hanging off Preprocessor.
Chris Lattner [Tue, 15 Dec 2009 01:51:03 +0000 (01:51 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91391 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStart the ball rolling on C++ support in the static analyzer. For
Ted Kremenek [Tue, 15 Dec 2009 01:38:04 +0000 (01:38 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91389 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix spacing.
Mike Stump [Tue, 15 Dec 2009 01:22:35 +0000 (01:22 +0000)]
Fix spacing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91386 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Pass -resource-dir to clang -cc1, since the driver presumably already found...
Daniel Dunbar [Tue, 15 Dec 2009 01:02:52 +0000 (01:02 +0000)]
Driver: Pass -resource-dir to clang -cc1, since the driver presumably already found itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91384 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnsure we preserve line information for each trap for
Mike Stump [Tue, 15 Dec 2009 00:59:40 +0000 (00:59 +0000)]
Ensure we preserve line information for each  trap for
-fcatch-undefined-behavior if we aren't optimizing.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91382 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch codegen for -fcatch-undefined-bahavior over to __builtin_trap
Mike Stump [Tue, 15 Dec 2009 00:35:12 +0000 (00:35 +0000)]
Switch codegen for -fcatch-undefined-bahavior over to __builtin_trap
instead of abort to improve codesize and codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91374 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate checker build.
Ted Kremenek [Tue, 15 Dec 2009 00:32:46 +0000 (00:32 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91373 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd -resource-dir to clang -cc1, this allows the base directory for compiler
Daniel Dunbar [Tue, 15 Dec 2009 00:06:45 +0000 (00:06 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91370 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement value initialization in InitializationSequence; untested
Douglas Gregor [Tue, 15 Dec 2009 00:01:57 +0000 (00:01 +0000)]
Implement value initialization in InitializationSequence; untested
WIP, yet again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91368 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd documentation for recently added code. WIP.
Mike Stump [Mon, 14 Dec 2009 23:53:10 +0000 (23:53 +0000)]
Add documentation for recently added code.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91367 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR5716 by bandaging over the solution until we can come back to it.
John McCall [Mon, 14 Dec 2009 23:19:40 +0000 (23:19 +0000)]
Fix PR5716 by bandaging over the solution until we can come back to it.
I apologize for friend declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91359 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake test more generic.
Fariborz Jahanian [Mon, 14 Dec 2009 22:17:35 +0000 (22:17 +0000)]
Make test more generic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91349 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix: <rdar://problem/7468209> SymbolManager::isLive() should not crash on captured...
Ted Kremenek [Mon, 14 Dec 2009 22:15:06 +0000 (22:15 +0000)]
Fix: <rdar://problem/7468209> SymbolManager::isLive() should not crash on captured block variables that are passed by reference

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91348 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWe have to allow one to form an address for one past the end. WIP.
Mike Stump [Mon, 14 Dec 2009 22:14:31 +0000 (22:14 +0000)]
We have to allow one to form an address for one past the end.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91347 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove the VarargsElided member of MacrosArgs to shrink the MacroArgs struct
Chris Lattner [Mon, 14 Dec 2009 22:12:52 +0000 (22:12 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91345 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix typo
Chris Lattner [Mon, 14 Dec 2009 22:02:43 +0000 (22:02 +0000)]
fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91343 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for detecting undefined shift behavior. WIP.
Mike Stump [Mon, 14 Dec 2009 21:58:14 +0000 (21:58 +0000)]
Add support for detecting undefined shift behavior.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91341 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPatch to fix 32-bit @try failure with internal assertion when compiling
Fariborz Jahanian [Mon, 14 Dec 2009 21:35:01 +0000 (21:35 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91335 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove accidental commit containing local paths for the LLVM-Code-Syntax test
Douglas Gregor [Mon, 14 Dec 2009 20:58:24 +0000 (20:58 +0000)]
Remove accidental commit containing local paths for the LLVM-Code-Syntax test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91326 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor cleanups for constructor initialization in InitializationSequence
Douglas Gregor [Mon, 14 Dec 2009 20:57:13 +0000 (20:57 +0000)]
Minor cleanups for constructor initialization in InitializationSequence

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91325 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplifiy.
Mike Stump [Mon, 14 Dec 2009 20:52:00 +0000 (20:52 +0000)]
Simplifiy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91324 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConstructor initialization for InitializationSequence. Untested WIP.
Douglas Gregor [Mon, 14 Dec 2009 20:49:26 +0000 (20:49 +0000)]
Constructor initialization for InitializationSequence. Untested WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91323 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove template instantiation for object constructions in several ways:
Douglas Gregor [Mon, 14 Dec 2009 19:27:10 +0000 (19:27 +0000)]
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."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91315 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake test pass in all cases.
Fariborz Jahanian [Mon, 14 Dec 2009 18:38:32 +0000 (18:38 +0000)]
Make test pass in all cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91309 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes an incomplete test case.
Fariborz Jahanian [Mon, 14 Dec 2009 18:18:29 +0000 (18:18 +0000)]
Fixes an incomplete test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91304 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake tests use the new clang -cc1 flag.
Fariborz Jahanian [Mon, 14 Dec 2009 18:00:56 +0000 (18:00 +0000)]
Make tests use the new clang -cc1 flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91303 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake tests use the new clang cc1 flag.
Fariborz Jahanian [Mon, 14 Dec 2009 17:51:07 +0000 (17:51 +0000)]
Make tests use the new clang cc1 flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91300 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake tests use the new clang -cc1 flag.
Fariborz Jahanian [Mon, 14 Dec 2009 17:47:10 +0000 (17:47 +0000)]
Make tests use the new clang -cc1 flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91299 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake tests use the new clang -cc1 flag.
Fariborz Jahanian [Mon, 14 Dec 2009 17:43:07 +0000 (17:43 +0000)]
Make tests use the new clang -cc1 flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91298 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange tests to use clang -cc1...
Fariborz Jahanian [Mon, 14 Dec 2009 17:36:25 +0000 (17:36 +0000)]
Change tests to use clang -cc1...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91297 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement user-defined conversions in InitializationSequence. WPI that
Douglas Gregor [Mon, 14 Dec 2009 17:27:33 +0000 (17:27 +0000)]
Implement user-defined conversions in InitializationSequence. WPI that
isn't turned on anyway yet, so it cannot be tested.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91294 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest uses the new clang.
Fariborz Jahanian [Mon, 14 Dec 2009 17:14:55 +0000 (17:14 +0000)]
Test uses the new clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91292 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTests use the new clang.
Fariborz Jahanian [Mon, 14 Dec 2009 17:13:18 +0000 (17:13 +0000)]
Tests use the new clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91290 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen rebuilding CXXConstructExprs after a transformation, use
Douglas Gregor [Mon, 14 Dec 2009 16:27:04 +0000 (16:27 +0000)]
When rebuilding CXXConstructExprs after a transformation, use
CompleteConstructorCall to perform type-checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91279 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReplace clang-cc with clang -cc1.
Zhongxing Xu [Mon, 14 Dec 2009 06:34:20 +0000 (06:34 +0000)]
Replace clang-cc with clang -cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91272 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoteach clang to recover gracefully from conflict markers left in source
Chris Lattner [Mon, 14 Dec 2009 06:16:57 +0000 (06:16 +0000)]
teach clang to recover gracefully from conflict markers left in source
files: PR5238.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91270 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert mmx palignr to use an intrinsic, since mmx shuffle patterns are missing.
Nate Begeman [Mon, 14 Dec 2009 05:15:02 +0000 (05:15 +0000)]
Revert mmx palignr to use an intrinsic, since mmx shuffle patterns are missing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91269 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothis was a couple bugzillas too
Chris Lattner [Mon, 14 Dec 2009 05:03:13 +0000 (05:03 +0000)]
this was a couple bugzillas too

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91267 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix rdar://7466570 - Be more bug compatible with GCC when it comes to
Chris Lattner [Mon, 14 Dec 2009 05:00:18 +0000 (05:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91266 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofilecheckize
Chris Lattner [Mon, 14 Dec 2009 04:57:53 +0000 (04:57 +0000)]
filecheckize

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91265 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport x86's PALIGNR instruction without the use of a palignr intrinsic.
Nate Begeman [Mon, 14 Dec 2009 04:57:03 +0000 (04:57 +0000)]
Support x86's PALIGNR instruction without the use of a palignr intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91264 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoformatting changes.
Chris Lattner [Mon, 14 Dec 2009 04:54:40 +0000 (04:54 +0000)]
formatting changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91263 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreduce indentation.
Chris Lattner [Mon, 14 Dec 2009 04:26:45 +0000 (04:26 +0000)]
reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91262 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse insert to avoid destroying existing nodes.
Zhongxing Xu [Mon, 14 Dec 2009 02:13:39 +0000 (02:13 +0000)]
Use insert to avoid destroying existing nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91258 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMangle unary, binary and ternary expressions correctly.
Anders Carlsson [Mon, 14 Dec 2009 01:45:37 +0000 (01:45 +0000)]
Mangle unary, binary and ternary expressions correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91257 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename dump to dumpDeclContext, so that call RD->dump() won't dump the decl context...
Anders Carlsson [Mon, 14 Dec 2009 00:51:04 +0000 (00:51 +0000)]
Rename dump to dumpDeclContext, so that call RD->dump() won't dump the decl context by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91256 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify BuildSimpleType in the RTTBuilder to avoid using an std::vector.
Anders Carlsson [Sun, 13 Dec 2009 23:47:29 +0000 (23:47 +0000)]
Simplify BuildSimpleType in the RTTBuilder to avoid using an std::vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91255 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR5756 a different, better way: we don't have a "pointer
Douglas Gregor [Sun, 13 Dec 2009 21:37:05 +0000 (21:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91254 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't assume that all conversions to a void pointer are converting
Douglas Gregor [Sun, 13 Dec 2009 21:29:20 +0000 (21:29 +0000)]
Don't assume that all conversions to a void pointer are converting
from a PointerType. Fixes PR5756.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91253 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix template instantiation for non-dependent calls to overloaded call
Douglas Gregor [Sun, 13 Dec 2009 20:44:55 +0000 (20:44 +0000)]
Fix template instantiation for non-dependent calls to overloaded call
operators. Fixes PR5266.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91252 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't use a cookie if the global placement new function is used.
Anders Carlsson [Sun, 13 Dec 2009 20:34:34 +0000 (20:34 +0000)]
Don't use a cookie if the global placement new function is used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91251 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix regression in my last commit - if a struct has a trivial destructor but no usual...
Anders Carlsson [Sun, 13 Dec 2009 20:10:12 +0000 (20:10 +0000)]
Fix regression in my last commit - if a struct has a trivial destructor but no usual deallocation function we don't need a cookie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91249 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore array cookie improvements.
Anders Carlsson [Sun, 13 Dec 2009 20:04:38 +0000 (20:04 +0000)]
More array cookie improvements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91247 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf the usual array deallocation function of a class takes two arguments, we need...
Anders Carlsson [Sun, 13 Dec 2009 18:48:07 +0000 (18:48 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91246 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix test.
Anders Carlsson [Sun, 13 Dec 2009 18:30:34 +0000 (18:30 +0000)]
Fix test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91245 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore improvements to checking allocation and deallocation functions.
Anders Carlsson [Sun, 13 Dec 2009 17:53:43 +0000 (17:53 +0000)]
More improvements to checking allocation and deallocation functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91244 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the RTTIBuilder's finish member function to take a pointer to the constants...
Anders Carlsson [Sun, 13 Dec 2009 16:38:01 +0000 (16:38 +0000)]
Change the RTTIBuilder's finish member function to take a pointer to the constants array + the length of the array.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91241 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix CIndex...
Daniel Dunbar [Sun, 13 Dec 2009 03:46:13 +0000 (03:46 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91238 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::Create...
Daniel Dunbar [Sun, 13 Dec 2009 03:45:58 +0000 (03:45 +0000)]
CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91237 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse clang -cc1 in test, to improve determinism.
Daniel Dunbar [Sun, 13 Dec 2009 02:20:49 +0000 (02:20 +0000)]
Use clang -cc1 in test, to improve determinism.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91236 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTests: Fix some bugs in clang_f_opts, options were out of order but it worked
Daniel Dunbar [Sun, 13 Dec 2009 02:00:23 +0000 (02:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91235 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSilence some release build warnings.
Chandler Carruth [Sun, 13 Dec 2009 01:37:04 +0000 (01:37 +0000)]
Silence some release build warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91234 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBackend: Switch to using TargetOptions or TargetMachine to set some options instead...
Daniel Dunbar [Sat, 12 Dec 2009 23:01:36 +0000 (23:01 +0000)]
Backend: Switch to using TargetOptions or TargetMachine to set some options instead of llvm::cl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91229 91177308-0d34-0410-b5e6-96231b3b80d8