]> granicus.if.org Git - clang/log
clang
15 years agoPatch by Nikita Zhuk:
Ted Kremenek [Thu, 30 Oct 2008 15:13:43 +0000 (15:13 +0000)]
Patch by Nikita Zhuk:

Fix PR 2978 false positive for missing release in -dealloc of an ivar retained via a property and then released by assigning nil to that property:

  http://llvm.org/bugs/show_bug.cgi?id=2978

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

15 years agoMake sure RewriteObjCMethodDecl() does a block pointer rewrite.
Steve Naroff [Thu, 30 Oct 2008 14:45:29 +0000 (14:45 +0000)]
Make sure RewriteObjCMethodDecl() does a block pointer rewrite.

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

15 years agoFix arithmetic type check
Douglas Gregor [Thu, 30 Oct 2008 13:47:07 +0000 (13:47 +0000)]
Fix arithmetic type check

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

15 years agoAdd a couple fixes for rewriting ivars/methods that use/contain blocks.
Steve Naroff [Thu, 30 Oct 2008 12:09:33 +0000 (12:09 +0000)]
Add a couple fixes for rewriting ivars/methods that use/contain blocks.

Now this:

@interface Test
{
  void (^ivar)(void);
}
- (void)name;
@end

@implementation Test
- (void)name {
  ivar = ^{ printf("hello\n"); }; // ((struct Test_IMPL *)self)->ivar = (void (*)(void))&__name_block_impl_0((void *)__name_block_func_0);
  ivar(); // ((void (*)(struct __block_impl *))((struct __block_impl *)((struct Test_IMPL *)self)->ivar)->FuncPtr)((struct __block_impl *)((struct Test_IMPL *)self)->ivar);
}

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

15 years agoConvert SynthesizeBlockCall() from test->AST based implementation.
Steve Naroff [Thu, 30 Oct 2008 10:07:53 +0000 (10:07 +0000)]
Convert SynthesizeBlockCall() from test->AST based implementation.

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

15 years agoMerge the array and struct case. They are essentially the same.
Zhongxing Xu [Thu, 30 Oct 2008 05:35:59 +0000 (05:35 +0000)]
Merge the array and struct case. They are essentially the same.

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

15 years agoRename:
Zhongxing Xu [Thu, 30 Oct 2008 05:33:54 +0000 (05:33 +0000)]
Rename:
 - SetSVal(GRState*, Loc, SVal) => BindLoc
 - SetSVal(GRState*, Expr*, SVal) => BindExpr

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

15 years agoAdjust code format.
Zhongxing Xu [Thu, 30 Oct 2008 05:03:28 +0000 (05:03 +0000)]
Adjust code format.

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

15 years agoImplement VisitInitListExpr(). InitListExpr will have a nonloc::CompoundVal value.
Zhongxing Xu [Thu, 30 Oct 2008 05:02:23 +0000 (05:02 +0000)]
Implement VisitInitListExpr(). InitListExpr will have a nonloc::CompoundVal value.

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

15 years agoAdd CompoundVal and CompoundValData for representing the value of InitListExpr.
Zhongxing Xu [Thu, 30 Oct 2008 04:58:00 +0000 (04:58 +0000)]
Add CompoundVal and CompoundValData for representing the value of InitListExpr.

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

15 years agoFix 80-col.
Zhongxing Xu [Thu, 30 Oct 2008 04:53:23 +0000 (04:53 +0000)]
Fix 80-col.

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

15 years agoFix specification references link.
Daniel Dunbar [Thu, 30 Oct 2008 00:53:12 +0000 (00:53 +0000)]
Fix specification references link.

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

15 years agoMark yy_fatal_error as a panic function.
Ted Kremenek [Thu, 30 Oct 2008 00:00:57 +0000 (00:00 +0000)]
Mark yy_fatal_error as a panic function.

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

15 years agoImprove documentation for Sema::CheckReferenceInit
Douglas Gregor [Wed, 29 Oct 2008 23:31:03 +0000 (23:31 +0000)]
Improve documentation for Sema::CheckReferenceInit

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

15 years agoNeXT: Emit protocol objects lazily.
Daniel Dunbar [Wed, 29 Oct 2008 22:36:39 +0000 (22:36 +0000)]
NeXT: Emit protocol objects lazily.
 - That is, the metadata for a protocol is only emitted if that
   protocol is actually used in the translation unit. This is
   important because Objective-C headers frequently contain a large
   number of protocol definitions, only a few of which will be used in
   any given file.

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

