|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| | options align.
llvm-svn: 109952 | 
| | 
| 
| 
| 
| 
| | for malloc/free checking.  Patch by Andrew McGregor!
llvm-svn: 109939 | 
| | 
| 
| 
| 
| 
| 
| | the files in the precompiled preamble have changed since it was build,
force the preamble to be rebuilt.
llvm-svn: 109937 | 
| | 
| 
| 
| | llvm-svn: 109893 | 
| | 
| 
| 
| 
| 
| | environment variable is set.
llvm-svn: 109890 | 
| | 
| 
| 
| | llvm-svn: 109871 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | This patch reimplements the find*Specialization family of member
functions of {Class,Function}TemplateDecl in terms of a common
implementation that uses SpecEntryTraits to obtain the most recent
declaration.
llvm-svn: 109869 | 
| | 
| 
| 
| | llvm-svn: 109867 | 
| | 
| 
| 
| 
| 
| 
| | auto-synthesized (nonfragile-abi2 specific).
Fixes radar 8251648.
llvm-svn: 109866 | 
| | 
| 
| 
| | llvm-svn: 109865 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | notify the PCHReader to hold off passing Decls
to the consumer until the DeclContext is fully prepared.
Before, due to recursive loading, we could be in a situation where we would try to deserialize the decls of a DeclContext which was already doing that, and bad things would happen. In the specific case I encountered, the lexical decls would
form a cycle and we would enter infinite loop territory.
llvm-svn: 109857 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | -Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing)
-Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing
  to ExternalASTSource.
