]> granicus.if.org Git - clang/log
clang
15 years agoRemove stale comment and tighten code.
Ted Kremenek [Tue, 20 Oct 2009 23:59:28 +0000 (23:59 +0000)]
Remove stale comment and tighten code.

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

15 years agoAdd FIXME.
Ted Kremenek [Tue, 20 Oct 2009 23:48:29 +0000 (23:48 +0000)]
Add FIXME.

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

15 years agoUse llvm::OwningPtr in CFGBuilder, fixing a leak on an error path.
Ted Kremenek [Tue, 20 Oct 2009 23:46:25 +0000 (23:46 +0000)]
Use llvm::OwningPtr in CFGBuilder, fixing a leak on an error path.

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

15 years agoCode-gen for CXXZeroInitValueExpr AST passed
Fariborz Jahanian [Tue, 20 Oct 2009 23:29:04 +0000 (23:29 +0000)]
Code-gen for CXXZeroInitValueExpr AST passed
as argument to a function call. Removes a FIXME.

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

15 years agoChange ResolveAddressOfOverloadedFunction to support TemplateIdRefExpr. No testcase...
Anders Carlsson [Tue, 20 Oct 2009 22:53:47 +0000 (22:53 +0000)]
Change ResolveAddressOfOverloadedFunction to support TemplateIdRefExpr. No testcase yet because FixOverloadedFunctionReference needs to be updated too. Doug, plz review.

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

15 years agoFix the 32-bit ABI to return structures with non-trivial copy ctors or dtors indirectly.
Anders Carlsson [Tue, 20 Oct 2009 22:07:59 +0000 (22:07 +0000)]
Fix the 32-bit ABI to return structures with non-trivial copy ctors or dtors indirectly.

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

15 years agoAdd destructor and cleanup code to LocationContext (fixing some leaks). Along the...
Ted Kremenek [Tue, 20 Oct 2009 21:39:41 +0000 (21:39 +0000)]
Add destructor and cleanup code to LocationContext (fixing some leaks). Along the way, have
AnalysisManager periodically cleanup its AnalysisContextManager and LocationContextManager objects,
as they don't need to forever retain all the CFGs ever created when analyzing a file.

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

15 years agoUpdated, we support == and != builtins for member pointers.
Fariborz Jahanian [Tue, 20 Oct 2009 21:10:15 +0000 (21:10 +0000)]
Updated, we support == and != builtins for member pointers.

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

15 years agoChanges to reflect more pointer-to-member support.
Fariborz Jahanian [Tue, 20 Oct 2009 20:31:50 +0000 (20:31 +0000)]
Changes to reflect more pointer-to-member support.

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

15 years agoFor now, we need to have the llvm type of the block pointer remain as
Mike Stump [Tue, 20 Oct 2009 20:30:01 +0000 (20:30 +0000)]
For now, we need to have the llvm type of the block pointer remain as
it was.  Fixes codegen bug introduced yesterday.

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

15 years agoMoved comment to its proper place in my last patch.
Fariborz Jahanian [Tue, 20 Oct 2009 20:07:35 +0000 (20:07 +0000)]
Moved comment to its proper place in my last patch.

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

15 years agoPatch implements ranking conversions between member pointers [over.ics.rank]
Fariborz Jahanian [Tue, 20 Oct 2009 20:04:46 +0000 (20:04 +0000)]
Patch implements ranking conversions between member pointers [over.ics.rank]

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

15 years agoDo not eagerly cache DITypes because it allows real struct type to be shadowed by...
Devang Patel [Tue, 20 Oct 2009 19:55:01 +0000 (19:55 +0000)]
Do not eagerly cache DITypes because it allows real struct type to be shadowed by forward declared struct type.

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

15 years agoDriver: If unable to find the gcc tool chain, try the next OS rev.
Daniel Dunbar [Tue, 20 Oct 2009 19:25:43 +0000 (19:25 +0000)]
Driver: If unable to find the gcc tool chain, try the next OS rev.

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

15 years agoEncode global variable name in debug info.
Devang Patel [Tue, 20 Oct 2009 18:26:30 +0000 (18:26 +0000)]
Encode global variable name in debug info.

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

