]> granicus.if.org Git - clang/log
clang
14 years agoIRgen: Move the bit-field access type into CGBitFieldInfo, and change bit-field LValu...
Daniel Dunbar [Thu, 8 Apr 2010 02:59:45 +0000 (02:59 +0000)]
IRgen: Move the bit-field access type into CGBitFieldInfo, and change bit-field LValues to just store the base address of object containing the bit-field.

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

14 years agoPatch to implement gcc's cstyle arguments in objc
Fariborz Jahanian [Thu, 8 Apr 2010 00:30:06 +0000 (00:30 +0000)]
Patch to implement gcc's cstyle arguments in objc
methods. wip.

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

14 years agorefactor out a function.
Chris Lattner [Thu, 8 Apr 2010 00:23:06 +0000 (00:23 +0000)]
refactor out a function.

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

14 years agoFix a (bogus) uninitialized-member-of-local warning.
John McCall [Thu, 8 Apr 2010 00:13:37 +0000 (00:13 +0000)]
Fix a (bogus) uninitialized-member-of-local warning.

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

14 years agoUse SmallVector instead of an std::queue.
Ted Kremenek [Thu, 8 Apr 2010 00:05:00 +0000 (00:05 +0000)]
Use SmallVector instead of an std::queue.

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

14 years agoWhen a template (without arguments) is passed as a template type
Jeffrey Yasskin [Thu, 8 Apr 2010 00:03:06 +0000 (00:03 +0000)]
When a template (without arguments) is passed as a template type
parameter, explicitly ask the user to give it arguments.  We used to
complain that it wasn't a type and expect the user to figure it out.

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

14 years agoFix some redundant errors by changing CXXScopeSpec::isSet calls into
Jeffrey Yasskin [Wed, 7 Apr 2010 23:29:58 +0000 (23:29 +0000)]
Fix some redundant errors by changing CXXScopeSpec::isSet calls into
isNotEmpty calls.

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

14 years agoupdate for api change.
Chris Lattner [Wed, 7 Apr 2010 23:12:35 +0000 (23:12 +0000)]
update for api change.

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

14 years agoImplement checking for template literal operator functions. This
Sean Hunt [Wed, 7 Apr 2010 23:11:06 +0000 (23:11 +0000)]
Implement checking for template literal operator functions. This
code won't actually get used yet because we don't handle non-type
parameter packs, but when we do, this code should jump in and work.

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

14 years agoAdd support for stpncpy_chk.
Eric Christopher [Wed, 7 Apr 2010 23:00:44 +0000 (23:00 +0000)]
Add support for stpncpy_chk.

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

14 years agorename llvm::llvm_report_error -> llvm::report_fatal_error
Chris Lattner [Wed, 7 Apr 2010 22:58:06 +0000 (22:58 +0000)]
rename llvm::llvm_report_error -> llvm::report_fatal_error

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

14 years agoUpdated comment to reflect changes made in the most recent draft.
Sean Hunt [Wed, 7 Apr 2010 22:57:35 +0000 (22:57 +0000)]
Updated comment to reflect changes made in the most recent draft.

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

14 years agoFixed 80-cols violation
Sean Hunt [Wed, 7 Apr 2010 22:52:07 +0000 (22:52 +0000)]
Fixed 80-cols violation

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

14 years agoadd a new driver-level -ferror-limit=412 option, which causes clang to stop
Chris Lattner [Wed, 7 Apr 2010 20:49:23 +0000 (20:49 +0000)]
add a new driver-level -ferror-limit=412 option, which causes clang to stop
emitting diagnostics after it has produced that many errors.  Give this a
default value of 20 which produces plenty of errors for people to fix before
recompiling but not so many that their entire console scrolls away when the
compiler gets confused.  The experience looks like this:

$ clang foo.c
<tons of crap>
foo.c:102:3: error: unknown type name 'somethingbad'
  somethingbad x;
  ^
fatal error: too many errors emitted, stopping now
36 warnings and 20 errors generated.

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

