Commit Graph

105649 Commits

Author SHA1 Message Date
Rafael Espindola 71f8b08a80 Extra refactoring noticed by Eli Friedman.
llvm-svn: 131405
2011-05-16 15:48:45 +00:00
Joerg Sonnenberger 637603a7cc Make the triple an explicit argument of FindTargetProgramPath.
Preserve the original triple in the NetBSD toolchain when using -m32 or
-m64 and the resulting effective target is different from the triple it
started with. This allows -m32 to use the same assembler/linking in
cross-compiling mode and avoids confusion about passing down target
specific flags in that case like --32.

llvm-svn: 131404
2011-05-16 13:35:02 +00:00
Rafael Espindola 5ec1941e58 Add test for PR9927.
llvm-svn: 131403
2011-05-16 12:42:39 +00:00
Zhongxing Xu 56cf054a35 Remove redundant template partial specilization.
llvm-svn: 131402
2011-05-16 12:42:22 +00:00
Rafael Espindola c0d4cb17c1 Revert 131377, 131369 and 131365.
131365 caused PR9927.

llvm-svn: 131401
2011-05-16 12:30:54 +00:00
Anders Carlsson d6f1518cc9 Fix another regression from the "skip vtable pointer initialization"
optimization. Make sure to require a vtable when trying to get the address
of a VTT, otherwise we would never end up emitting the VTT.

llvm-svn: 131400
2011-05-16 04:08:36 +00:00
Rafael Espindola 2050af838d Don't do tail calls in a function that call setjmp. The stack might be
corrupted when setjmp returns again.

llvm-svn: 131399
2011-05-16 03:05:33 +00:00
Greg Clayton 93ecc368c1 Add support for the 'G' packet not being implemented or returning an error.
If we are asked to restore all register values, we need to fall back to 
restoring each register one by one.

llvm-svn: 131398
2011-05-16 03:02:32 +00:00
Greg Clayton b4aaf2e78d Fixed an issue where large memory writes might not get chunked up into smaller
packets in GDB remote.

Also fixed a compiler warning for an unhandled case for a switch.

llvm-svn: 131397
2011-05-16 02:35:02 +00:00
John McCall 92e18ed40f Stop leaving a.out files around.
llvm-svn: 131396
2011-05-16 02:23:45 +00:00
John McCall 7ec4b4342c Don't actually emit calls to the reserved global placement new and delete
operators;  their semantics are guaranteed by the language.

If someone wants to argue that freestanding compiles shouldn't recognize
this, I might be convinceable.

llvm-svn: 131395
2011-05-16 01:05:12 +00:00
Greg Clayton 1cfca1dc09 Dump JIT memory requirements when "log enable lldb expr" logging is enabled.
Correctly handle invalid 32-bit mmap fail return value in ProcessGDBRemote.

llvm-svn: 131394
2011-05-15 23:56:52 +00:00
Greg Clayton 17a0cb68c9 Properly handle when commands are not unsupported in the GDB remote clients.
Prior to this fix we would often call SendPacketAndWaitForResponse() which
returns the number of bytes in the response. The UNSUPPORTED response in the
GDB remote protocol is zero bytes and we were checking for it inside an if
statement:

if (SendPacketAndWaitForResponse(...))
{
    if (response.IsUnsupportedResponse())
    {
        // UNSUPPORTED...
        // This will never happen...
    }
}

We now handle is properly as:

if (SendPacketAndWaitForResponse(...))
{
}
else
{
    // UNSUPPORTED...
}

llvm-svn: 131393
2011-05-15 23:46:54 +00:00
Greg Clayton 5d353156d0 Added the ability to get a 32 or 64 bit simple return value from the
ABIMacOSX_arm plugin.

Modified darwin-debug to print out the exectuable, working directory and
arguments a bit differently.

llvm-svn: 131392
2011-05-15 22:49:24 +00:00
Sean Callanan d12cf8bbc9 Updated to use the latest LLVM/Clang, to pick up JIT
changes.

llvm-svn: 131391
2011-05-15 22:34:38 +00:00
Alexis Hunt f9933e80f2 main() exists in hosted, not freestanding implementations. Fixes the
build.

llvm-svn: 131390
2011-05-15 20:59:31 +00:00
Greg Clayton 3f71643cc9 Fixed the default ARM registers to have the generic argument
definitions and names.

llvm-svn: 131387
2011-05-15 17:52:30 +00:00
John McCall 53ffd3714f Add a method for checking whether a function is one of the reserved global
placement allocation or deallocation functions.  These functions cannot be
replaced by the user and are exempt from the normal requirements on
allocation functions (e.g. that they must return unaliased memory).