15 years agoAdd missing semi-colon.
Daniel Dunbar [Tue, 20 Oct 2009 18:07:06 +0000 (18:07 +0000)]
Add missing semi-colon.

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

15 years agoChanged text of warning in my last patch.
Fariborz Jahanian [Tue, 20 Oct 2009 17:24:11 +0000 (17:24 +0000)]
Changed text of warning in my last patch.
Related to radar:
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

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

15 years agoBring Darwin into the switch-case statement instead of its own if for readability.
Edward O'Callaghan [Tue, 20 Oct 2009 17:22:50 +0000 (17:22 +0000)]
Bring Darwin into the switch-case statement instead of its own if for readability.

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

15 years agoIssue warning if method body starts with a semicolon.
Fariborz Jahanian [Tue, 20 Oct 2009 16:39:13 +0000 (16:39 +0000)]
Issue warning if method body starts with a semicolon.
Fixes
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

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

15 years agoAdd an example to help claify the process/assumptions...
Steve Naroff [Tue, 20 Oct 2009 16:36:34 +0000 (16:36 +0000)]
Add an example to help claify the process/assumptions...

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

15 years ago- Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems...
Steve Naroff [Tue, 20 Oct 2009 14:46:24 +0000 (14:46 +0000)]
- Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems cleaner to me without sacrificing much flexibility.

- Remove clang_wantOnlyLocalDeclarations().

- Remove 'displayDiagnostics' arguments to clang_createTranslationUnitFromSourceFile() and clang_createTranslationUnit().

- Have clang_createTranslationUnitFromSourceFile() strip the '-o <outfile>' command line arguments if they exist. Document this semantic in the header. Also verify we have a valid ASTUnit before telling it to 'unlinkTemporaryFile()'.

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

15 years agoRemove default argument for ImpCastExprToType. Add appropriate argument
Eli Friedman [Tue, 20 Oct 2009 08:27:19 +0000 (08:27 +0000)]
Remove default argument for ImpCastExprToType.  Add appropriate argument
to all callers.  Switch a few other users of CK_Unknown to proper cast
kinds.

Note that there are still some situations where we end up with
CK_Unknown; they're pretty easy to find with grep. There
are still a few missing conversion kinds, specifically
pointer/int/float->bool and the various combinations of real/complex
float/int->real/complex float/int.

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

15 years agoCall 'clear()' in ~RopePieceBTreeLeaf(), decrementing the reference
Ted Kremenek [Tue, 20 Oct 2009 06:31:34 +0000 (06:31 +0000)]
Call 'clear()' in ~RopePieceBTreeLeaf(), decrementing the reference
counts of the bufffers referened by the RopePieces in
RopePieceBTreeLeaf.  This (I believe) corrently fixes the leak I meant
to fix in r84601 (which ended up causing an overrelease).

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

15 years agoHandle substitutions into the "first qualifier in scope" of a
Douglas Gregor [Tue, 20 Oct 2009 05:58:46 +0000 (05:58 +0000)]
Handle substitutions into the "first qualifier in scope" of a
qualified member access expression (e.g., t->U::member) when that
first qualifier refers to a template parameters.

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

15 years agoRevert 84601. Looks like it was causing failures on some systems.
Ted Kremenek [Tue, 20 Oct 2009 05:53:05 +0000 (05:53 +0000)]
Revert 84601.  Looks like it was causing failures on some systems.

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

15 years agoBumpVectorContext: Use 'unsigned' integer type with PointerIntUnion instead of bool...
Ted Kremenek [Tue, 20 Oct 2009 05:49:17 +0000 (05:49 +0000)]
BumpVectorContext: Use 'unsigned' integer type with PointerIntUnion instead of bool to keep it clear that we are reasoning about an unsigned integer with a single bit.

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

15 years agoImplement PR5242: don't desugar a type more than once in a diagnostic. This
Chris Lattner [Tue, 20 Oct 2009 05:36:05 +0000 (05:36 +0000)]
Implement PR5242: don't desugar a type more than once in a diagnostic.  This
implements a framework that allows us to use information about previously
substituted values to simplify subsequent ones.  Maybe this would be useful
for C++'y stuff, who knows.  We now get:

