]> granicus.if.org Git - clang/log
clang
14 years agoStore latest redeclaration for each redeclarable template declaration
Peter Collingbourne [Thu, 29 Jul 2010 16:12:01 +0000 (16:12 +0000)]
Store latest redeclaration for each redeclarable template declaration

This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase
class which is used to store the latest redeclaration.

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

14 years agoRefactor redeclarable template declarations
Peter Collingbourne [Thu, 29 Jul 2010 16:11:51 +0000 (16:11 +0000)]
Refactor redeclarable template declarations

This patch refactors much of the common code in ClassTemplateDecl and
FunctionTemplateDecl into a common base class RedeclarableTemplateDecl
together with support functions in a template class RedeclarableTemplate.

The patch also includes similar refactoring for these classes' PCH
reader and writer implementations.

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

14 years agoWhen taking the address of a value of Objective-C object type (e.g.,
Douglas Gregor [Thu, 29 Jul 2010 16:05:45 +0000 (16:05 +0000)]
When taking the address of a value of Objective-C object type (e.g.,
one because we're referencing a variable of type NSString &), the
resulting type is an ObjCObjectPointerType.

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

14 years agoAllow a looser form of compatibility checking (which ignores
Douglas Gregor [Thu, 29 Jul 2010 15:18:02 +0000 (15:18 +0000)]
Allow a looser form of compatibility checking (which ignores
qualifiers) when checking a K&R function definition against a previous
prototype. Fixes <rdar://problem/8193107>.

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

14 years agoWhen deleting a value of class type, make sure that type is complete
Douglas Gregor [Thu, 29 Jul 2010 14:44:35 +0000 (14:44 +0000)]
When deleting a value of class type, make sure that type is complete
before looking for conversions to pointer type. Fixes <rdar://problem/8248780>.

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

14 years agoReword the empty struct/union warning in C to note that such structs and unions have...
Douglas Gregor [Thu, 29 Jul 2010 14:29:34 +0000 (14:29 +0000)]
Reword the empty struct/union warning in C to note that such structs and unions have size 0 in C, size 1 in C++. Put this warning under -Wc++-compat.

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

14 years agoThis is a little bit far, but optimize cases like:
Chris Lattner [Thu, 29 Jul 2010 07:43:55 +0000 (07:43 +0000)]
This is a little bit far, but optimize cases like:

struct a {
  struct c {
    double x;
    int y;
  } x[1];
};

void foo(struct a A) {
}

into:

define void @foo(double %A.coerce0, i32 %A.coerce1) nounwind {
entry:
  %A = alloca %struct.a, align 8                  ; <%struct.a*> [#uses=1]
  %0 = bitcast %struct.a* %A to %struct.c*        ; <%struct.c*> [#uses=2]
  %1 = getelementptr %struct.c* %0, i32 0, i32 0  ; <double*> [#uses=1]
  store double %A.coerce0, double* %1
  %2 = getelementptr %struct.c* %0, i32 0, i32 1  ; <i32*> [#uses=1]
  store i32 %A.coerce1, i32* %2

instead of:

define void @foo(double %A.coerce0, i64 %A.coerce1) nounwind {
entry:
  %A = alloca %struct.a, align 8                  ; <%struct.a*> [#uses=1]
  %0 = bitcast %struct.a* %A to %0*               ; <%0*> [#uses=2]
  %1 = getelementptr %0* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %A.coerce0, double* %1
  %2 = getelementptr %0* %0, i32 0, i32 1         ; <i64*> [#uses=1]
  store i64 %A.coerce1, i64* %2

I only do this now because I never want to look at this code again :)

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

14 years agoimplement a todo: pass a eight-byte that consists of a
Chris Lattner [Thu, 29 Jul 2010 07:30:00 +0000 (07:30 +0000)]
implement a todo: pass a eight-byte that consists of a
small integer + padding as that small integer.  On code
like:

struct c { double x; int y; };
void bar(struct c C) { }

This means that we compile to:

define void @bar(double %C.coerce0, i32 %C.coerce1) nounwind {
entry:
  %C = alloca %struct.c, align 8                  ; <%struct.c*> [#uses=2]
  %0 = getelementptr %struct.c* %C, i32 0, i32 0  ; <double*> [#uses=1]
  store double %C.coerce0, double* %0
  %1 = getelementptr %struct.c* %C, i32 0, i32 1  ; <i32*> [#uses=1]
  store i32 %C.coerce1, i32* %1

instead of:

define void @bar(double %C.coerce0, i64 %C.coerce1) nounwind {
entry:
  %C = alloca %struct.c, align 8                  ; <%struct.c*> [#uses=3]
  %0 = bitcast %struct.c* %C to %0*               ; <%0*> [#uses=2]
  %1 = getelementptr %0* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %C.coerce0, double* %1
  %2 = getelementptr %0* %0, i32 0, i32 1         ; <i64*> [#uses=1]
  store i64 %C.coerce1, i64* %2

which gives SRoA heartburn.

This implements rdar://5711709, a nice low number :)

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

14 years agoMove new test (that requires RegionStore) into its own file.
Jordy Rose [Thu, 29 Jul 2010 07:11:59 +0000 (07:11 +0000)]
Move new test (that requires RegionStore) into its own file.

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

14 years agofix a builder, why didn't clang++ catch this?
Chris Lattner [Thu, 29 Jul 2010 06:44:09 +0000 (06:44 +0000)]
fix a builder, why didn't clang++ catch this?

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

14 years agoUse a LazyCompoundVal to handle initialization with a string literal, rather than...
Jordy Rose [Thu, 29 Jul 2010 06:40:33 +0000 (06:40 +0000)]
Use a LazyCompoundVal to handle initialization with a string literal, rather than copying each character.

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

14 years agoKill off the 'coerce' ABI passing form. Now 'direct' and 'extend' always
Chris Lattner [Thu, 29 Jul 2010 06:26:06 +0000 (06:26 +0000)]
Kill off the 'coerce' ABI passing form.  Now 'direct' and 'extend' always
have a "coerce to" type which often matches the default lowering of Clang
type to LLVM IR type, but the coerce case can be handled by making them
not be the same.

This simplifies things and fixes issues where X86-64 abi lowering would
return coerce after making preferred types exactly match up.  This caused
us to compile:

typedef float v4f32 __attribute__((__vector_size__(16)));
v4f32 foo(v4f32 X) {
  return X+X;
}

into this code at -O0:

define <4 x float> @foo(<4 x float> %X.coerce) nounwind {
entry:
  %retval = alloca <4 x float>, align 16          ; <<4 x float>*> [#uses=2]
  %coerce = alloca <4 x float>, align 16          ; <<4 x float>*> [#uses=2]
  %X.addr = alloca <4 x float>, align 16          ; <<4 x float>*> [#uses=3]
  store <4 x float> %X.coerce, <4 x float>* %coerce
  %X = load <4 x float>* %coerce                  ; <<4 x float>> [#uses=1]
  store <4 x float> %X, <4 x float>* %X.addr
  %tmp = load <4 x float>* %X.addr                ; <<4 x float>> [#uses=1]
  %tmp1 = load <4 x float>* %X.addr               ; <<4 x float>> [#uses=1]
  %add = fadd <4 x float> %tmp, %tmp1             ; <<4 x float>> [#uses=1]
  store <4 x float> %add, <4 x float>* %retval
  %0 = load <4 x float>* %retval                  ; <<4 x float>> [#uses=1]
  ret <4 x float> %0
}

Now we get:

define <4 x float> @foo(<4 x float> %X) nounwind {
entry:
  %X.addr = alloca <4 x float>, align 16          ; <<4 x float>*> [#uses=3]
  store <4 x float> %X, <4 x float>* %X.addr
  %tmp = load <4 x float>* %X.addr                ; <<4 x float>> [#uses=1]
  %tmp1 = load <4 x float>* %X.addr               ; <<4 x float>> [#uses=1]
  %add = fadd <4 x float> %tmp, %tmp1             ; <<4 x float>> [#uses=1]
  ret <4 x float> %add
}

This implements rdar://8248065

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

14 years agoignore structs that wrap vectors in IR, the abstraction shouldn't add penalty.
Chris Lattner [Thu, 29 Jul 2010 05:02:29 +0000 (05:02 +0000)]
ignore structs that wrap vectors in IR, the abstraction shouldn't add penalty.

Before we'd compile the example into something like:

  %coerce.dive2 = getelementptr %struct.v4f32wrapper* %retval, i32 0, i32 0 ; <<4 x float>*> [#uses=1]
  %1 = bitcast <4 x float>* %coerce.dive2 to <2 x double>* ; <<2 x double>*> [#uses=1]
  %2 = load <2 x double>* %1, align 1             ; <<2 x double>> [#uses=1]
  ret <2 x double> %2

Now we produce:

  %coerce.dive2 = getelementptr %struct.v4f32wrapper* %retval, i32 0, i32 0 ; <<4 x float>*> [#uses=1]
  %0 = load <4 x float>* %coerce.dive2, align 1   ; <<4 x float>> [#uses=1]
  ret <4 x float> %0

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

14 years agomove the 'pretty 16-byte vector' inferring code up to be shared
Chris Lattner [Thu, 29 Jul 2010 04:56:46 +0000 (04:56 +0000)]
move the 'pretty 16-byte vector' inferring code up to be shared
with return values, improving stuff that returns __m128 etc.

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

14 years agosimplify code by eliminating a premature optimization.
Chris Lattner [Thu, 29 Jul 2010 04:51:12 +0000 (04:51 +0000)]
simplify code by eliminating a premature optimization.

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

14 years agonow that we have CGT around, we can start using preferred types
Chris Lattner [Thu, 29 Jul 2010 04:46:19 +0000 (04:46 +0000)]
now that we have CGT around, we can start using preferred types
for return values too.  Instead of compiling something like:

struct foo {
  int *X;
  float *Y;
};

struct foo test(struct foo *P) { return *P; }

to:

%1 = type { i64, i64 }

define %1 @test(%struct.foo* %P) nounwind {
entry:
  %retval = alloca %struct.foo, align 8           ; <%struct.foo*> [#uses=2]
  %P.addr = alloca %struct.foo*, align 8          ; <%struct.foo**> [#uses=2]
  store %struct.foo* %P, %struct.foo** %P.addr
  %tmp = load %struct.foo** %P.addr               ; <%struct.foo*> [#uses=1]
  %tmp1 = bitcast %struct.foo* %retval to i8*     ; <i8*> [#uses=1]
  %tmp2 = bitcast %struct.foo* %tmp to i8*        ; <i8*> [#uses=1]
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 16, i32 8, i1 false)
  %0 = bitcast %struct.foo* %retval to %1*        ; <%1*> [#uses=1]
  %1 = load %1* %0, align 1                       ; <%1> [#uses=1]
  ret %1 %1
}

We now get the result more type safe, with:

define %struct.foo @test(%struct.foo* %P) nounwind {
entry:
  %retval = alloca %struct.foo, align 8           ; <%struct.foo*> [#uses=2]
  %P.addr = alloca %struct.foo*, align 8          ; <%struct.foo**> [#uses=2]
  store %struct.foo* %P, %struct.foo** %P.addr
  %tmp = load %struct.foo** %P.addr               ; <%struct.foo*> [#uses=1]
  %tmp1 = bitcast %struct.foo* %retval to i8*     ; <i8*> [#uses=1]
  %tmp2 = bitcast %struct.foo* %tmp to i8*        ; <i8*> [#uses=1]
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 16, i32 8, i1 false)
  %0 = load %struct.foo* %retval                  ; <%struct.foo> [#uses=1]
  ret %struct.foo %0
}

That memcpy is completely terrible, but I don't know how to fix it.

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

14 years agosink preferred type stuff lower. It's possible that this might
Chris Lattner [Thu, 29 Jul 2010 04:41:05 +0000 (04:41 +0000)]
sink preferred type stuff lower.  It's possible that this might
improve codegen for vaarg or something, because its codepath is
getting preferred types now.

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

14 years agoTranscribe clattner email to SVN.
Daniel Dunbar [Thu, 29 Jul 2010 02:46:02 +0000 (02:46 +0000)]
Transcribe clattner email to SVN.

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

14 years agodissolve some more complexity: make the x86-64 abi lowering code
Chris Lattner [Thu, 29 Jul 2010 02:31:05 +0000 (02:31 +0000)]
dissolve some more complexity: make the x86-64 abi lowering code
compute its own preferred types instead of having CGT compute
them then pass them (circuituously) down into ABIInfo.

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

14 years agoChange #pragma crash to segv, instead of abort.
Daniel Dunbar [Thu, 29 Jul 2010 02:25:07 +0000 (02:25 +0000)]
Change #pragma crash to segv, instead of abort.

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

14 years agosimplify Get8ByteTypeAtOffset by making it a member of X86_64ABIInfo
Chris Lattner [Thu, 29 Jul 2010 02:20:19 +0000 (02:20 +0000)]
simplify Get8ByteTypeAtOffset by making it a member of X86_64ABIInfo

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

14 years agonow that ABIInfo depends on CGT, it has trivial access to such
Chris Lattner [Thu, 29 Jul 2010 02:16:43 +0000 (02:16 +0000)]
now that ABIInfo depends on CGT, it has trivial access to such
things as TargetData, ASTContext, LLVMContext etc.  Stop passing
them through so many APIs.

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

14 years agocave in to reality and make ABIInfo depend on CodeGenTypes.
Chris Lattner [Thu, 29 Jul 2010 02:01:43 +0000 (02:01 +0000)]
cave in to reality and make ABIInfo depend on CodeGenTypes.

This will simplify a bunch of code, coming up next.

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

14 years agoTeach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, and Charac...
Ted Kremenek [Thu, 29 Jul 2010 01:31:59 +0000 (01:31 +0000)]
Teach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, and CharacterLiteral.  Fixes an assertion failure reported in PR 7675.

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

14 years agoCheck for an invalid SourceLocation in clang_getCursor(). This avoids a possible...
Ted Kremenek [Thu, 29 Jul 2010 00:52:07 +0000 (00:52 +0000)]
Check for an invalid SourceLocation in clang_getCursor().  This avoids a possible assertion failure in SourceManager in the call to Lexer::GetBeginningOfToken().  Fixes <rdar://problem/8244873>.

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

14 years agoAugment RegionStore::BindStruct() to bind symbolicated struct values. This fixes...
Ted Kremenek [Thu, 29 Jul 2010 00:28:47 +0000 (00:28 +0000)]
Augment RegionStore::BindStruct() to bind symbolicated struct values.  This fixes a false path issue reported in <rdar://problem/8243408> and also spurs another cause where the idempotent operations checker fires.

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

14 years agoChange SymbolManager::canSymbolicate() to return true for RecordTypes.
Ted Kremenek [Thu, 29 Jul 2010 00:28:43 +0000 (00:28 +0000)]
Change SymbolManager::canSymbolicate() to return true for RecordTypes.

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

14 years agoExplicitly guard in BasicStore from storing to non-scalars.
Ted Kremenek [Thu, 29 Jul 2010 00:28:40 +0000 (00:28 +0000)]
Explicitly guard in BasicStore from storing to non-scalars.

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

14 years agoRemove extraneous guards around the call to getConjuredSymbolVal(). These checks...
Ted Kremenek [Thu, 29 Jul 2010 00:28:33 +0000 (00:28 +0000)]
Remove extraneous guards around the call to getConjuredSymbolVal().  These checks are already done within getConjuredSymbolVal() itself.

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

14 years agoVisit the children of CXXOperatorCallExprs in source order within
Douglas Gregor [Thu, 29 Jul 2010 00:26:18 +0000 (00:26 +0000)]
Visit the children of CXXOperatorCallExprs in source order within
libclang, so that clang_annotateTokens() doesn't get confused and miss
annotations.

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

14 years agoDon't set out-of-line template specialization/definition information
Douglas Gregor [Wed, 28 Jul 2010 23:59:57 +0000 (23:59 +0000)]
Don't set out-of-line template specialization/definition information
for AST nodes that aren't actually out-of-line (i.e., require a
nested-name-specifier). Fixes <rdar://problem/8204126>.

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

14 years agopass argument vectors in a type that corresponds to the user type if
Chris Lattner [Wed, 28 Jul 2010 23:47:21 +0000 (23:47 +0000)]
pass argument vectors in a type that corresponds to the user type if
possible.  This improves the example to pass <4 x float> instead of
<2 x double> but we still get awful code, and still don't get the
return value right.

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

14 years agotidy up
Chris Lattner [Wed, 28 Jul 2010 23:46:15 +0000 (23:46 +0000)]
tidy up

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

14 years agoInitialize block's imported variable(s) in
Fariborz Jahanian [Wed, 28 Jul 2010 23:27:30 +0000 (23:27 +0000)]
Initialize block's imported variable(s) in
block's synthesized constructor initalizer list.
Fixes radar 8240371.

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

14 years agoPR7736: Make sure to mark &Class::Member correctly as being type-dependent
Eli Friedman [Wed, 28 Jul 2010 23:26:18 +0000 (23:26 +0000)]
PR7736: Make sure to mark &Class::Member correctly as being type-dependent
inside a template class.

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

14 years agoOverride selected builtin names (e.g. "long int" instead of "long") to match names...
Devang Patel [Wed, 28 Jul 2010 23:23:29 +0000 (23:23 +0000)]
Override selected builtin names (e.g. "long int" instead of "long") to match names used by gcc in debug info. This makes gdb testsuite happy.

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

14 years agofix some break statements to be formatted more consistently,
Chris Lattner [Wed, 28 Jul 2010 23:12:33 +0000 (23:12 +0000)]
fix some break statements to be formatted more consistently,
remove some now-dead code.

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

14 years agouse Get8ByteTypeAtOffset for the return value path as well so we
Chris Lattner [Wed, 28 Jul 2010 23:06:14 +0000 (23:06 +0000)]
use Get8ByteTypeAtOffset for the return value path as well so we
don't get errors similar to PR7714 on the return path.

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

14 years agorefactor the autosizing code, eliminating duplication
Chris Lattner [Wed, 28 Jul 2010 22:44:07 +0000 (22:44 +0000)]
refactor the autosizing code, eliminating duplication
and making Get8ByteTypeAtOffset always succeed and documented.

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

14 years agoDon't die when a member access refers to a non-class member via a
Douglas Gregor [Wed, 28 Jul 2010 22:27:52 +0000 (22:27 +0000)]
Don't die when a member access refers to a non-class member via a
qualified name. Fixes <rdar://problem/8231724>.

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

14 years agofix PR7714 by not referencing off the end of a struct when passed by value in
Chris Lattner [Wed, 28 Jul 2010 22:15:08 +0000 (22:15 +0000)]
fix PR7714 by not referencing off the end of a struct when passed by value in
x86-64 abi.  This also improves codegen as well.  Some refactoring is needed of
this code.

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

14 years agoTurn off precompiled preamble support for C++
Douglas Gregor [Wed, 28 Jul 2010 22:12:37 +0000 (22:12 +0000)]
Turn off precompiled preamble support for C++

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

14 years agoWhen performing code completion for a case statement in a switch whose
Douglas Gregor [Wed, 28 Jul 2010 21:50:18 +0000 (21:50 +0000)]
When performing code completion for a case statement in a switch whose
condition is not of enumeration type, provide code-completion results
containing all values of integral or enumeral type.

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

14 years agoSupport extended vector types in chained PCH.
Sebastian Redl [Wed, 28 Jul 2010 21:38:49 +0000 (21:38 +0000)]
Support extended vector types in chained PCH.

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

14 years agoAdd a test case for tentative definitions in chained PCH. Fix a bug that completely...
Sebastian Redl [Wed, 28 Jul 2010 21:07:02 +0000 (21:07 +0000)]
Add a test case for tentative definitions in chained PCH. Fix a bug that completely messed up source locations and thus caused a crash whenever a diagnostic was emitted in chained PCH files.

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

14 years agoFix flags in global block descriptor when
Fariborz Jahanian [Wed, 28 Jul 2010 19:07:18 +0000 (19:07 +0000)]
Fix flags in global block descriptor when
block returns structs. Fies radar 8241648.
Executable test added to llvm test suite.

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

14 years agoMake the pointer arguments to the __sync_* builtins pointers to
Douglas Gregor [Wed, 28 Jul 2010 18:42:27 +0000 (18:42 +0000)]
Make the pointer arguments to the __sync_* builtins pointers to
volatile-qualified types. Fixes <rdar://problem/8228293>.

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

14 years agosome cleanups and get alignments correct for various coerce cases.
Chris Lattner [Wed, 28 Jul 2010 18:24:28 +0000 (18:24 +0000)]
some cleanups and get alignments correct for various coerce cases.

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

14 years agoThe grammar for GNU typeof in C requires an expression to be
Douglas Gregor [Wed, 28 Jul 2010 18:22:12 +0000 (18:22 +0000)]
The grammar for GNU typeof in C requires an expression to be
parenthesized, unlike in C++, e.g.,

  C has: typeof ( expression)
  C++ has: typeof unary-expression

So, once we've parsed a parenthesized expression after typeof, we
should only go on to parse the postfix expression suffix if we're in
C++. Fixes <rdar://problem/8237491>.

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

14 years agoTest commit
Tanya Lattner [Wed, 28 Jul 2010 18:19:43 +0000 (18:19 +0000)]
Test commit

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

14 years agoTest commit.
Tanya Lattner [Wed, 28 Jul 2010 18:08:38 +0000 (18:08 +0000)]
Test commit.

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

14 years agoUpdate checker build.
Ted Kremenek [Wed, 28 Jul 2010 17:44:21 +0000 (17:44 +0000)]
Update checker build.

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

14 years agoaccept and ignore a few more gcc warnings.
Chris Lattner [Wed, 28 Jul 2010 16:27:11 +0000 (16:27 +0000)]
accept and ignore a few more gcc warnings.

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

14 years ago Add proper callbacks for DeclStmt -- we weren't recursing on
Craig Silverstein [Wed, 28 Jul 2010 15:54:33 +0000 (15:54 +0000)]
    Add proper callbacks for DeclStmt -- we weren't recursing on
        the decls.  This was just an oversight before; one we didn't
        catch because lots of information in a DeclStmt was also being
        traversed (redundantly) elsewhere.

        Once DeclStmt was cleaned up, I could clean up some of the
        redundant traversals found elswhere as well -- in particular,
        traversing the declarations inside a function as part of the
        function callback (instead of as part of the CompoundExpr
        callback that constitutes the body of the function).  The old
        way was really weird, and led to some parts of local variable
        declarations (but not all) being visited twice.  That is now
        resolved.  I also was able to simplify the traversers for
        IfStmt/WhileStmt/etc, which used to have redundant calls to
        work around the fact DeclStmt wasn't working properly.

        While in the area, I fixed up a few more recursion-ordering
        issues.  I try to hold to the principle that
        RecursiveASTVisitor visits objects in the source code in the
        same order they're typed.  So the return-type of a variable
        comes before the variable-name.  This still isn't perfect, but
        we're closer to that.

Reviewed by chandlerc and wan.

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

14 years agoRename -Wlogical-bitwise-confusion to -Wconstant-logical-operand, which strikes
Daniel Dunbar [Wed, 28 Jul 2010 15:40:39 +0000 (15:40 +0000)]
Rename -Wlogical-bitwise-confusion to -Wconstant-logical-operand, which strikes
me as more consistent and less pejorative.

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

14 years agoPreprocessor: Add support for '#pragma clang __debug crash' and '#pragma clang
Daniel Dunbar [Wed, 28 Jul 2010 15:40:33 +0000 (15:40 +0000)]
Preprocessor: Add support for '#pragma clang __debug crash' and '#pragma clang
__debug overflow_stack'.
 - For testing crash reporting stuff... you'd think I could just use some C++
   code but Doug keeps fixing stuff!

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

14 years agoEnable expression transformations in the current-instantiation
Douglas Gregor [Wed, 28 Jul 2010 15:14:14 +0000 (15:14 +0000)]
Enable expression transformations in the current-instantiation
rebuilder, i.e., remove a silly short-sighted hack from long
ago. Thanks to Abramo Bagnara for the test case/bug report!

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

14 years agoWhen a nested-name-specifier refers into a current instantiation that has
Douglas Gregor [Wed, 28 Jul 2010 14:49:07 +0000 (14:49 +0000)]
When a nested-name-specifier refers into a current instantiation that has
dependent bases, construct a dependent nested-name-specifier rather
than complaining that the name could not be found within the current
instantiation itself. Fixes PR7725.

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

14 years agowe are not supposed to create an improper callsite using a CallInstr; leave a fixme...
Gabor Greif [Wed, 28 Jul 2010 09:19:33 +0000 (09:19 +0000)]
we are not supposed to create an improper callsite using a CallInstr; leave a fixme mentioning the simplification when CallSite can clone itself

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

14 years agoconstruct debug info for "id" by hand.
Devang Patel [Wed, 28 Jul 2010 01:33:15 +0000 (01:33 +0000)]
construct debug info for "id" by hand.
Tested by mi1-var-obj.exp in gdb testsuite.

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

14 years agoWhen creating a jump destination, its scope should be the scope of the
John McCall [Wed, 28 Jul 2010 01:07:35 +0000 (01:07 +0000)]
When creating a jump destination, its scope should be the scope of the
enclosing normal cleanup, not the top of the EH stack.  I'm *really*
surprised this hasn't been causing more problems.

Fixes rdar://problem/8231514.

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

14 years agoAdded some false positive checking to UnreachableCodeChecker
Tom Care [Tue, 27 Jul 2010 23:30:21 +0000 (23:30 +0000)]
Added some false positive checking to UnreachableCodeChecker
- Allowed reporting of dead macros
- Added path walking function to search for false positives in conditional statements
- Updated some affected tests
- Added some false positive test cases

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

14 years agoExtracted out some useful common functions in IdempotentOperationChecker to their...
Tom Care [Tue, 27 Jul 2010 23:26:07 +0000 (23:26 +0000)]
Extracted out some useful common functions in IdempotentOperationChecker to their own CheckerHelpers file.

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

14 years agoAdd PTH test case for <rdar://problem/8227989>.
Ted Kremenek [Tue, 27 Jul 2010 23:06:03 +0000 (23:06 +0000)]
Add PTH test case for <rdar://problem/8227989>.

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

14 years agoRecord macros in dependent PCHs. Also add various info tables to dependent PCHs;...
Sebastian Redl [Tue, 27 Jul 2010 23:01:28 +0000 (23:01 +0000)]
Record macros in dependent PCHs. Also add various info tables to dependent PCHs; tests for this to follow.

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

14 years agoRevert r109546, it broke linux build.
Argyrios Kyrtzidis [Tue, 27 Jul 2010 22:37:14 +0000 (22:37 +0000)]
Revert r109546, it broke linux build.

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

14 years agoMerge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into...
Argyrios Kyrtzidis [Tue, 27 Jul 2010 22:01:17 +0000 (22:01 +0000)]
Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also
needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes.
This fixes current (and avoids future) codegen-from-PCH bugs.

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

14 years agoFix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.
Eli Friedman [Tue, 27 Jul 2010 20:51:02 +0000 (20:51 +0000)]
Fix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.

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

14 years agoAlways use current working directory for DW_AT_comp_dir.
Devang Patel [Tue, 27 Jul 2010 20:49:59 +0000 (20:49 +0000)]
Always use current working directory for DW_AT_comp_dir.

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

14 years agoPR7724: Don't try to evaluate value-dependent expressions.
Eli Friedman [Tue, 27 Jul 2010 19:14:53 +0000 (19:14 +0000)]
PR7724: Don't try to evaluate value-dependent expressions.

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

14 years agoAPIs that take different sized arguments than the instruction
Eric Christopher [Tue, 27 Jul 2010 19:11:16 +0000 (19:11 +0000)]
APIs that take different sized arguments than the instruction
should be taken out and shot.

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

14 years agoFinesse 'idempotent operations' analyzer issues to include the opcode of the binary...
Ted Kremenek [Tue, 27 Jul 2010 18:49:08 +0000 (18:49 +0000)]
Finesse 'idempotent operations' analyzer issues to include the opcode of the binary operator for clearer error reporting.  Also remove the 'Idempotent operation' prefix in messages; it's redundant since the bug type is the same.

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

14 years agoAdd non-static version of BinaryOperator::getOpcodeStr().
Ted Kremenek [Tue, 27 Jul 2010 18:49:04 +0000 (18:49 +0000)]
Add non-static version of BinaryOperator::getOpcodeStr().

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

14 years agoUpdate the list of lexical decls in the TU for chained PCHs. This makes -ast-print...
Sebastian Redl [Tue, 27 Jul 2010 18:24:41 +0000 (18:24 +0000)]
Update the list of lexical decls in the TU for chained PCHs. This makes -ast-print show the decls from the dependent PCH.

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

14 years agoPut 'Idempotent operations' static analyzer issues in the 'Dead code' category.
Ted Kremenek [Tue, 27 Jul 2010 17:52:52 +0000 (17:52 +0000)]
Put 'Idempotent operations' static analyzer issues in the 'Dead code' category.

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

14 years agoReapply 109303.
Devang Patel [Tue, 27 Jul 2010 15:17:16 +0000 (15:17 +0000)]
Reapply 109303.

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

14 years agoFix use-after-free with precompiled preambles
Douglas Gregor [Tue, 27 Jul 2010 14:52:07 +0000 (14:52 +0000)]
Fix use-after-free with precompiled preambles

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

14 years agoAlways deserialize from PCH file scoped variables with non trivial constructor/destru...
Argyrios Kyrtzidis [Tue, 27 Jul 2010 12:56:10 +0000 (12:56 +0000)]
Always deserialize from PCH file scoped variables with non trivial constructor/destructor.

Fixes http://llvm.org/PR7692

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

14 years agoRevert r109428 "Hoist argument type checking into CheckFormatHandler. This is prep...
Michael J. Spencer [Tue, 27 Jul 2010 04:46:02 +0000 (04:46 +0000)]
Revert r109428 "Hoist argument type checking into CheckFormatHandler.  This is prep for scanf format"

Got errors about ASTContext being undefined with Visual Studio 2010.

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

14 years agoDon't warn about unreachable code if the block starts with __builtin_unreachable().
Jordy Rose [Tue, 27 Jul 2010 03:39:53 +0000 (03:39 +0000)]
Don't warn about unreachable code if the block starts with __builtin_unreachable().

The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810.

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

14 years agoAdd PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to those...
Ted Kremenek [Tue, 27 Jul 2010 02:59:02 +0000 (02:59 +0000)]
Add PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to those by Lexer::LexEndOfFile().

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

14 years agoFix predicate in 'InCachingLexMode' to include 'CurPTHLexer'.
Ted Kremenek [Tue, 27 Jul 2010 02:58:59 +0000 (02:58 +0000)]
Fix predicate in 'InCachingLexMode' to include 'CurPTHLexer'.

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

14 years agoPTH generation: Don't save the leading '#' token in a null directive. This unbreaks...
Ted Kremenek [Tue, 27 Jul 2010 02:58:57 +0000 (02:58 +0000)]
PTH generation: Don't save the leading '#' token in a null directive.  This unbreaks using PTH with Boost (<rdar://problem/8227989>).

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

14 years agoGroundwork for C string length tracking. Currently only handles the length of constan...
Jordy Rose [Tue, 27 Jul 2010 01:37:31 +0000 (01:37 +0000)]
Groundwork for C string length tracking. Currently only handles the length of constant string literals, which is not too helpful, and only calls to strlen() are checked.

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

14 years agoImplement -fno-validate-pch at the -cc1 level, which suppresses most
Douglas Gregor [Tue, 27 Jul 2010 00:27:13 +0000 (00:27 +0000)]
Implement -fno-validate-pch at the -cc1 level, which suppresses most
of the usual consistency checks used to determine when a precompiled
header is incompatible with the translation unit it's being loaded
into.

Enable this option when loading a precompiled preamble, because the
preamble loader will be performing all of this checking itself. Enable
the preamble-based test now that it's working.

This option is also useful for debugging Clang's PCH
(<rdar://problem/7532213>).

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

14 years ago- Fix recording of offsets of types in dependent PCHs.
Sebastian Redl [Tue, 27 Jul 2010 00:17:23 +0000 (00:17 +0000)]
- Fix recording of offsets of types in dependent PCHs.
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.

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

14 years agoWhen remapping a virtual file, also make an entry for the file with
Douglas Gregor [Mon, 26 Jul 2010 23:54:23 +0000 (23:54 +0000)]
When remapping a virtual file, also make an entry for the file with
its absolute path on disk. Also, introduce a fun test for the
precompiled preamble, which almost works...

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

14 years ago2nd argument of __builtin_expect must be evaluated
Fariborz Jahanian [Mon, 26 Jul 2010 23:11:03 +0000 (23:11 +0000)]
2nd argument of __builtin_expect must be evaluated
if it hs side-effect to matchgcc's behaviour.
Addresses radar 8172109.

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

14 years agopath renamed.
Chris Lattner [Mon, 26 Jul 2010 22:51:00 +0000 (22:51 +0000)]
path renamed.

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

14 years agoTest for the presence of EH branch-throughs instead of normal branch-throughs.
John McCall [Mon, 26 Jul 2010 22:44:58 +0000 (22:44 +0000)]
Test for the presence of EH branch-throughs instead of normal branch-throughs.
I knew this code duplication would bite me.

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

14 years agoMark __builtin_eh_return as noreturn. Patch by Dimitry Andric.
Benjamin Kramer [Mon, 26 Jul 2010 22:04:15 +0000 (22:04 +0000)]
Mark __builtin_eh_return as noreturn. Patch by Dimitry Andric.

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

14 years agoFix an apparent bug.
Dan Gohman [Mon, 26 Jul 2010 21:44:15 +0000 (21:44 +0000)]
Fix an apparent bug.

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

14 years agoIntroduce basic support for loading a precompiled preamble while
Douglas Gregor [Mon, 26 Jul 2010 21:36:20 +0000 (21:36 +0000)]
Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.

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

14 years agoMinor code simplification.
Dan Gohman [Mon, 26 Jul 2010 21:33:22 +0000 (21:33 +0000)]
Minor code simplification.

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

14 years agoIt's not necessary to call flush() on a raw_ostream immediately prior
Dan Gohman [Mon, 26 Jul 2010 21:29:50 +0000 (21:29 +0000)]
It's not necessary to call flush() on a raw_ostream immediately prior
to deleting it.

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

14 years agoFix namespace polution.
Dan Gohman [Mon, 26 Jul 2010 21:25:24 +0000 (21:25 +0000)]
Fix namespace polution.

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

14 years agoMake a variable static.
Dan Gohman [Mon, 26 Jul 2010 21:12:29 +0000 (21:12 +0000)]
Make a variable static.

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

14 years agoUse an export file. Plugins must export llvm::Registry symbols.
Dan Gohman [Mon, 26 Jul 2010 21:12:10 +0000 (21:12 +0000)]
Use an export file. Plugins must export llvm::Registry symbols.
Also, don't link in all the clang libraries statically.

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

14 years agoHoist argument type checking into CheckFormatHandler. This is prep for scanf format
Ted Kremenek [Mon, 26 Jul 2010 19:45:54 +0000 (19:45 +0000)]
Hoist argument type checking into CheckFormatHandler.  This is prep for scanf format
string argument type checking.

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

14 years agoConsolidate #args checking for scanf/printf format strings.
Ted Kremenek [Mon, 26 Jul 2010 19:45:42 +0000 (19:45 +0000)]
Consolidate #args checking for scanf/printf format strings.

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