15 years agoConvert SynthBlockInitExpr() from text->AST based implementation.
Steve Naroff [Wed, 29 Oct 2008 21:23:59 +0000 (21:23 +0000)]
Convert SynthBlockInitExpr() from text->AST based implementation.

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

15 years agoRemove workaround for reference. No longer necessary.
Sebastian Redl [Wed, 29 Oct 2008 19:45:21 +0000 (19:45 +0000)]
Remove workaround for reference. No longer necessary.

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

15 years agoFix missing %s in run string causing hang during tests.
Sebastian Redl [Wed, 29 Oct 2008 19:29:09 +0000 (19:29 +0000)]
Fix missing %s in run string causing hang during tests.

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

15 years agoFix crash reported in PR2923 where a function declared using typeof(another_function...
Ted Kremenek [Wed, 29 Oct 2008 18:41:34 +0000 (18:41 +0000)]
Fix crash reported in PR2923 where a function declared using typeof(another_function) would have FunctionDecl::getNumParams() return the number of parameters in the original function type and not the number of parameters in the actual FunctionDecl.

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

15 years agoHandle block literals at file scope, remove some dead code, etc.
Steve Naroff [Wed, 29 Oct 2008 18:15:37 +0000 (18:15 +0000)]
Handle block literals at file scope, remove some dead code, etc.

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

15 years agoMake the non-reference check in Expr work always
Douglas Gregor [Wed, 29 Oct 2008 18:00:54 +0000 (18:00 +0000)]
Make the non-reference check in Expr work always

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

15 years agoSimplify and correct the check for function redefinitions. This does two things:
Douglas Gregor [Wed, 29 Oct 2008 15:10:40 +0000 (15:10 +0000)]
Simplify and correct the check for function redefinitions. This does two things:

  - Allows definitions of overloaded functions :)
  - Eliminates extraneous error messages when we have a definition of a
    function that isn't an overload but doesn't have exactly the same type
    as the original.

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

15 years agoImplement overloading rules for reference binding
Douglas Gregor [Wed, 29 Oct 2008 14:50:44 +0000 (14:50 +0000)]
Implement overloading rules for reference binding

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

15 years agoMake sure internally synthesized block pointer types are converted before pretty...
Steve Naroff [Wed, 29 Oct 2008 14:49:46 +0000 (14:49 +0000)]
Make sure internally synthesized block pointer types are converted before pretty printing.

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

15 years agoTemporary disable the const-object-declaration-without-initializer check, because...
Douglas Gregor [Wed, 29 Oct 2008 13:50:18 +0000 (13:50 +0000)]
Temporary disable the const-object-declaration-without-initializer check, because it depends on linkage-specifier semantics we don't yet have

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

15 years agoWorkaround an LLVM bug where inlining functions with debug info breaks
Daniel Dunbar [Wed, 29 Oct 2008 08:50:02 +0000 (08:50 +0000)]
Workaround an LLVM bug where inlining functions with debug info breaks
code generation.
 - For now, disable running the always inliner pass (at -O0) if we are
   also generating debug information.

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

15 years agoImprove llvm-gcc compatibility, -Os implies -O2 (sortof).
Daniel Dunbar [Wed, 29 Oct 2008 07:56:11 +0000 (07:56 +0000)]
Improve llvm-gcc compatibility, -Os implies -O2 (sortof).

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

15 years agoAdd notes for SCA.
Zhongxing Xu [Wed, 29 Oct 2008 07:05:10 +0000 (07:05 +0000)]
Add notes for SCA.

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 29 Oct 2008 06:19:03 +0000 (06:19 +0000)]
Update checker build.

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

15 years agoUpdate FindSpecRefs to recognize named section references.
Daniel Dunbar [Wed, 29 Oct 2008 05:58:09 +0000 (05:58 +0000)]
Update FindSpecRefs to recognize named section references.
 - Unfortunately, I don't have an easy way to map from named sections
   to numbers nicely so they don't get page numbers or integrate in
   the list well.

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

15 years agoFix for PR2966: va_start/va_end use the *address* of the
Eli Friedman [Wed, 29 Oct 2008 04:39:20 +0000 (04:39 +0000)]
Fix for PR2966: va_start/va_end use the *address* of the
va_list, not the value.  Patch fixes an assert on
x86-64 and a wrong-code bug on x86.  I'm not completely sure,
but I think it's a regression from r58306.

