Commit Graph

108667 Commits

Author SHA1 Message Date
Francois Pichet ccc50d7cf4 Fix the BrainF build.
llvm-svn: 134975
2011-07-12 08:43:36 +00:00
Douglas Gregor e5802234f9 Implement name mangling for sizeof...(function parameter pack).
llvm-svn: 134974
2011-07-12 07:03:48 +00:00
Douglas Gregor 4a80f9fd98 Fix the desugaring of dependent decltype and typeof(expr) nodes. The
isSugared() and desugar() routines previously provided were never
actually called, since the corresponding types
(DependentTypeOfExprType, DependentDecltypeType) don't have
corresponding type classes. Outside of the current (incomplete) patch
I'm working on, I haven't found a way to trigger this problem.

llvm-svn: 134973
2011-07-12 06:55:29 +00:00
Chris Lattner 3f32d69699 Fix a problem Eli ran into where we now reject incomplete arrays of
uncompleted struct types.  We now do what llvm-gcc does and compile
them into [i8 x 0].  If the type is later completed, we make sure that
it is appropriately cast.

We compile the terrible example to something like this now:

%struct.A = type { i32, i32, i32 }

@g = external global [0 x i8]

define void @_Z1fv() nounwind {
entry:
  call void @_Z3fooP1A(%struct.A* bitcast ([0 x i8]* @g to %struct.A*))
  ret void
}

declare void @_Z3fooP1A(%struct.A*)

define %struct.A* @_Z2f2v() nounwind {
entry:
  ret %struct.A* getelementptr inbounds ([0 x %struct.A]* bitcast ([0 x i8]* @g to [0 x %struct.A]*), i32 0, i64 1)
}

llvm-svn: 134972
2011-07-12 06:52:18 +00:00
Chris Lattner d59d867ca5 insert a bitcast in the 'expand' case of argument passing when needed. This
fixes the -m32 build of oggenc.

llvm-svn: 134971
2011-07-12 06:29:11 +00:00
Chris Lattner 73e3004e75 fix an unintended behavior change in the type system rewrite, which caused us to compile
stuff like this:

typedef struct {
 int x, y, z; 
} foo_t;

foo_t g;

into:
%"struct.<anonymous>" = type { i32, i32, i32 }
we now get:
%struct.foo_t = type { i32, i32, i32 }

This doesn't change the behavior of the compiler, but makes the IR much easier to read.

llvm-svn: 134969
2011-07-12 05:53:08 +00:00
Chris Lattner 6ebfbf5092 simplify assertions to not be completely redundant.
llvm-svn: 134968
2011-07-12 05:26:21 +00:00
Douglas Gregor 1cf9dd21dc Mangle dependent template names of unknown arity
llvm-svn: 134967
2011-07-12 05:06:05 +00:00
Chris Lattner 3ce8668273 fix PR10335 by watching out for IR type compatibility in call argument lists.
llvm-svn: 134966
2011-07-12 04:53:39 +00:00
Argyrios Kyrtzidis 9b72b0c7d5 Move OBJC_PR_NumBits out of PropertyAttributeKind enum, to its own NumPropertyAttrsBits.
No functionality change.

llvm-svn: 134965
2011-07-12 04:52:08 +00:00
Chris Lattner 5e3ef09f20 make test name less specific
llvm-svn: 134964
2011-07-12 04:51:05 +00:00
Douglas Gregor 6ef06cc48d Implement the Itanium C++ ABI's mangling rule for
non-instantiation-dependent sizeof and alignof expressions.

llvm-svn: 134963
2011-07-12 04:47:20 +00:00
Chris Lattner bb1952cfda add some aggressive assertions that call arguments match up to callee
expectations in EmitCall.  Next patch will take this further.

llvm-svn: 134962
2011-07-12 04:46:18 +00:00
Douglas Gregor 842806450c Centralize the getCanonicalType() calls in the Itanium C++ mangling
code so that they only occur in a single place. No functionality change.

llvm-svn: 134961
2011-07-12 04:42:08 +00:00
Argyrios Kyrtzidis 52bfc2b668 [ARC] Complain about property without storage attribute when @synthesizing it, not at its declaration.
For this sample:

@interface Foo
@property id x;
@end

we get:

t.m:2:1: error: ARC forbids properties of Objective-C objects with unspecified storage attribute
@property  id x;
^
1 error generated.

The error should be imposed on the implementor of the interface, not the user. If the user uses
a header of a non-ARC library whose source code he does not have, we are basically asking him to
go change the header of the library (bad in general), possible overriding how the property is
implemented if he gets confused and says "Oh I'll just add 'copy' then" (even worse).

Second issue is that we don't emit any error for 'readonly' properties, e.g:

@interface Foo
@property (readonly) id x; // no error  here
@end

@implementation Foo
@synthesize x; // no error here too
@end

We should give an error when the implementor is @synthesizing a property which doesn't have
any storage specifier; this is when the explicit specifier is important, because we are
going to create an ivar and we want its ownership to be explicit.