llvm-svn: 131386
2011-05-15 17:49:20 +00:00
Anders Carlsson 49c0bd2a25 Re-enable the fix for PR9181 now that all the edge cases are handled.
llvm-svn: 131385
2011-05-15 17:36:21 +00:00
Charles Davis 2f10078ae7 Fix copy-pasto.
llvm-svn: 131384
2011-05-15 17:28:27 +00:00
Douglas Gregor 9d07dfa439 When checking a set of template parameter lists against a
nested-name-specifier, re-evaluate the nested-name-specifier as if we
were entering that context (which we did!), so that we'll resolve a
template-id to a particular class template partial
specialization. Fixes PR9913.

llvm-svn: 131383
2011-05-15 17:27:27 +00:00
Charles Davis af18d07ed6 Add stub methods to MCStreamer for emitting Win64 exception-handling
information.

llvm-svn: 131382
2011-05-15 17:20:01 +00:00
Charles Davis 757aa983dd Get rid of extern "C" from the Win64 EH header.
llvm-svn: 131381
2011-05-15 17:09:26 +00:00
Charles Davis 215b92d24b Add a header containing definitions used to implement Win64 exception handling.
llvm-svn: 131380
2011-05-15 14:42:22 +00:00
Nick Lewycky 0db2654023 Declare this function here so that it doesn't get C++ mangling.
llvm-svn: 131379
2011-05-15 07:20:34 +00:00
John McCall 036f2f6b35 The array-size operand to a new-expression is not necessarily a size_t.
It can be larger, it can be smaller, it can be signed, whatever.  Handle
all the crazy cases with grace and spirit.

llvm-svn: 131378
2011-05-15 07:14:44 +00:00
Argyrios Kyrtzidis 8cd0a7e263 Fix MSVC build.
llvm-svn: 131377
2011-05-15 05:10:24 +00:00
Greg Clayton 9a8fa9161f Added generic register numbers for simple ABI argument registers and defined
the appropriate registers for arm and x86_64. The register names for the
arguments that are the size of a pointer or less are all named "arg1", "arg2",
etc. This allows you to read these registers by name:

(lldb) register read arg1 arg2 arg3
...

You can also now specify you want to see alternate register names when executing
the read register command:

(lldb) register read --alternate
(lldb) register read -A

llvm-svn: 131376
2011-05-15 04:12:07 +00:00
John McCall 745ae2853c Make CGF.getContext() inlinable, because it's trivial, and optimize
hasAggregateLLVMType.

llvm-svn: 131375
2011-05-15 02:34:36 +00:00
John McCall 85dd2c5039 More killing of std::vector.
llvm-svn: 131374
2011-05-15 02:19:42 +00:00
John McCall 9dc0db2192 Use arrays and SmallVectors instead of std::vectors when building function
types.  Also, cache a translation of 'void' in CGM and provide a ptrdiff_t
alias.  No functionality change.

llvm-svn: 131373
2011-05-15 01:53:33 +00:00
Anders Carlsson b55c8c127e Disable the optimization until the bug noticed by Sean Hunt has been fixed.
llvm-svn: 131372
2011-05-15 01:50:14 +00:00
Greg Clayton ae34ee80d3 Modified the lldb.xcodeproj to not have the headers in a copy files phase
for lldb-core.

llvm-svn: 131371
2011-05-15 01:30:30 +00:00
Greg Clayton 70b5765740 Added the ability to get the return value from a ThreadPlanCallFunction
thread plan. In order to get the return value, you can call:

        void
        ThreadPlanCallFunction::RequestReturnValue (lldb::ValueSP &return_value_sp);
        
This registers a shared pointer to a return value that will get filled in if
everything goes well. After the thread plan is run the return value will be
extracted for you.

Added an ifdef to be able to switch between the LLVM MCJIT and the standand JIT.
We currently have the standard JIT selected because we have some work to do to
get the MCJIT fuctioning properly.

Added the ability to call functions with 6 argument in the x86_64 ABI.

Added the ability for GDBRemoteCommunicationClient to detect if the allocate
and deallocate memory packets are supported and to not call allocate memory 
("_M") or deallocate ("_m") if we find they aren't supported.

Modified the ProcessGDBRemote::DoAllocateMemory(...) and ProcessGDBRemote::DoDeallocateMemory(...) 
to be able to deal with the allocate and deallocate memory packets not being 
supported. If they are not supported, ProcessGDBRemote will switch to calling
"mmap" and "munmap" to allocate and deallocate memory instead using our 
trivial function call support.

Modified the "void ProcessGDBRemote::DidLaunchOrAttach()" to correctly ignore 
the qHostInfo triple information if any was specified in the target. Currently 
if the target only specifies an architecture when creating the target:

(lldb) target create --arch i386 a.out

Then the vendor, os and environemnt will be adopted by the target.

If the target was created with any triple that specifies more than the arch:

(lldb) target create --arch i386-unknown-unknown a.out