t.c:4:21: error: invalid operands to binary expression ('size_t' (aka 'unsigned long *') and 'size_t')
  return (size_t) 0 + (size_t) 0;
         ~~~~~~~~~~ ^ ~~~~~~~~~~

on the testcase.  Note that size_t is only aka'd once.

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

15 years agoteach FormatDiagnostic to aggregate previously formatted arguments and
Chris Lattner [Tue, 20 Oct 2009 05:25:22 +0000 (05:25 +0000)]
teach FormatDiagnostic to aggregate previously formatted arguments and
pass them down into the ArgToStringFn implementation.  This allows
redundancy across operands to a diagnostic to be eliminated.

This isn't used yet, so no functionality change.

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

15 years agoFix a reference count imbalance in RewriteRope::MakeRopeString().
Ted Kremenek [Tue, 20 Oct 2009 05:25:11 +0000 (05:25 +0000)]
Fix a reference count imbalance in RewriteRope::MakeRopeString().
This was causing a ton of memory to be leaked when using HTML
diagnostics with the static analyzer (on large files with many errors).

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

15 years agocode cleanup, convert if tree to switch etc.
Chris Lattner [Tue, 20 Oct 2009 05:12:36 +0000 (05:12 +0000)]
code cleanup, convert if tree to switch etc.

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

15 years agoRefine the type of the first parameter to block invoke functions.
Mike Stump [Tue, 20 Oct 2009 02:12:22 +0000 (02:12 +0000)]
Refine the type of the first parameter to block invoke functions.
WIP.  I have yet to find the magic incantation to get the structure
type to be defined.  If someone has a pointer, love to hear it.

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

15 years agoForce triple for test.
Anders Carlsson [Tue, 20 Oct 2009 01:52:47 +0000 (01:52 +0000)]
Force triple for test.

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

15 years agoRegionStore: Use the *default* binding (instead of the *direct* binding) of an Object...
Ted Kremenek [Tue, 20 Oct 2009 01:20:57 +0000 (01:20 +0000)]
RegionStore: Use the *default* binding (instead of the *direct* binding) of an Objective-C object
region when doing lazy value retrieval of an ivar.

This fixes: <rdar://problem/7312221>

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

15 years agoretain/release checker: allow 'new', 'copy', 'alloc', 'init' prefix to start before...
Ted Kremenek [Tue, 20 Oct 2009 00:13:00 +0000 (00:13 +0000)]
retain/release checker: allow 'new', 'copy', 'alloc', 'init' prefix to start before '_' when determining Cocoa fundamental rule.

Fixes: <rdar://problem/7265711>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84569 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBuiltin candidate minimization for
Fariborz Jahanian [Tue, 20 Oct 2009 00:04:40 +0000 (00:04 +0000)]
Builtin candidate minimization for
<<=, >>= and the rest.

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

15 years agoFix inverted preprocessor guard, and fix the resulting compiler error that was unmasked.
Ted Kremenek [Mon, 19 Oct 2009 22:27:32 +0000 (22:27 +0000)]
Fix inverted preprocessor guard, and fix the resulting compiler error that was unmasked.

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

15 years agoReally fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option to
Ted Kremenek [Mon, 19 Oct 2009 22:15:09 +0000 (22:15 +0000)]
Really fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option to
clang_createTranslationUnit() and clang_createTranslationUnitFromSourceFile(). The user can now
specify if the diagnostics from Clang are printed to stderr or are silenced completely. We can
obviously evolve this API to be more general in the future.

Note: Added a FIXME since I wasn't certain what was the best way to redirect to something analogous
to '/dev/null' on Windows.

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

15 years agoParse a simple-template-id following a '~' when calling a destructor, e.g.,
Douglas Gregor [Mon, 19 Oct 2009 22:04:39 +0000 (22:04 +0000)]
Parse a simple-template-id following a '~' when calling a destructor, e.g.,

  t->~T<A0, A1>()

Fixes PR5213.

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