Does anyone run regression tests regularly on x86-64? The crash should
have been picked up there.

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

15 years agoPatch by Nikita Zhuk:
Ted Kremenek [Wed, 29 Oct 2008 04:30:28 +0000 (04:30 +0000)]
Patch by Nikita Zhuk:

The attached patch adds additional checks to -warn-objc-missing-dealloc. It checks that all ivars which are used in implementation of synthesized properties are either

a) released in dealloc if the property has retain" or "copy" attribute OR
b) not released in dealloc if the property has "assign" attribute

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

15 years agoIOServiceGetMatchingServices is a release function.
Ted Kremenek [Wed, 29 Oct 2008 04:07:07 +0000 (04:07 +0000)]
IOServiceGetMatchingServices is a release function.

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

15 years agoChoose CompileOptions (optimization passes) to match llvm-gcc more
Daniel Dunbar [Wed, 29 Oct 2008 03:42:18 +0000 (03:42 +0000)]
Choose CompileOptions (optimization passes) to match llvm-gcc more
closely.

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

15 years agoFix mmintrin.h to use proper definition of functions taking no
Daniel Dunbar [Wed, 29 Oct 2008 03:37:55 +0000 (03:37 +0000)]
Fix mmintrin.h to use proper definition of functions taking no
arguments.
 - More important than it looks, this inhibits trivial inlining
   otherwise.

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

15 years agoRename: AddDecl => BindDecl
Zhongxing Xu [Wed, 29 Oct 2008 02:34:02 +0000 (02:34 +0000)]
Rename: AddDecl => BindDecl
BindDecl better describes what the function does:
  - Bind the VarDecl to its memory region
  - Bind the memory region to some initial value.

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

15 years agoTweak Sema::CheckReferenceInit so that it (optionally) computes an
Douglas Gregor [Wed, 29 Oct 2008 02:00:59 +0000 (02:00 +0000)]
Tweak Sema::CheckReferenceInit so that it (optionally) computes an
ImplicitConversionSequence and, when doing so, following the specific
rules of [over.best.ics].

The computation of the implicit conversion sequences implements C++
[over.ics.ref], but we do not (yet) have ranking for implicit
conversion sequences that use reference binding.

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

15 years agoMemSpaceRegions could be uninitialized. We only require R is a real region.
Zhongxing Xu [Wed, 29 Oct 2008 01:13:28 +0000 (01:13 +0000)]
MemSpaceRegions could be uninitialized. We only require R is a real region.

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

15 years agoImplement initialization of a reference (C++ [dcl.init.ref]) as part
Douglas Gregor [Wed, 29 Oct 2008 00:13:59 +0000 (00:13 +0000)]
Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:

  - Try/Perform-ImplicitConversion now handles implicit conversions
    that don't involve references.
  - Try/Perform-CopyInitialization uses
    CheckSingleAssignmentConstraints for C. PerformCopyInitialization
    is now used for all argument passing and returning values from a
    function.
  - Diagnose errors with declaring references and const values without
    an initializer. (Uses a new Action callback, ActOnUninitializedDecl).

We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.

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

15 years ago.s files don't require the preprocessor, patch by Roman Divacky!
Chris Lattner [Tue, 28 Oct 2008 20:33:42 +0000 (20:33 +0000)]
.s files don't require the preprocessor, patch by Roman Divacky!

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

15 years agoMore changes necessary to integrate the objc and blocks rewriters.
Steve Naroff [Tue, 28 Oct 2008 20:29:00 +0000 (20:29 +0000)]
More changes necessary to integrate the objc and blocks rewriters.

With this commit, stuff like this is very close to working...

    [foo barf:^(int){ printf("whatever\n"); }];

Here is what is currently translates to...

    ((id (*)(id, SEL, void (^)(int)))(void *)objc_msgSend)((id)foo, sel_registerName("barf:"), (void (*)(int))__main_block_func_0);

I just need make sure the funky cast on objc_msgSend() is converted from "void (^)(int)" to "void (*)(int)". Since the cast doesn't appear in the source code, it needs to be converted in RewriteObjC::SynthMessageExpr().

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

15 years agoMinor UI enhancement:
Ted Kremenek [Tue, 28 Oct 2008 20:09:57 +0000 (20:09 +0000)]
Minor UI enhancement:

(1) when all of the bug category boxes are checked, automatically check "All Bugs"

(2) when any of the bug category boxes are unchecked, automatically uncheck "All Bugs"

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

15 years agoPatch by Nikita Zhuk:
Ted Kremenek [Tue, 28 Oct 2008 19:56:52 +0000 (19:56 +0000)]
Patch by Nikita Zhuk:

The attached patch adds a checkbox to the scan-build summary report, which toggles all other checkboxes' states.

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

15 years agoAccess pass manager consistently.
Daniel Dunbar [Tue, 28 Oct 2008 19:23:05 +0000 (19:23 +0000)]
Access pass manager consistently.
 - No functionality change.

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

15 years ago80-col fixes.
Daniel Dunbar [Tue, 28 Oct 2008 19:12:58 +0000 (19:12 +0000)]
80-col fixes.

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

15 years agoRename ExplicitCCastExpr to CStyleCastExpr
Douglas Gregor [Tue, 28 Oct 2008 15:36:24 +0000 (15:36 +0000)]
Rename ExplicitCCastExpr to CStyleCastExpr

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

15 years agoReplace a dyn_cast with a cast when we know the exact type
Douglas Gregor [Tue, 28 Oct 2008 15:29:51 +0000 (15:29 +0000)]
Replace a dyn_cast with a cast when we know the exact type

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

15 years agoAdd newline.
Zhongxing Xu [Tue, 28 Oct 2008 09:32:08 +0000 (09:32 +0000)]
Add newline.

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

15 years agoUpdate random notes.
Zhongxing Xu [Tue, 28 Oct 2008 09:09:48 +0000 (09:09 +0000)]
Update random notes.

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

15 years agoAdd isGlobalsRegion() predicate to MemRegionManager.
Zhongxing Xu [Tue, 28 Oct 2008 05:15:23 +0000 (05:15 +0000)]
Add isGlobalsRegion() predicate to MemRegionManager.

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

15 years agoclarify comment, rename argument to avoid a subtle conflict
Chris Lattner [Tue, 28 Oct 2008 01:02:17 +0000 (01:02 +0000)]
clarify comment, rename argument to avoid a subtle conflict
with an ivar that wasn't a bug but was confusing.

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

15 years agoCall llvm_shutdown() on (normal) termination. This makes --time-passes usable.
Daniel Dunbar [Tue, 28 Oct 2008 00:38:08 +0000 (00:38 +0000)]
Call llvm_shutdown() on (normal) termination. This makes --time-passes usable.

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

15 years agoDon't run the verifier as part of IRgen, this is now down (per module)
Daniel Dunbar [Tue, 28 Oct 2008 00:36:04 +0000 (00:36 +0000)]
Don't run the verifier as part of IRgen, this is now down (per module)
in the driver (this means we no longer run the verifier per function, however).

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

15 years agoImprove our handling of (C++) references within Clang. Specifically:
Douglas Gregor [Tue, 28 Oct 2008 00:22:11 +0000 (00:22 +0000)]
Improve our handling of (C++) references within Clang. Specifically:
  - Do not allow expressions to ever have reference type
  - Extend Expr::isLvalue to handle more cases where having written a
    reference into the source implies that the expression is an lvalue
    (e.g., function calls, C++ casts).
  - Make GRExprEngine::VisitCall treat the call arguments as lvalues when
    they are being bound to a reference parameter.

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

15 years agoInitialize Suffix and Prefix to 0, even with a bad entry. Removes an uninitialized...
Ted Kremenek [Tue, 28 Oct 2008 00:18:42 +0000 (00:18 +0000)]
Initialize Suffix and Prefix to 0, even with a bad entry.  Removes an uninitialized value warning from gcc.

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

15 years agoAdd attribute always_inline support.
Daniel Dunbar [Tue, 28 Oct 2008 00:17:57 +0000 (00:17 +0000)]
Add attribute always_inline support.

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

15 years agoMark mmintrin functions static inline, this ensures they don't end up
Daniel Dunbar [Tue, 28 Oct 2008 00:06:25 +0000 (00:06 +0000)]
Mark mmintrin functions static inline, this ensures they don't end up
being emitted unless needed and doesn't inhibit inlining.
  - Can be fixed once we implement C99 inline semantics.

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