14 years agoadd clang -cc1 level support for "-ferror-limit 42"
Chris Lattner [Wed, 7 Apr 2010 20:37:06 +0000 (20:37 +0000)]
add clang -cc1 level support for "-ferror-limit 42"

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

14 years agoReturn early from Sema::MarkDeclarationReferenced when we know there
Douglas Gregor [Wed, 7 Apr 2010 20:29:57 +0000 (20:29 +0000)]
Return early from Sema::MarkDeclarationReferenced when we know there
isn't any extra work to perform. Also, don't check for unused
parameters when the warnings will be suppressed anyway. Improves
performance of -fsyntax-only on 403.gcc's combine.c by ~2.5%.
<rdar://problem/7836787>

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

14 years agoadd capabilities to stop emitting errors after some limit.
Chris Lattner [Wed, 7 Apr 2010 20:21:58 +0000 (20:21 +0000)]
add capabilities to stop emitting errors after some limit.
Right now the limit is 0 (aka disabled)

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

14 years agoDon't emit an 'unused expression' warning for '||' and '&&' expressions that contain...
Ted Kremenek [Wed, 7 Apr 2010 18:49:21 +0000 (18:49 +0000)]
Don't emit an 'unused expression' warning for '||' and '&&' expressions that contain assignments
or similar side-effects.

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

14 years agoInstead of counting totally diagnostics, split the count into a count
Chris Lattner [Wed, 7 Apr 2010 18:47:42 +0000 (18:47 +0000)]
Instead of counting totally diagnostics, split the count into a count
of errors and warnings.  This allows us to emit something like this:

2 warnings and 1 error generated.

instead of:

3 diagnostics generated.

This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.

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

14 years agoconvert to -verify mode.
Chris Lattner [Wed, 7 Apr 2010 18:43:41 +0000 (18:43 +0000)]
convert to -verify mode.

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

14 years agoImprove handling of friend types in several ways:
Douglas Gregor [Wed, 7 Apr 2010 17:57:12 +0000 (17:57 +0000)]
Improve handling of friend types in several ways:
  - When instantiating a friend type template, perform semantic
  analysis on the resulting type.
  - Downgrade the errors concerning friend type declarations that do
  not refer to classes to ExtWarns in C++98/03. C++0x allows
  practically any type to be befriended, and ignores the friend
  declaration if the type is not a class.

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