15 years agoThe constructor for ASTUnit now takes a DiagnosticClient*, allowing uses of ASTUnit...
Ted Kremenek [Mon, 19 Oct 2009 21:44:57 +0000 (21:44 +0000)]
The constructor for ASTUnit now takes a DiagnosticClient*, allowing uses of ASTUnit to specify
alternate DiagnosticClients. To match this API, ASTUnit::LoadFromPCHFile() now takes a corresponding
DiagnosticClient* argument as well. The DiagnosticClient object is destroyed when the ASTUnit object
is destroyed.

The CIndex library now uses this API to create a 'IgnoreDiagnosticsClient' that simply silences
diagnostics when using the clang_createTranslationUnitFromSourceFile() function. This fixes
<rdar://problem/7312058>. This API can change in the future as we add more flexibility for clients.

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

15 years agoAdd the built-in candidate set reduction hueristic
Fariborz Jahanian [Mon, 19 Oct 2009 21:30:45 +0000 (21:30 +0000)]
Add the built-in candidate set reduction hueristic
to '+=', '-=', '*=' and '/=' builtin operators and
fixes a logic bug exposed by doing this.

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

15 years agoRe-order includes so that the logic involving '#ifdef LLVM_ON_WIN32' appears after...
Ted Kremenek [Mon, 19 Oct 2009 21:17:25 +0000 (21:17 +0000)]
Re-order includes so that the logic involving '#ifdef LLVM_ON_WIN32' appears after the main #includes.  The ultimate solution is to just use LLVM-portable methods in llvm/System.

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

15 years agoCopy conversion of an expression to its base class
Fariborz Jahanian [Mon, 19 Oct 2009 19:18:20 +0000 (19:18 +0000)]
Copy conversion of an expression to its base class
is a standard convesion and not a user-defined
conversion.

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

15 years agoHandle emitting the assignment operator when the lhs is a reference. Fixes PR5227.
Anders Carlsson [Mon, 19 Oct 2009 18:28:22 +0000 (18:28 +0000)]
Handle emitting the assignment operator when the lhs is a reference. Fixes PR5227.

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

15 years agoSet the cast kind to CK_NoOp for C-style casts that are really const casts. Fixes...
Anders Carlsson [Mon, 19 Oct 2009 18:14:28 +0000 (18:14 +0000)]
Set the cast kind to CK_NoOp for C-style casts that are really const casts. Fixes PR5248.

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

15 years agoMove Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.
Steve Naroff [Mon, 19 Oct 2009 14:34:22 +0000 (14:34 +0000)]
Move Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.