15 years ago- Fix type-punning warning in SVals.cpp by using a real iterator class for symbol_ite...
Ted Kremenek [Mon, 27 Oct 2008 23:39:39 +0000 (23:39 +0000)]
- Fix type-punning warning in SVals.cpp by using a real iterator class for symbol_iterator.

- Add symbol_iterator support for SymbolicRegions.

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

15 years agoRemove type-punning warning in GRExprEngine. No functionality change.
Ted Kremenek [Mon, 27 Oct 2008 23:02:39 +0000 (23:02 +0000)]
Remove type-punning warning in GRExprEngine.  No functionality change.

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

15 years agoSkip random pathname characters better. I had a 5 in mine.
Mike Stump [Mon, 27 Oct 2008 22:49:55 +0000 (22:49 +0000)]
Skip random pathname characters better.  I had a 5 in mine.

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

15 years agoUpdate checker build.
Ted Kremenek [Mon, 27 Oct 2008 22:42:11 +0000 (22:42 +0000)]
Update checker build.

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

15 years agoAdd test case to exercise IRgen "unsupported" path (mostly cleanup).
Daniel Dunbar [Mon, 27 Oct 2008 22:11:01 +0000 (22:11 +0000)]
Add test case to exercise IRgen "unsupported" path (mostly cleanup).

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

15 years agoWith -verify, only exit early on failure.
Daniel Dunbar [Mon, 27 Oct 2008 22:10:13 +0000 (22:10 +0000)]
With -verify, only exit early on failure.
 - Nice if -verify test exercise the various cleanup functions.

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

15 years agoRemove unneeded CheckASTConsumer function.
Daniel Dunbar [Mon, 27 Oct 2008 22:03:52 +0000 (22:03 +0000)]
Remove unneeded CheckASTConsumer function.
  - No functionality change.

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

15 years agoComment fix, ParseAST does not take ownership of the consumer.
Daniel Dunbar [Mon, 27 Oct 2008 22:01:05 +0000 (22:01 +0000)]
Comment fix, ParseAST does not take ownership of the consumer.

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

15 years agoAdd 'expected-warning' for braces around scalar initializer
Ted Kremenek [Mon, 27 Oct 2008 22:00:16 +0000 (22:00 +0000)]
Add 'expected-warning' for braces around scalar initializer

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

15 years agoAdded compound literal test case.
Ted Kremenek [Mon, 27 Oct 2008 21:57:17 +0000 (21:57 +0000)]
Added compound literal test case.

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

15 years agoAdded preliminary support for CompoundLiterals in the static analyzer:
Ted Kremenek [Mon, 27 Oct 2008 21:54:31 +0000 (21:54 +0000)]
Added preliminary support for CompoundLiterals in the static analyzer:

- GRExprEngine::VisitCompoundLiteral...
   (1) visits the initializer list (generating ExplodedNodes)
   (2) creates a CompoundMemRegion for the literal
   (3) creates a new state with the bound literal values using
       GRStateManager::BindCompoundLiteral

- GRStateManager::BindCompoundLiteral simply calls
  StoreManager::BindCompoundLiteral to get a new store and returns a persistent
  GRState with that store.

- BasicStore::BindCompoundLiteral simply returns the same store, as it
  doesn't handle field sensitivity

- RegionStore::BindCompoundLiteral currently fires an assert (pending discussion
  of how to best implement mappings for CompoundLiteralRegion).

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

15 years agoUpdate Xcode project.
Ted Kremenek [Mon, 27 Oct 2008 21:41:20 +0000 (21:41 +0000)]
Update Xcode project.

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

15 years agoPull determination of the super region for a VarRegion into a single getVarRegion...
Ted Kremenek [Mon, 27 Oct 2008 21:01:26 +0000 (21:01 +0000)]
Pull determination of the super region for a VarRegion into a single getVarRegion() method.  This provides a common clean API for clients.

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

15 years agoAdded CompoundLiteralRegion to represent the (temporary) memory allocated for a compo...
Ted Kremenek [Mon, 27 Oct 2008 20:57:58 +0000 (20:57 +0000)]
Added CompoundLiteralRegion to represent the (temporary) memory allocated for a compound literal.

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

15 years agoFix testsuite regression for "crash.m".
Steve Naroff [Mon, 27 Oct 2008 20:54:44 +0000 (20:54 +0000)]
Fix testsuite regression for "crash.m".

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