Related improvements:
-OBJC_PR_unsafe_unretained turned out to not fit in ObjCPropertyDecl's bitfields, fix it.
-For properties of extension classes don't drop PropertyAttributesAsWritten values.
-Have PropertyAttributesAsWritten actually only reflect what the user wrote

rdar://9756610.

llvm-svn: 134960
2011-07-12 04:30:16 +00:00
Chris Lattner b1907b2ab0 make the IRBuilder type methods return non-const types.
llvm-svn: 134959
2011-07-12 04:14:22 +00:00
Andrew Trick 1b9d9b6b7a Comment correction.
llvm-svn: 134958
2011-07-12 03:39:22 +00:00
Jim Ingham a5a97ebe3c Added "command history" command to dump the command history.
Also made:
(lldb) !<NUM>
(lldb) !-<NUM>
(lldb) !!

work with the history.  For added benefit:

(lldb) !<NUM><TAB>

will insert the command at position <NUM> in the history into the command line to be edited.

This is only partial, I still need to sync up editline's history list with the one kept by the interpreter.

llvm-svn: 134955
2011-07-12 03:12:18 +00:00
Bruno Cardoso Lopes 37b7fd0ab2 Fix a typo!
llvm-svn: 134952
2011-07-12 02:47:38 +00:00
Bruno Cardoso Lopes 75541d00e0 Do the same as r134946 for arrays. Add more testcases for avx x86_64 arg
passing.

llvm-svn: 134951
2011-07-12 01:27:38 +00:00
Bill Wendling 7475113d74 Revert r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, line 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134888 into '.':
U    lib/CodeGen/CodeGenModule.cpp

llvm-svn: 134950
2011-07-12 01:16:47 +00:00
Bill Wendling a78cd228c2 Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U    include/llvm/Target/TargetData.h
U    include/llvm/DerivedTypes.h
U    tools/bugpoint/ExtractFunction.cpp
U    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/ARM/ARMGlobalMerge.cpp
U    lib/Target/TargetData.cpp
U    lib/VMCore/Constants.cpp
U    lib/VMCore/Type.cpp
U    lib/VMCore/Core.cpp
U    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Instrumentation/ProfilingUtils.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G    include/llvm/DerivedTypes.h
U    include/llvm/Support/TypeBuilder.h
U    include/llvm/Intrinsics.h
U    unittests/Analysis/ScalarEvolutionTest.cpp
U    unittests/ExecutionEngine/JIT/JITTest.cpp
U    unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U    unittests/VMCore/PassManagerTest.cpp
G    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U    lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U    lib/VMCore/IRBuilder.cpp
G    lib/VMCore/Type.cpp
U    lib/VMCore/Function.cpp
G    lib/VMCore/Core.cpp
U    lib/VMCore/Module.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/Transforms/Utils/CloneFunction.cpp
G    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Utils/InlineFunction.cpp
U    lib/Transforms/Instrumentation/GCOVProfiling.cpp
U    lib/Transforms/Scalar/ObjCARC.cpp
U    lib/Transforms/Scalar/SimplifyLibCalls.cpp
U    lib/Transforms/Scalar/MemCpyOptimizer.cpp
G    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/Transforms/IPO/ArgumentPromotion.cpp
U    lib/Transforms/InstCombine/InstCombineCompares.cpp
U    lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U    lib/Transforms/InstCombine/InstCombineCalls.cpp
U    lib/CodeGen/DwarfEHPrepare.cpp
U    lib/CodeGen/IntrinsicLowering.cpp
U    lib/Bitcode/Reader/BitcodeReader.cpp

llvm-svn: 134949
2011-07-12 01:15:52 +00:00
Alexis Hunt 8dfec1ac7d Make sure that __time_put constructors properly on non-Apple platforms.
llvm-svn: 134947
2011-07-12 00:55:04 +00:00
Bruno Cardoso Lopes 7a26681092 Fix one x86_64 abi issue and the test to actually look for the right thing,
which is: { <4 x float>, <4 x float> } should continue to go through memory.

llvm-svn: 134946
2011-07-12 00:30:27 +00:00
Nick Lewycky e9bb9a0baa TypeMap had a destructor that destroyed the types it held. DenseMap did not, so
destroy those types in ~LLVMContext.

llvm-svn: 134945
2011-07-12 00:26:08 +00:00
Enrico Granata d62e57fbe4 test case for the named summaries feature
llvm-svn: 134944
2011-07-12 00:19:00 +00:00
Enrico Granata f9fa6ee5e3 named summaries:
- a new --name option for "type summary add" lets you give a name to a summary
 - a new --summary option for "frame variable" lets you bind a named summary to one or more variables
${var%s} now works for printing the value of 0-terminated CStrings
type format test case now tests for cascading
 - this is disabled on GCC because GCC may end up stripping typedef chains, basically breaking cascading
new design for the FormatNavigator class
new template class CleanUp2 meant to support cleanup routines with 1 additional parameter beyond resource handle

llvm-svn: 134943
2011-07-12 00:18:11 +00:00
John McCall 5fcf8da33d Do full-expression cleanups in a much more sensible way that still lets
people write useful cleanup classes.