Removing this shared data should enable clang_createTranslationUnit/clang_createTranslationUnitFromSourceFile to be run from multiple threads (related to <rdar://problem/7303432>).

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

15 years agoChange indenting for case/compound statements to conform to the rest of clang.
Steve Naroff [Mon, 19 Oct 2009 13:41:39 +0000 (13:41 +0000)]
Change indenting for case/compound statements to conform to the rest of clang.

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

15 years agoCIndex: make variable non-static to avoid potential race conditions, per
Benjamin Kramer [Mon, 19 Oct 2009 10:20:24 +0000 (10:20 +0000)]
CIndex: make variable non-static to avoid potential race conditions, per
Daniel's comment.

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

15 years agoWorkaround a bug exposed by the FileCheckify of message-length.c, the caret end
Daniel Dunbar [Mon, 19 Oct 2009 09:11:21 +0000 (09:11 +0000)]
Workaround a bug exposed by the FileCheckify of message-length.c, the caret end
column computation isn't correct and could exceed the line length, which
resulted in a buffer overflow later.
 - Chris, is there a better way for this code to compute the final column used
   by the caret?

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

15 years agoAuroraUX toolchain should call GNU assembler not the Solaris assembler.
Edward O'Callaghan [Mon, 19 Oct 2009 07:02:08 +0000 (07:02 +0000)]
AuroraUX toolchain should call GNU assembler not the Solaris assembler.

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

15 years agoconvert this to FileCheck, PR5232
Chris Lattner [Mon, 19 Oct 2009 06:45:49 +0000 (06:45 +0000)]
convert this to FileCheck, PR5232

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

15 years agoAvoid std::string concatenation.
Daniel Dunbar [Mon, 19 Oct 2009 01:21:19 +0000 (01:21 +0000)]
Avoid std::string concatenation.

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

15 years agoUpdate NamedDecl::getName() to work for empty names.
Daniel Dunbar [Mon, 19 Oct 2009 01:21:12 +0000 (01:21 +0000)]
Update NamedDecl::getName() to work for empty names.
 - I'm not sure this is ideal, but otherwise clients must be overly careful when handling decl's which can have empty names.

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

15 years agoTwinify CodeGenFunction::CreateTempAlloca
Daniel Dunbar [Mon, 19 Oct 2009 01:21:05 +0000 (01:21 +0000)]
Twinify CodeGenFunction::CreateTempAlloca

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

15 years agoAdd ObjCImplementationDecl::getName() for consistency, with FIXME.
Daniel Dunbar [Mon, 19 Oct 2009 01:20:57 +0000 (01:20 +0000)]
Add ObjCImplementationDecl::getName() for consistency, with FIXME.

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

15 years agoAdd FIXME calling for rename of NamedDecl::getNameAsString.
Daniel Dunbar [Mon, 19 Oct 2009 01:20:50 +0000 (01:20 +0000)]
Add FIXME calling for rename of NamedDecl::getNameAsString.

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

15 years agoSuppress build warning.
Daniel Dunbar [Mon, 19 Oct 2009 01:20:42 +0000 (01:20 +0000)]
Suppress build warning.

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

15 years agoWhen binding a reference to a temporary, it's important that other temporaries create...
Anders Carlsson [Sun, 18 Oct 2009 23:09:21 +0000 (23:09 +0000)]
When binding a reference to a temporary, it's important that other temporaries created as on the RHS are destroyed before emitting the dtor for the temporary.

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

15 years agoFix tyop noticed by Sean Hunt.
Anders Carlsson [Sun, 18 Oct 2009 22:10:32 +0000 (22:10 +0000)]
Fix tyop noticed by Sean Hunt.

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

15 years agoWhen building a cast argument, make sure to bind the result to a temporary.
Anders Carlsson [Sun, 18 Oct 2009 21:20:14 +0000 (21:20 +0000)]
When building a cast argument, make sure to bind the result to a temporary.

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

15 years agoPR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
Daniel Dunbar [Sun, 18 Oct 2009 21:17:35 +0000 (21:17 +0000)]
PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

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

15 years agoConvert temporaries.cpp to using FileCheck.
Anders Carlsson [Sun, 18 Oct 2009 21:11:11 +0000 (21:11 +0000)]
Convert temporaries.cpp to using FileCheck.

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

15 years agoAdd test for OpenCL vector initializer codegen
Nate Begeman [Sun, 18 Oct 2009 21:04:35 +0000 (21:04 +0000)]
Add test for OpenCL vector initializer codegen

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

15 years agoRename temp-1.cpp to temporaries.cpp.
Anders Carlsson [Sun, 18 Oct 2009 20:58:38 +0000 (20:58 +0000)]
Rename temp-1.cpp to temporaries.cpp.

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

15 years agoTwinify CGObjCMac, this simplifies the code and should reduce std::string
Daniel Dunbar [Sun, 18 Oct 2009 20:48:59 +0000 (20:48 +0000)]
Twinify CGObjCMac, this simplifies the code and should reduce std::string
trashing.

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

15 years agoUse CK_BitCast for member function pointer casts. Fixes PR5138.
Anders Carlsson [Sun, 18 Oct 2009 20:31:03 +0000 (20:31 +0000)]
Use CK_BitCast for member function pointer casts. Fixes PR5138.

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

15 years agoMove misc clients to IdentifierInfo StringRef API.
Daniel Dunbar [Sun, 18 Oct 2009 20:26:27 +0000 (20:26 +0000)]
Move misc clients to IdentifierInfo StringRef API.
 - strcmp -> ==
 - OS.write(II->getName() ...) -> OS << II->getNameStr()
 - Avoid std::string concatenation
 - Use getNameStr().str() when an std::string is really needed.

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

15 years agoMove clients to use IdentifierInfo::getNameStart() instead of getName()
Daniel Dunbar [Sun, 18 Oct 2009 20:26:12 +0000 (20:26 +0000)]
Move clients to use IdentifierInfo::getNameStart() instead of getName()

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

15 years agoAdd ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.
Daniel Dunbar [Sun, 18 Oct 2009 20:25:46 +0000 (20:25 +0000)]
Add ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.

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

15 years agoSupport IRgen of OpenCL vector initializers, ensuring the resulting IR is in a
Nate Begeman [Sun, 18 Oct 2009 20:10:40 +0000 (20:10 +0000)]
Support IRgen of OpenCL vector initializers, ensuring the resulting IR is in a
form that LLVM code generators can turn into efficient code.  For example,
int4 a, b, c;
a = (int4)(b.yzw, a.x)

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

15 years agoTry to unbreak MSVC build.
Benjamin Kramer [Sun, 18 Oct 2009 19:59:44 +0000 (19:59 +0000)]
Try to unbreak MSVC build.

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

15 years agoIt's OK for a pure virtual function to override another pure virtual function. Fixes...
Anders Carlsson [Sun, 18 Oct 2009 19:34:08 +0000 (19:34 +0000)]
It's OK for a pure virtual function to override another pure virtual function. Fixes PR5222.

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

15 years agoAdd FloatingCast to getCastKindName's list.
Benjamin Kramer [Sun, 18 Oct 2009 19:02:15 +0000 (19:02 +0000)]
Add FloatingCast to getCastKindName's list.

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

15 years agonon-POD members => make it a class (also silences MSVC warnings)
Benjamin Kramer [Sun, 18 Oct 2009 18:56:13 +0000 (18:56 +0000)]
non-POD members => make it a class (also silences MSVC warnings)

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

15 years agoAdd some more cast kinds.
Anders Carlsson [Sun, 18 Oct 2009 18:12:03 +0000 (18:12 +0000)]
Add some more cast kinds.

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

15 years agoCIndex: fix typo.
Benjamin Kramer [Sun, 18 Oct 2009 16:52:07 +0000 (16:52 +0000)]
CIndex: fix typo.

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

15 years agoMissed a paren.
Benjamin Kramer [Sun, 18 Oct 2009 16:20:58 +0000 (16:20 +0000)]
Missed a paren.

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

15 years agoCIndex: add a (untested) WIN32 codepath to get ClangPath.
Benjamin Kramer [Sun, 18 Oct 2009 16:13:48 +0000 (16:13 +0000)]
CIndex: add a (untested) WIN32 codepath to get ClangPath.

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

15 years agoCIndex: compute ClangPath lazily.
Benjamin Kramer [Sun, 18 Oct 2009 16:11:04 +0000 (16:11 +0000)]
CIndex: compute ClangPath lazily.

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

15 years agoadd support for codegening CXXZeroInitValueExprs
Nuno Lopes [Sun, 18 Oct 2009 15:18:11 +0000 (15:18 +0000)]
add support for codegening CXXZeroInitValueExprs

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

15 years agoIgnore all the test output directories that lit generates.
Sebastian Redl [Sun, 18 Oct 2009 14:56:09 +0000 (14:56 +0000)]
Ignore all the test output directories that lit generates.

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

15 years agoThe AuroraUX toolchain has conflicting wchar_t between the system stdlib.h header...
Edward O'Callaghan [Sun, 18 Oct 2009 13:33:59 +0000 (13:33 +0000)]
The AuroraUX toolchain has conflicting wchar_t between the system stdlib.h header and the clang stddef.h header where clang was defining as int where we use long.

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

15 years agoUse sys::Path::eraseFromDisk instead of unlink as suggested by Chris.
Benjamin Kramer [Sun, 18 Oct 2009 11:34:14 +0000 (11:34 +0000)]
Use sys::Path::eraseFromDisk instead of unlink as suggested by Chris.

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

15 years agoCIndex: replace fork/exec with our portable ExecuteAndWait wrapper.
Benjamin Kramer [Sun, 18 Oct 2009 11:19:36 +0000 (11:19 +0000)]
CIndex: replace fork/exec with our portable ExecuteAndWait wrapper.

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

15 years agoCIndex: avoid a dangling pointer issue.
Benjamin Kramer [Sun, 18 Oct 2009 11:10:55 +0000 (11:10 +0000)]
CIndex: avoid a dangling pointer issue.

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

15 years agoWhen performing template-substitution into a type, don't just replace the
John McCall [Sun, 18 Oct 2009 09:09:24 +0000 (09:09 +0000)]
When performing template-substitution into a type, don't just replace the
TemplateTypeParmType with the substituted type directly;  instead, replace it
with a SubstTemplateTypeParmType which will note that the type was originally
written as a template type parameter.  This makes it reasonable to preserve
source information even through template substitution.

Also define the new SubstTemplateTypeParmType class, obviously.

For consistency with current behavior, we stringize these types as if they
were the underlying type.  I'm not sure this is the right thing to do.
At any rate, I paled at adding yet another clause to the don't-desugar 'if'
statement, so I extracted a function to do it.  The new function also does
The Right Thing more often, I think:  e.g. if we have a chain of typedefs
leading to a vector type, we will now desugar all but the last one.

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

15 years agouse DenseSet instead of SmallSet.
Zhongxing Xu [Sun, 18 Oct 2009 04:15:47 +0000 (04:15 +0000)]
use DenseSet instead of SmallSet.

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

15 years agoAdd NameDecl::getName() -> StringRef.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:45 +0000 (02:09 +0000)]
Add NameDecl::getName() -> StringRef.

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