15 years agoDon't double free module when IRgen fails.
Daniel Dunbar [Mon, 27 Oct 2008 20:40:41 +0000 (20:40 +0000)]
Don't double free module when IRgen fails.

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

15 years agoImprove dependency file support.
Daniel Dunbar [Mon, 27 Oct 2008 20:01:06 +0000 (20:01 +0000)]
Improve dependency file support.
 - Add support for -MP (phony targets).

 - Use raw_ostream for output instead of std::string concatenation.

 - Break long lines in a GCC (4.2) compatible manner.

 - Output dependents in #included order (to match GCC).

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

15 years agoRefactor the expression class hierarchy for casts. Most importantly:
Douglas Gregor [Mon, 27 Oct 2008 19:41:14 +0000 (19:41 +0000)]
Refactor the expression class hierarchy for casts. Most importantly:
  - CastExpr is the root of all casts
  - ImplicitCastExpr is (still) used for all explicit casts
  - ExplicitCastExpr is now the root of all *explicit* casts
  - ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++
  - CXXFunctionalCastExpr inherits from ExplicitCastExpr
  - CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all
    of the C++ named cast expression types (static_cast, dynamic_cast, etc.)
  - Added classes CXXStaticCastExpr, CXXDynamicCastExpr,
    CXXReinterpretCastExpr, and CXXConstCastExpr to

Also, fixed returned-stack-addr.cpp, which broke once when we fixed
reinterpret_cast to diagnose double->int* conversions and again when
we eliminated implicit conversions to reference types. The fix is in
both testcase and SemaChecking.cpp.

Most of this patch is simply support for the renaming. There's very
little actual change in semantics.

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

15 years agoSome fixups to the previous objc/blocks rewriter smerge.
Steve Naroff [Mon, 27 Oct 2008 18:50:14 +0000 (18:50 +0000)]
Some fixups to the previous objc/blocks rewriter smerge.

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

15 years ago- Move ExprIterator to Stmt.h so that it can be used by classes defined in Stmt.h
Ted Kremenek [Mon, 27 Oct 2008 18:40:21 +0000 (18:40 +0000)]
- Move ExprIterator to Stmt.h so that it can be used by classes defined in Stmt.h
- Implement child_begin() and child_end() for AsmStmt.  Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement.
- Use ExprIterator for performing iteration over input/output operands.

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

15 years agoIntegrate the blocks and objc rewriters.
Steve Naroff [Mon, 27 Oct 2008 17:20:55 +0000 (17:20 +0000)]
Integrate the blocks and objc rewriters.

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

15 years agoFix some invalid casts that are detected by Sema now or soon.
Sebastian Redl [Mon, 27 Oct 2008 16:34:21 +0000 (16:34 +0000)]
Fix some invalid casts that are detected by Sema now or soon.

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

15 years agoAdd store option to scan-build and ccc-analyzer.
Zhongxing Xu [Mon, 27 Oct 2008 14:26:32 +0000 (14:26 +0000)]
Add store option to scan-build and ccc-analyzer.

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

15 years agoUse ASTContext::getCanonicalType() to get TypedRegion's type.
Zhongxing Xu [Mon, 27 Oct 2008 13:35:03 +0000 (13:35 +0000)]
Use ASTContext::getCanonicalType() to get TypedRegion's type.

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

15 years agoAn ElementRegion is really a typed region. Its super region's type has to be ArrayType.
Zhongxing Xu [Mon, 27 Oct 2008 13:17:02 +0000 (13:17 +0000)]
An ElementRegion is really a typed region. Its super region's type has to be ArrayType.

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

15 years agoWhen destroying a translation unit, deallocate its owned declarations in reverse...
Douglas Gregor [Mon, 27 Oct 2008 12:50:38 +0000 (12:50 +0000)]
When destroying a translation unit, deallocate its owned declarations in reverse order, because there may be dependencies among the declarations.

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

15 years agoWe cannot get precise lvalue for symbolic base array region.
Zhongxing Xu [Mon, 27 Oct 2008 12:23:17 +0000 (12:23 +0000)]
We cannot get precise lvalue for symbolic base array region.

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

15 years agoReplace common diagnostic with a convenience function.
Steve Naroff [Mon, 27 Oct 2008 11:34:16 +0000 (11:34 +0000)]
Replace common diagnostic with a convenience function.
This simplifies debug of this particular diagnostic (and removes some code clutter).

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