Then the target will maintain its triple and not adopt any new values. This
can be used to help force bare board debugging where the dynamic loader for
static files will get used and users can then use "target modules load ..."
to set addressses for any files that are desired.

Added back some convenience functions to the lldb_private::RegisterContext class
for writing registers with unsigned values. Also made all RegisterContext
constructors explicit to make sure we know when an integer is being converted
to a RegisterValue. 

llvm-svn: 131370
2011-05-15 01:25:55 +00:00
Argyrios Kyrtzidis ba6685c390 Fix generation of obj-c @encoding for members with zero size.
Also follow gcc in that arrays of elements with zero size are encoded as arrays with zero elements.

llvm-svn: 131369
2011-05-15 00:11:35 +00:00
Anders Carlsson 9bd7d16440 When emitting the destructor for a class with a vtable, if we can determine
that the destructor body is trivial and that all member variables also have either
trivial destructors or trivial destructor bodies, we don't need to initialize the
vtable pointers since no virtual member functions will be called on the destructor.

Fixes PR9181.

llvm-svn: 131368
2011-05-14 23:26:09 +00:00
Nico Weber 1eace078a4 Let clang-check actually use the Directory entry in the json file.
llvm-svn: 131367
2011-05-14 21:20:23 +00:00
John McCall 5880fb8edf Only perform the null-initialization of an aggregate result of a message
send if the receiver is null.  Normally it's not worthwhile to check this,
but avoiding the null-initialization is nice, and this also avoids nasty
problems where the null-initialization is visible within the call because
we use an aliased result buffer.  rdar://problem/9402992

llvm-svn: 131366
2011-05-14 21:12:11 +00:00
Argyrios Kyrtzidis dd72aafffc Create proper Objective-C @encoding for C++ classes; fixes rdar://9357400.
Go through and expand the members of bases into the encoding string (and encode the VTable as well).
Unlike gcc which expands virtual bases as many times as they appear in the
hierarchy, clang will only expand them once at the end, to reflect the actual layout.

Note that there doesn't seem to be a way to indicate in the encoding that
packing/alignment of members is different that normal, in which case
the encoding will be out-of-sync with the real layout.
If the runtime switches to just consider the size of types without
taking into account alignment, we could easily make padding explicit in the
encoding (e.g. using arrays of chars). The encoding strings would be
longer then though.

Also encode a flexible array member as array of 0 size, like gcc, not as a pointer.

llvm-svn: 131365
2011-05-14 20:32:43 +00:00
Argyrios Kyrtzidis 7da04c6367 Emit an error when trying to @encode an incomplete type.
There are APIs, e.g. [NSValue valueWithBytes:objCType:], which use the encoding to find out
the size of an object pointed to by a pointer. Make things safer by making it illegal to @encode
incomplete types.

llvm-svn: 131364
2011-05-14 20:32:39 +00:00
Benjamin Kramer cb7e56e592 Disable test harder.
llvm-svn: 131363
2011-05-14 19:30:39 +00:00
Francois Pichet c2fac71c75 Revert 131347. It asserts if the specialization in within a class template:
template<class U> 
struct X1 {
  template<class T> void f(T*);
  template<> void f(int*) { } 
};

Won't be so simple. I need to think more about it.

llvm-svn: 131362
2011-05-14 19:17:07 +00:00
Tobias Grosser f6ed8ffd69 www: Colorize TODO status
llvm-svn: 131361
2011-05-14 19:02:51 +00:00
Tobias Grosser 5d6eb86965 CodeGeneration: Cleanup getAnalysis/addPreserved
llvm-svn: 131360
2011-05-14 19:02:45 +00:00
Tobias Grosser 3fdecaee2a CodeGeneration: Localize variables
llvm-svn: 131359
2011-05-14 19:02:39 +00:00
Tobias Grosser abb6dcd865 CodeGeneration: Admit that we change the code.
No need to pretend anymore that we do not update the LLVM-IR.

llvm-svn: 131358
2011-05-14 19:02:34 +00:00
Tobias Grosser 2aec339d28 Cloog: Export clast_root
llvm-svn: 131357
2011-05-14 19:02:29 +00:00
Tobias Grosser e91c53d2a9 CodeGeneration: No need to forget SCoP.
As we do not delete the SCoP, there is no need to remove it from the SCoP
detection.

llvm-svn: 131356
2011-05-14 19:02:21 +00:00
Tobias Grosser 678dbbf3b0 CodeGeneration: We do not preserve the PostDominatorTree
llvm-svn: 131355
2011-05-14 19:02:12 +00:00
Tobias Grosser 30aa24cd6b ScheduleOptimizer: Add an isl based schedule optimizer
The isl based routines implement a new interpretation of the Pluto algorithm
new interpretation. This patch requires a recent version of isl to be installed.

llvm-svn: 131354
2011-05-14 19:02:06 +00:00