15 years agoAdd another two ExtVectorComponent FIXMEs.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:38 +0000 (02:09 +0000)]
Add another two ExtVectorComponent FIXMEs.

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

15 years agoSwitch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:31 +0000 (02:09 +0000)]
Switch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
 - Really this should be simplified by the FIXME above, but I'm too deep in DFS.

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

15 years agoSimplify HandleModeAttr.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:24 +0000 (02:09 +0000)]
Simplify HandleModeAttr.

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

15 years agoSimplify HandleFormatAttr.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:17 +0000 (02:09 +0000)]
Simplify HandleFormatAttr.
 - I have this crazy dream that one day someone will invent a miraculous tool so
   that developers, instead of hand optimizing their source code to obscure its
   intent and decrease its maleability, will instead write what they mean, and
   this strange and wonderful tool -- which I imagine would be called something
   fancy sounding like "an optimizing compiler" -- will make their code fast
   *for* them. With all the saved time, developers could maybe even focus on
   making the magic "optimizing compiler" better!!

 - No intended functionality change, all though I expect the universe to mock me
   for snarkiness.

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

15 years agoAdd FIXME... maybe Nate will get bored? :)
Daniel Dunbar [Sun, 18 Oct 2009 02:09:09 +0000 (02:09 +0000)]
Add FIXME... maybe Nate will get bored? :)

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