llvm-svn: 134942
2011-07-12 00:15:30 +00:00
Andrew Trick cdc2297ee1 indvars: Code reorganization in preparation for
LinearFunctionTestReplace rewrite. No functionality.

I've been wanting to group the indvar subphases into sections and
order them by their logical sequence. My next checkin adds functions
related to LFTR, and doing the reorg now should help reviewers. Since,
most of the code in IndVarSimplify.cpp has recently been replaced or
will be replaced soon, obscuring blame should not be an issue. This
seems like an ideal time to shuffle the code around.

I'm happy to take more suggestions for cleaning up the code. Or if
you've been wanting to cleanup anything in this file yourself, now is
a good time.

llvm-svn: 134941
2011-07-12 00:08:50 +00:00
Johnny Chen 1d3e880c2c Passing in os.ctermid() as the arg for SBTarget.Launch(...) for stdin_path, stdout_path, and stderr_path
is just wrong and resulted in the inferior's output getting mixed into the GDB remote communication's
log file.  Change all test cases to not pass os.ctermid() and either use SBTarget.LaunchSimple() or
SBTarget.Launch() and pass None as stdin_path/stdout_path/srderr_path to use a pseudo terminal.

rdar://problem/9716499 program output is getting mixed into the GDB remote communications

llvm-svn: 134940
2011-07-11 23:38:23 +00:00
Bruno Cardoso Lopes 3472838c7a Disable avx feature from corei7-avx, and use -mavx for now. Right now, if -mavx is
specified, 128 avx code is used and we're not sure yet if this the behavior
we want (and if it does, some improvements are needed before relying on it).

llvm-svn: 134939
2011-07-11 23:33:46 +00:00
Chandler Carruth 9312c6464d Style tweak to the more idiomatic 'assert(!bad_state())'.
Patch by Caitlin Sadowski.

llvm-svn: 134938
2011-07-11 23:33:05 +00:00
Chandler Carruth fcc48d9e71 Hoist the logic for checking the number of arguments to an attribute
into a static helper.

Original patch by Caitlin Sadowski, style tweaks by me.

llvm-svn: 134937
2011-07-11 23:30:35 +00:00
Eric Christopher 71520a867d Revert r134921, 134917, 134908 and 134907. They're causing failures
in multiple buildbots.

llvm-svn: 134936
2011-07-11 23:06:52 +00:00
Bruno Cardoso Lopes 571419bae6 Enable "avx" feature, so it can be seen by llvm
llvm-svn: 134935
2011-07-11 22:50:13 +00:00
Bruno Cardoso Lopes 21a41bb5ec Reapply r134754, which turns out to be working correctly and also
add one more testcase.

llvm-svn: 134934
2011-07-11 22:41:29 +00:00
John Wiegley 2a0177ba4c fix some examples
llvm-svn: 134933
2011-07-11 22:39:46 +00:00
Douglas Gregor 2e12550e37 Allow us to compute linkage et al for instantiation-dependent types.
llvm-svn: 134932
2011-07-11 22:38:07 +00:00
NAKAMURA Takumi 9a9ec73665 Revert r134898, "test/Frontend/dependency-gen.c: Mark XFAIL: mingw due to PR10331. to appease mingw-target (and non-mingw-host) builds.
PR10331 is still alive I suppose.

llvm-svn: 134931
2011-07-11 22:34:14 +00:00
Cameron Zwarich 4d4b022478 Fix LTO after the recent MC subtarget refactoring.
llvm-svn: 134930
2011-07-11 22:19:51 +00:00
Argyrios Kyrtzidis bf65d2d820 Reenable test.
llvm-svn: 134928
2011-07-11 21:58:47 +00:00
Argyrios Kyrtzidis c645d60f12 Add missing header file for the test.
llvm-svn: 134927
2011-07-11 21:58:44 +00:00
Eli Friedman 6290ae476e Add diagnostic for constructs like "va_arg(l, float)" which have undefined behavior. PR10201.
llvm-svn: 134926
2011-07-11 21:45:59 +00:00
Eli Friedman 8532db2ec4 Test is broken; XFAIL it until Argyrios gets a chance to look at it.
llvm-svn: 134925
2011-07-11 21:44:14 +00:00
Johnny Chen 928f4ee26f Add missing docstring for 'bool stop_at_endtry'.
llvm-svn: 134924
2011-07-11 21:41:05 +00:00
Evan Cheng 58a98141d9 Most MCCodeEmitter's don't meed MCContext.
llvm-svn: 134922
2011-07-11 21:24:15 +00:00
David Greene cf8a603a1b Use get(0 Instead of Create()
Respond to some feedback asking for a name change.

llvm-svn: 134921
2011-07-11 20:55:22 +00:00
Evan Cheng af645a2356 Disassembler doesn't need TargetMachine anymore.
llvm-svn: 134920
2011-07-11 20:40:56 +00:00
Argyrios Kyrtzidis 2299889f87 Don't warn for unused macro when undef'ing it, if it comes from an included file. rdar://9745065
llvm-svn: 134919
2011-07-11 20:39:47 +00:00
Argyrios Kyrtzidis a59dbea017 Fix CMake.
llvm-svn: 134918
2011-07-11 20:28:59 +00:00