These are preparation for the next commit.
llvm-svn: 109856 | 
| | 
| 
| 
| 
| 
| 
| 
| | (e.g. due to a broken template argument) following template parameters.
Fixes rdar://problem/8254267
llvm-svn: 109853 | 
| | 
| 
| 
| 
| 
| | some downstream crashes, among them rdar://problem/8229840.
llvm-svn: 109850 | 
| | 
| 
| 
| 
| 
| 
| 
| | an initializer requiring temporary object disposal.
Fixes rdar:://problem/8246444.
llvm-svn: 109849 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | The X86-64 ABI code didn't handle the case when a struct
would get classified and turn up as "NoClass INTEGER" for
example.  This is perfectly possible when the first slot
is all padding (e.g. due to empty base classes).  In this
situation, the first 8-byte doesn't take a register at all,
only the second 8-byte does.
This fixes this by enhancing the x86-64 abi stuff to allow
and handle this case, reverts the broken fix for PR5831,
and enhances the target independent stuff to be able to 
handle an argument value in registers being accessed at an
offset from the memory value.
This is the last x86-64 calling convention related miscompile
that I'm aware of.
llvm-svn: 109848 | 
| | 
| 
| 
| | llvm-svn: 109833 | 
| | 
| 
| 
| 
| 
| | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now.
llvm-svn: 109823 | 
| | 
| 
| 
| 
| 
| 
| | sections on", this change uncovered a possible linker bug which resulted in the
wrong messages getting dispatched. Backing this out while we investigate...
llvm-svn: 109817 | 
| | 
| 
| 
| | llvm-svn: 109814 | 
| | 
| 
| 
| 
| 
| | Objective-C object and interface types. This is part of PR7741.
llvm-svn: 109808 | 
| | 
| 
| 
| 
| 
| | that needs it and remove getCoerceResult.
llvm-svn: 109807 | 
| | 
| 
| 
| | llvm-svn: 109805 | 
| | 
| 
| 
| 
| 
| | float, the special case hack in getCoerceResult can go away.
llvm-svn: 109804 | 
| | 
| 
| 
| 
| 
| | functionality change.
llvm-svn: 109797 | 
| | 
| 
| 
| 
| 
| | early codegen/deserialization.
llvm-svn: 109796 | 
| | 
| 
| 
| 
| 
| 
| 
| | <2 x float> instead of double.  This works but can't be turned
on until I teach codegen to pass <2 x float> as one XMM register
instead of two.
llvm-svn: 109790 | 
| | 
| 
| 
| | llvm-svn: 109786 | 
| | 
| 
| 
| | llvm-svn: 109785 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.
This is 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.
Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext,
thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen.
This fixes current (and avoids future) codegen-from-PCH bugs.
llvm-svn: 109784 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | end of a struct.  This improves the case when the struct being passed
contains 3 floats, either due to a struct or array of 3 things.  Before
we'd generate this IR for the testcase:
define float @bar(double %X.coerce0, double %X.coerce1) nounwind {
entry:
  %X = alloca %struct.foof, align 8               ; <%struct.foof*> [#uses=2]
  %0 = bitcast %struct.foof* %X to %1*            ; <%1*> [#uses=2]
  %1 = getelementptr %1* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %X.coerce0, double* %1
  %2 = getelementptr %1* %0, i32 0, i32 1         ; <double*> [#uses=1]
  store double %X.coerce1, double* %2
  %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
  %tmp1 = load float* %tmp                        ; <float> [#uses=1]
  ret float %tmp1
}
which compiled (with optimization) to:
_bar:                                   ## @bar
## BB#0:                                ## %entry
	movd	%xmm1, %rax
	movd	%eax, %xmm0
	ret
Now we produce:
define float @bar(double %X.coerce0, float %X.coerce1) nounwind {
entry:
  %X = alloca %struct.foof, align 8               ; <%struct.foof*> [#uses=2]
  %0 = bitcast %struct.foof* %X to %0*            ; <%0*> [#uses=2]
  %1 = getelementptr %0* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %X.coerce0, double* %1
  %2 = getelementptr %0* %0, i32 0, i32 1         ; <float*> [#uses=1]
  store float %X.coerce1, float* %2
  %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
  %tmp1 = load float* %tmp                        ; <float> [#uses=1]
  ret float %tmp1
}
and:
_bar:                                   ## @bar
## BB#0:                                ## %entry
	movaps	%xmm1, %xmm0
	ret
llvm-svn: 109776 | 
| | 
| 
| 
| 
| 
| 
| | as <2 x float> instead of as double.  The backend isn't ready
yet, but infrastructure in the frontend can come up.
llvm-svn: 109768 | 
| | 
| 
| 
| 
| 
| 
| | make it clear that this function should only return a type
that the codegen will classify the same as an INTEGER type.
llvm-svn: 109763 | 
| | 
| 
| 
| 
| 
| | that Eli pointed out, rdar://8249586
llvm-svn: 109762 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | return where the struct has a base but no fields.  This
was because the x86-64 abi logic was checking the wrong
predicate in one place.
This was introduced in r91874, which was a fix for PR5831,
which lacked a CHECK line, so I verified and added it.
llvm-svn: 109759 | 
| | 
| 
| 
| 
| 
| 
| | variables to those in file scope (nonfragile-abi2).
Fixes radar 8248681.
llvm-svn: 109758 | 
| | 
| 
| 
| 
| 
| | with CK_NoOp. Fixes PR7727.
llvm-svn: 109757 | 
| | 
| 
| 
| 
| 
| 
| | This patch uses the newly added Latest field of CommonBase to provide
a getNextRedeclaration() implementation for RedeclarableTemplateDecl.
llvm-svn: 109756 | 
| | 
| 
| 
| 
| 
| 
| | This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase
class which is used to store the latest redeclaration.
llvm-svn: 109755 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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.
llvm-svn: 109754 | 
| | 
| 
| 
| 
| 
| 
| | one because we're referencing a variable of type NSString &), the
resulting type is an ObjCObjectPointerType.
llvm-svn: 109753 | 
| | 
| 
| 
| 
| 
| 
| | qualifiers) when checking a K&R function definition against a previous
prototype. Fixes <rdar://problem/8193107>.
llvm-svn: 109751 | 
| | 
| 
| 
| 
| 
| | before looking for conversions to pointer type. Fixes <rdar://problem/8248780>.
llvm-svn: 109749 | 
| | 
| 
| 
| 
| 
| | unions have size 0 in C, size 1 in C++. Put this warning under -Wc++-compat.
llvm-svn: 109748 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 :)
 
llvm-svn: 109738 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 :)
llvm-svn: 109737 | 
| | 
| 
| 
| | llvm-svn: 109735 | 
| | 
| 
| 
| 
| 
| | than copying each character.
llvm-svn: 109734 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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
llvm-svn: 109733 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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
llvm-svn: 109732 |