15 years agoGrammaro.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:02 +0000 (02:09 +0000)]
Grammaro.

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

15 years agoClone the full Type hierarchy into the TypeLoc hierarchy. Normalize
John McCall [Sun, 18 Oct 2009 01:05:36 +0000 (01:05 +0000)]
Clone the full Type hierarchy into the TypeLoc hierarchy.  Normalize
TypeLoc class names to be $(Type classname)Loc.  Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.

Handle all cases in PCH.  Handle a few more cases when inserting
location information in SemaType.

It should be extremely straightforward to add new location information
to existing TypeLoc objects now.

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

15 years agoAttempt to unbreak the MSVC build.
Daniel Dunbar [Sat, 17 Oct 2009 23:53:11 +0000 (23:53 +0000)]
Attempt to unbreak the MSVC build.

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

15 years agoSimplify ExtVectorElementExpr::containsDuplicateElements().
Daniel Dunbar [Sat, 17 Oct 2009 23:53:04 +0000 (23:53 +0000)]
Simplify ExtVectorElementExpr::containsDuplicateElements().

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

15 years agoAdd FIXME.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:58 +0000 (23:52 +0000)]
Add FIXME.

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

15 years agoAvoid std::string concatenation.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:50 +0000 (23:52 +0000)]
Avoid std::string concatenation.

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

15 years agoStringRefize some parts of Diagnostic API.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:43 +0000 (23:52 +0000)]
StringRefize some parts of Diagnostic API.

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

15 years agoRemove unused BernsteinHash functions.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:36 +0000 (23:52 +0000)]
Remove unused BernsteinHash functions.

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