15 years agoFix <rdar://problem/6315646> clang on xcode: error: invalid operands to binary expres...
Steve Naroff [Mon, 27 Oct 2008 10:33:19 +0000 (10:33 +0000)]
Fix <rdar://problem/6315646> clang on xcode: error: invalid operands to binary expression ('id<NSTableViewDelegate>' and 'XCExtendedArrayController *').

There is still a bug here (as the FIXME in the test case indicates). Prior to this patch, the bug would generate an error. Now, we simply do nothing (which is less harmful until we can get it right). The complete bug fix will require changing ASTContext::mergeTypes(), which I'd like to defer for now.

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

15 years agoGet the canonical type for struct initialization. The original code would crash on...
Zhongxing Xu [Mon, 27 Oct 2008 09:24:07 +0000 (09:24 +0000)]
Get the canonical type for struct initialization. The original code would crash on TypedefType.

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

15 years agoAdd test for SCA region store.
Zhongxing Xu [Mon, 27 Oct 2008 09:21:27 +0000 (09:21 +0000)]
Add test for SCA region store.

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

15 years agoAdd test for SCA region store.
Zhongxing Xu [Mon, 27 Oct 2008 09:19:25 +0000 (09:19 +0000)]
Add test for SCA region store.

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

15 years agoOnly loc::MemRegionVal can be modified. This avoids crashing in RegionStore when...
Zhongxing Xu [Mon, 27 Oct 2008 09:00:08 +0000 (09:00 +0000)]
Only loc::MemRegionVal can be modified. This avoids crashing in RegionStore when a function pointer is used as an argument.

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

15 years agoRename Characteristic_t to CharacteristicKind
Chris Lattner [Mon, 27 Oct 2008 01:19:25 +0000 (01:19 +0000)]
Rename Characteristic_t to CharacteristicKind

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

15 years agoFix the definition of __builtin_va_list on PPC, which was set to the V4 ABI, not the
Chris Lattner [Mon, 27 Oct 2008 01:11:29 +0000 (01:11 +0000)]
Fix the definition of __builtin_va_list on PPC, which was set to the V4 ABI, not the
darwin or AIX abis.  This fixes PR2904.

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

15 years agomake codegen reject initializes with designators, like this:
Chris Lattner [Sun, 26 Oct 2008 23:53:12 +0000 (23:53 +0000)]
make codegen reject initializes with designators, like this:

t.c:1:13: error: cannot codegen this designators yet
int a[10] = {2, 4, [8]=9, 10};
            ^~~~~~~~~~~~~~~~~

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

15 years agoRemember whether an initlist had a designator in the AST.
Chris Lattner [Sun, 26 Oct 2008 23:43:26 +0000 (23:43 +0000)]
Remember whether an initlist had a designator in the AST.

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

15 years agopass designators into sema. This completes parser-level designator
Chris Lattner [Sun, 26 Oct 2008 23:35:51 +0000 (23:35 +0000)]
pass designators into sema.  This completes parser-level designator
support as far as I know.

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

15 years agoimplement some more FIXMEs, by rejecting more bogus stuff in
Chris Lattner [Sun, 26 Oct 2008 23:29:41 +0000 (23:29 +0000)]
implement some more FIXMEs, by rejecting more bogus stuff in
objc mode.

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

15 years agoadd some simple designator testcases. Reject things like this:
Chris Lattner [Sun, 26 Oct 2008 23:22:23 +0000 (23:22 +0000)]
add some simple designator testcases.  Reject things like this:

struct foo Y[10] = {
  [4] .arr [2] 4  // expected-error {{expected '=' or another designator}}
};

because the "missing equals" extension only is valid if there
is exactly one array designator.

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

15 years agoimprove comments, build array and array range designator nodes,
Chris Lattner [Sun, 26 Oct 2008 23:06:54 +0000 (23:06 +0000)]
improve comments, build array and array range designator nodes,
fix an obscure memory leak.

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

15 years agoimprove comments, build a Designation for field designators and
Chris Lattner [Sun, 26 Oct 2008 22:59:19 +0000 (22:59 +0000)]
improve comments, build a Designation for field designators and
improve diagnostic for a malformed field designator.

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

15 years agorestructure ParseInitializerWithPotentialDesignator to make it
Chris Lattner [Sun, 26 Oct 2008 22:49:49 +0000 (22:49 +0000)]
restructure ParseInitializerWithPotentialDesignator to make it
easier to understand and hack on, no functionality change.

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