14 years agoSplit Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (for
Douglas Gregor [Wed, 7 Apr 2010 16:53:43 +0000 (16:53 +0000)]
Split Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (for
semantic analysis) and Sema::ActOnFriendTypeDecl (the action
callback). This is a prerequisite for improving template instantiation
of friend type declarations.

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

14 years ago@llvm.sqrt isn't really close enough to C's sqrt to justify emitting calls
John McCall [Wed, 7 Apr 2010 08:20:20 +0000 (08:20 +0000)]
@llvm.sqrt isn't really close enough to C's sqrt to justify emitting calls
to the intrinsic, even when math-errno is off.

Fixes rdar://problem/7828230 by falling back on the library function.

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

14 years agoa ridiculous amount of propagation through the backend later,
Chris Lattner [Wed, 7 Apr 2010 05:46:54 +0000 (05:46 +0000)]
a ridiculous amount of propagation through the backend later,
have the code generate slap a srcloc metadata on inline asm nodes.
This allows us to diagnose invalid inline asms with such nice
diagnostics as:

<inline asm>:1:2: error: unrecognized instruction
        abc incl    %eax
        ^
asm.c:2:12: note: generated from here
  __asm__ ("abc incl    %0" : "+r" (X));
           ^
2 diagnostics generated.

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

14 years agoFix comment.
Zhongxing Xu [Wed, 7 Apr 2010 04:40:26 +0000 (04:40 +0000)]
Fix comment.

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

14 years agoUpdate checker build.
Ted Kremenek [Wed, 7 Apr 2010 04:09:49 +0000 (04:09 +0000)]
Update checker build.

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

14 years agoDeprecate CXXScopeSpec::isSet() in favor of isNotEmpty() or isValid().
Jeffrey Yasskin [Wed, 7 Apr 2010 01:55:59 +0000 (01:55 +0000)]
Deprecate CXXScopeSpec::isSet() in favor of isNotEmpty() or isValid().

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

14 years agoTeach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".
John McCall [Wed, 7 Apr 2010 01:14:35 +0000 (01:14 +0000)]
Teach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".
Fixes a spurious warning in LLVM.

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

14 years agoFix crash in StoreManager::CastRegion() when the base region is a type with 0 size.
Ted Kremenek [Wed, 7 Apr 2010 00:46:49 +0000 (00:46 +0000)]
Fix crash in StoreManager::CastRegion() when the base region is a type with 0 size.

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

14 years agoCheck access for the implicit calls to destructors that occur when we
John McCall [Wed, 7 Apr 2010 00:41:46 +0000 (00:41 +0000)]
Check access for the implicit calls to destructors that occur when we
have a temporary object in C++.

Also fix a tag mismatch that Doug noticed.

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

14 years agoFix CIndex crash on invalid code reported in <rdar://problem/7833619>.
Ted Kremenek [Wed, 7 Apr 2010 00:27:13 +0000 (00:27 +0000)]
Fix CIndex crash on invalid code reported in <rdar://problem/7833619>.

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

14 years agoImprove on diagnostics when an objc class is used as
Fariborz Jahanian [Wed, 7 Apr 2010 00:22:00 +0000 (00:22 +0000)]
Improve on diagnostics when an objc class is used as
a stand-alone type declaration.

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

14 years agoImplement code completion for Objective-C method declarations and
Douglas Gregor [Wed, 7 Apr 2010 00:21:17 +0000 (00:21 +0000)]
Implement code completion for Objective-C method declarations and
definitions, e.g., after

  -

or

  - (id)

we'll find all of the "likely" instance methods that one would want to
declare or define at this point. In the latter case, we only produce
results whose return types match "id".

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

14 years agoMinor clean up.
Fariborz Jahanian [Tue, 6 Apr 2010 23:43:59 +0000 (23:43 +0000)]
Minor clean up.

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

14 years agodefault access for synthesize ivar is @protect.
Fariborz Jahanian [Tue, 6 Apr 2010 23:36:17 +0000 (23:36 +0000)]
default access for synthesize ivar is @protect.
Fixes radar 7823675.

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

14 years agoPatch to not build ivar ASTs when they are ilegally
Fariborz Jahanian [Tue, 6 Apr 2010 22:43:48 +0000 (22:43 +0000)]
Patch to not build ivar ASTs when they are ilegally
declared in categories.

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

14 years agoDevote a special diagnostic to the typo
John McCall [Tue, 6 Apr 2010 22:24:14 +0000 (22:24 +0000)]
Devote a special diagnostic to the typo
  (void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.

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

14 years agoTeach MemRegion::getBaseRegion() about ObjCIvarRegions. We want to treat
Ted Kremenek [Tue, 6 Apr 2010 22:06:03 +0000 (22:06 +0000)]
Teach MemRegion::getBaseRegion() about ObjCIvarRegions.  We want to treat
them the same way as fields.  This fixes a regression in RegionStore::RemoveDeadbindings()
that emerged from going to the cluster-based analysis.

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

14 years agoImplement the protected access restriction ([class.protected]), which requires
John McCall [Tue, 6 Apr 2010 21:38:20 +0000 (21:38 +0000)]
Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the
naming class of the lookup.  My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.

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

14 years agoWhen code completion produces an overload set as its results (e.g.,
Douglas Gregor [Tue, 6 Apr 2010 20:19:47 +0000 (20:19 +0000)]
When code completion produces an overload set as its results (e.g.,
while we're completing in the middle of a function call), also produce
"ordinary" name results that show what can be typed at that point.

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

14 years agoDo not produce semicolons at the end of code-completion results
Douglas Gregor [Tue, 6 Apr 2010 20:11:37 +0000 (20:11 +0000)]
Do not produce semicolons at the end of code-completion results

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

14 years agoOnly prove macros as code-completion results when we're in a case
Douglas Gregor [Tue, 6 Apr 2010 20:02:15 +0000 (20:02 +0000)]
Only prove macros as code-completion results when we're in a case
statement or for ordinary names. This means that we won't show macros
when completing, e.g., member expressions such as "p->".

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

14 years agoFix ccc-analyzer's handling of quoted arguments in the build command. Fixes PR 6791.[B
Ted Kremenek [Tue, 6 Apr 2010 19:41:24 +0000 (19:41 +0000)]
Fix ccc-analyzer's handling of quoted arguments in the build command.  Fixes PR 6791.[B

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

14 years agoWhen sending a message to "id", apply some heuristics to try to narrow
Douglas Gregor [Tue, 6 Apr 2010 19:22:33 +0000 (19:22 +0000)]
When sending a message to "id", apply some heuristics to try to narrow
down the set of code-completion results based on Objective-C
conventions.

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

14 years agoadd a testcase that the integrated assembler rejects, this verifies
Chris Lattner [Tue, 6 Apr 2010 18:46:25 +0000 (18:46 +0000)]
add a testcase that the integrated assembler rejects, this verifies
that the integrated assembler is working.

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

14 years agoteach clang to install the inline asm diagnostic handler,
Chris Lattner [Tue, 6 Apr 2010 18:38:50 +0000 (18:38 +0000)]
teach clang to install the inline asm diagnostic handler,
allowing backend errors to be mapped through clang's
diagnostics subsystem, including the backend location info.

We now get:

$ clang asm.c -c -o t.o -integrated-as
<inline asm>:1:2: error: unrecognized instruction
        abc incl    %eax
        ^
1 diagnostic generated.

With colors, and correct "# diagnostics generated".

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

14 years agoreduce indentation, tidy.
Chris Lattner [Tue, 6 Apr 2010 17:52:14 +0000 (17:52 +0000)]
reduce indentation, tidy.

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

14 years agoimproved wording around ABI
Blaine Garst [Tue, 6 Apr 2010 17:46:43 +0000 (17:46 +0000)]
improved wording around ABI

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

14 years agoMake code-completion for Objective-C message sends to "id" work in the
Douglas Gregor [Tue, 6 Apr 2010 17:30:22 +0000 (17:30 +0000)]
Make code-completion for Objective-C message sends to "id" work in the
presence of precompiled headers by forcibly loading all of the
methods we know about from the PCH file before constructing our
code-completion list.

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

14 years agofit in 80 cols
Chris Lattner [Tue, 6 Apr 2010 17:29:22 +0000 (17:29 +0000)]
fit in 80 cols

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

14 years agoPut type restriction on convesion to nonconforming 'id' back in
Fariborz Jahanian [Tue, 6 Apr 2010 17:23:39 +0000 (17:23 +0000)]
Put type restriction on convesion to nonconforming 'id' back in
block pointer type comparison.

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

14 years agoDriver: Add a Tool::hasGoodDiagnostics hook, and use it to simplify logic for
Daniel Dunbar [Tue, 6 Apr 2010 17:07:49 +0000 (17:07 +0000)]
Driver: Add a Tool::hasGoodDiagnostics hook, and use it to simplify logic for
deciding when we need to emit an extra "command failed" diagnostic.
 - This also fixes the case where we were emitting that extra diagnostics, even
   when using clang w/ the integrated assembler, which has good diagnostics.

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

14 years agoImplement support for code completion of an Objective-C message send to
Douglas Gregor [Tue, 6 Apr 2010 16:40:00 +0000 (16:40 +0000)]
Implement support for code completion of an Objective-C message send to
"id" or an expression of type "id". In these cases, we produce a list
of all of the (class or instance) methods, respectively, that we know about.

Note that this implementation does not yet work well with precompiled
headers; that's coming soon.

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

14 years agoAdd test for code completion of Objective-C message sends to classes.
Douglas Gregor [Tue, 6 Apr 2010 15:27:03 +0000 (15:27 +0000)]
Add test for code completion of Objective-C message sends to classes.

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

14 years agoPerform code-completion within ParseCastExpression, which handles,
Douglas Gregor [Tue, 6 Apr 2010 15:09:27 +0000 (15:09 +0000)]
Perform code-completion within ParseCastExpression, which handles,
e.g., the right-hand side of binary expressions.

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

14 years agoclang-wpa fixes for Diagnostic
Douglas Gregor [Tue, 6 Apr 2010 04:03:12 +0000 (04:03 +0000)]
clang-wpa fixes for Diagnostic

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

14 years agoFix PR 6725. It looks like the copy constructor gets elided during inlining.
Zhongxing Xu [Tue, 6 Apr 2010 03:01:56 +0000 (03:01 +0000)]
Fix PR 6725. It looks like the copy constructor gets elided during inlining.
This bug only shows up with GCC 4.4.1 Release-Asserts build.

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

14 years agoUnbreak build
Douglas Gregor [Tue, 6 Apr 2010 01:25:58 +0000 (01:25 +0000)]
Unbreak build

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

14 years agoIRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
Daniel Dunbar [Tue, 6 Apr 2010 01:07:44 +0000 (01:07 +0000)]
IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.

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

14 years agoSimplify.
Daniel Dunbar [Tue, 6 Apr 2010 01:07:41 +0000 (01:07 +0000)]
Simplify.

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

14 years agoSimplify.
Daniel Dunbar [Tue, 6 Apr 2010 01:07:39 +0000 (01:07 +0000)]
Simplify.

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

14 years agoMake Diagnostic reference-counted, which is simpler than juggling
Douglas Gregor [Mon, 5 Apr 2010 23:52:57 +0000 (23:52 +0000)]
Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.

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

14 years agoUse cast<> + OpaquePtr.getAs<Decl> to add extra checking of our assumptions.
Ted Kremenek [Mon, 5 Apr 2010 23:45:09 +0000 (23:45 +0000)]
Use cast<> + OpaquePtr.getAs<Decl> to add extra checking of our assumptions.

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

14 years agoinline in MC assembly parsers. clang -integrated-as now
Chris Lattner [Mon, 5 Apr 2010 23:33:20 +0000 (23:33 +0000)]
inline in MC assembly parsers.  clang -integrated-as now
works with inline asm!

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

14 years agoMatch MemoryBuffer API changes.
Chris Lattner [Mon, 5 Apr 2010 22:42:27 +0000 (22:42 +0000)]
Match MemoryBuffer API changes.

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

14 years agoFix possible null dereference by bailing out of CheckObjCPropertyAttributes() early...
Ted Kremenek [Mon, 5 Apr 2010 22:39:42 +0000 (22:39 +0000)]
Fix possible null dereference by bailing out of CheckObjCPropertyAttributes() early if the Decl* is null.

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

14 years agoGrrrr
Douglas Gregor [Mon, 5 Apr 2010 21:47:48 +0000 (21:47 +0000)]
Grrrr

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

14 years agoTry to de-bork build of WPA
Douglas Gregor [Mon, 5 Apr 2010 21:47:24 +0000 (21:47 +0000)]
Try to de-bork build of WPA

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

14 years agoIRgen: Move BitField LValues to just hold a reference to the CGBitFieldInfo.
Daniel Dunbar [Mon, 5 Apr 2010 21:36:35 +0000 (21:36 +0000)]
IRgen: Move BitField LValues to just hold a reference to the CGBitFieldInfo.
 - Unfortunately, this requires some horrible code in CGObjCMac which always
   allocats a CGBitFieldInfo because we don't currently build a proper layout
   for Objective-C classes. It needs to be cleaned up, but I don't want the
   bit-field cleanups to be blocked on that.

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

14 years agoExtend the type printing policy to allow one to turn off the printing
Douglas Gregor [Mon, 5 Apr 2010 21:25:31 +0000 (21:25 +0000)]
Extend the type printing policy to allow one to turn off the printing
of file locations for anonymous tag types (e.g., "enum <anonymous at
t.h:15:6>"), which can get rather long.

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

14 years agoPrint the errors when a clang test fails instead of just listing the
Jeffrey Yasskin [Mon, 5 Apr 2010 21:20:38 +0000 (21:20 +0000)]
Print the errors when a clang test fails instead of just listing the
failing test files.

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

14 years agoClarify the ownership semantics of the Diagnostic object used by
Douglas Gregor [Mon, 5 Apr 2010 21:10:19 +0000 (21:10 +0000)]
Clarify the ownership semantics of the Diagnostic object used by
ASTUnit. Previously, we would end up with use-after-free errors
because the Diagnostic object would be creating in one place (say,
CIndex) and its ownership would not be transferred into the
ASTUnit. Fixes <rdar://problem/7818608>.

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

14 years agoEmit debug info for objc getters and setters.
Devang Patel [Mon, 5 Apr 2010 21:09:15 +0000 (21:09 +0000)]
Emit debug info for objc getters and setters.

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

14 years agofix PR6780, properly handling the IR {|} escapes in inline asm strings.
Chris Lattner [Mon, 5 Apr 2010 18:44:00 +0000 (18:44 +0000)]
fix PR6780, properly handling the IR {|} escapes in inline asm strings.

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

14 years agoMake the ASTUnit constructor private; all ASTUnit clients should be using the static...
Douglas Gregor [Mon, 5 Apr 2010 18:20:14 +0000 (18:20 +0000)]
Make the ASTUnit constructor private; all ASTUnit clients should be using the static factory functions

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

14 years agofix PR6782, an accept invalid. We weren't emitting the diagnostic
Chris Lattner [Mon, 5 Apr 2010 18:18:31 +0000 (18:18 +0000)]
fix PR6782, an accept invalid.  We weren't emitting the diagnostic
returned by SetTypeSpecType.

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

14 years agoMinor ASTUnit cleanups:
Douglas Gregor [Mon, 5 Apr 2010 18:10:21 +0000 (18:10 +0000)]
Minor ASTUnit cleanups:
  - Rename "Diagnostics" and related to "StoredDiagnostics", to better
  capture what we're actually storing.
  - Move SourceManager and FileManager to the heap.

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

14 years agoIRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.
Daniel Dunbar [Mon, 5 Apr 2010 16:20:44 +0000 (16:20 +0000)]
IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.

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

14 years agoAdd a FIXME and reduce nesting.
Daniel Dunbar [Mon, 5 Apr 2010 16:20:33 +0000 (16:20 +0000)]
Add a FIXME and reduce nesting.

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

14 years agoCode completion results that refer to macros now get the cursor kind
Douglas Gregor [Mon, 5 Apr 2010 16:10:30 +0000 (16:10 +0000)]
Code completion results that refer to macros now get the cursor kind
of macro definitions when passed to CIndex. Add test for code
completion of macros via CIndex.

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

14 years agoAlways assume block-level expressions in the caller are alive when analyzing
Zhongxing Xu [Mon, 5 Apr 2010 13:16:29 +0000 (13:16 +0000)]
Always assume block-level expressions in the caller are alive when analyzing
the callee.

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

14 years agoSince now we process regions in clusters when removing dead bindings, this
Zhongxing Xu [Mon, 5 Apr 2010 13:00:12 +0000 (13:00 +0000)]
Since now we process regions in clusters when removing dead bindings, this
code can be removed.

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

14 years agoReapply patch for adding support for address spaces and added a isVolatile field...
Mon P Wang [Sun, 4 Apr 2010 03:10:52 +0000 (03:10 +0000)]
Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.

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

14 years agoDon't produce a vtable for a class if we have an explicit template instantiation...
Rafael Espindola [Sat, 3 Apr 2010 04:26:42 +0000 (04:26 +0000)]
Don't produce a vtable for a class if we have an explicit template instantiation declaration and no key function. We will produce the vtable at the explicit template instantiation.

Fixes PR6748

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

14 years agoAdd option and macro definition for AES instructions. Now produces real
Eric Christopher [Fri, 2 Apr 2010 23:50:19 +0000 (23:50 +0000)]
Add option and macro definition for AES instructions.  Now produces real
assembly for testcases.

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

14 years agoImprove diagnosing when a method type does not start with '-'|'+'
Fariborz Jahanian [Fri, 2 Apr 2010 23:15:40 +0000 (23:15 +0000)]
Improve diagnosing when a method type does not start with '-'|'+'
when parsing. Fixes radar 7822196.

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

14 years agoIRgen/NeXT: Remove my refactoring-enabling asserts, and add a FIXME.
Daniel Dunbar [Fri, 2 Apr 2010 22:29:40 +0000 (22:29 +0000)]
IRgen/NeXT: Remove my refactoring-enabling asserts, and add a FIXME.

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

14 years agoAvoid unneeded calls to opt/llvm-dis.
Daniel Dunbar [Fri, 2 Apr 2010 22:29:38 +0000 (22:29 +0000)]
Avoid unneeded calls to opt/llvm-dis.

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

14 years agoMerge several tests into switch.c.
Daniel Dunbar [Fri, 2 Apr 2010 22:29:35 +0000 (22:29 +0000)]
Merge several tests into switch.c.

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

14 years agoIRgen/Obj-C: Eliminate FindIvarInterface, now that ivar's are in the right DeclContex...
Daniel Dunbar [Fri, 2 Apr 2010 21:14:02 +0000 (21:14 +0000)]
IRgen/Obj-C: Eliminate FindIvarInterface, now that ivar's are in the right DeclContexts (-2 FIXMEs). We still have an annoying linear scan + hidden dependency on how Obj-C layout is done.
 - This is also an algorithmic improvement in IRgen for Obj-C, although it probably doesn't matter in practice.

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

14 years agoAST: Add ObjCIvarDecl::getContainingInterface().
Daniel Dunbar [Fri, 2 Apr 2010 21:13:59 +0000 (21:13 +0000)]
AST: Add ObjCIvarDecl::getContainingInterface().

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

14 years agodiagnose declaring class extension after its implementation
Fariborz Jahanian [Fri, 2 Apr 2010 20:53:05 +0000 (20:53 +0000)]
diagnose declaring class extension after its implementation
(radar 7822210).

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

14 years agoNewDebugLoc got renamed to DebugLoc.
Chris Lattner [Fri, 2 Apr 2010 20:21:43 +0000 (20:21 +0000)]
NewDebugLoc got renamed to DebugLoc.

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

14 years agoSema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional invariants...
Daniel Dunbar [Fri, 2 Apr 2010 20:10:03 +0000 (20:10 +0000)]
Sema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional invariants on the provided DeclContext.
 - Doug, please see the FIXME in DeclObjC.cpp -- I am not sure what the right fix is.

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

14 years agoDiagnose invalid code with -fobjc-nonfragile-abi2 when
Fariborz Jahanian [Fri, 2 Apr 2010 20:09:24 +0000 (20:09 +0000)]
Diagnose invalid code with -fobjc-nonfragile-abi2 when
property is being accessed without the dot-syntax notation.
(radar 7822344).

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

14 years agoSema/Obj-C: Narrow type, and simplify.
Daniel Dunbar [Fri, 2 Apr 2010 19:44:54 +0000 (19:44 +0000)]
Sema/Obj-C: Narrow type, and simplify.

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

14 years agoWe seem to get an inconsistent alignment value in the generated
Douglas Gregor [Fri, 2 Apr 2010 19:02:06 +0000 (19:02 +0000)]
We seem to get an inconsistent alignment value in the generated
assembly for the global "d7". We were previously testing for alignment
3, which seems to happen for some builders and not for others. I've
eliminated the alignment check and added a FIXME to unbreak the
buildbots.

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

14 years agoRevert r100193 since it causes failures in objc in clang
Mon P Wang [Fri, 2 Apr 2010 18:43:42 +0000 (18:43 +0000)]
Revert r100193 since it causes failures in objc in clang

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

14 years agoSema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow type.
Daniel Dunbar [Fri, 2 Apr 2010 18:29:09 +0000 (18:29 +0000)]
Sema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow type.

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

14 years agoRework our handling of copy construction of temporaries, which was a
Douglas Gregor [Fri, 2 Apr 2010 18:24:57 +0000 (18:24 +0000)]
Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.

This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.

Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.

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