Commit Graph

148880 Commits

Author SHA1 Message Date
Adrian Prantl 3be10542af Ensure that the line table for functions with cleanups is sequential.
If there is cleanup code, the cleanup code gets the debug location of
the closing '}'. The subsequent ret IR-instruction does not get a
debug location. The return _expression_ will get the debug location
of the return statement.

If the function contains only a single, simple return statement,
the cleanup code may become the first breakpoint in the function.
In this case we set the debug location for the cleanup code
to the location of the return statement.

rdar://problem/13442648

llvm-svn: 180932
2013-05-02 17:30:20 +00:00
Adrian Prantl f1b28a5dbc Use a more idiomatic way to disable debug locations.
llvm-svn: 180931
2013-05-02 17:30:16 +00:00
Enrico Granata e55f77aec8 <rdar://problem/13499317>
Enabling Python commands to produce Unicode output via:

result.PutCString(u”whatever”)

llvm-svn: 180930
2013-05-02 17:29:04 +00:00
Adrian Prantl 9ee5840de4 Provide an API to temporarily suppress DebugLocations from being attached
to emitted instructions.  Use this if you want an instruction to be
counted towards the prologue or if there is no useful source location.

rdar://problem/13442648

llvm-svn: 180929
2013-05-02 17:27:49 +00:00
Greg Clayton 05e2c79f87 We aren't ready for the assertions to be enabled on the ReadWriteLock classes yet.
llvm-svn: 180928
2013-05-02 17:17:05 +00:00
Greg Clayton 4fea4f27e3 Clear the register context if our process is no longer alive.
llvm-svn: 180927
2013-05-02 17:16:00 +00:00
Jim Ingham c56781fffa This is a useful scheme for running a particular testsuite case under Xcode. Just edit the
run arguments to include the directory of the test you want to run, and run the scheme.

llvm-svn: 180926
2013-05-02 17:04:10 +00:00
Douglas Gregor 709499b250 Use a triple ensure that __has_feature(c_thread_local) is 1 in C11 mode.
llvm-svn: 180925
2013-05-02 16:22:34 +00:00
Fariborz Jahanian 6384fbb28f [document parsing]: support c++11 type aliases
with no comment of their own to inherit the
comment of their aliased type. // rdar://13752382

llvm-svn: 180924
2013-05-02 15:44:16 +00:00
Jyotsna Verma 1d29750b7d Hexagon: Honor __builtin_expect by using branch probabilities.
* lib/Target/Hexagon/HexagonInstrInfo.cpp (GetDotNewPredOp):
  Given a jump opcode return the right pred.new jump opcode with
  a taken vs not-taken hint based on branch probabilities provided
  by the target independent module.
  * lib/Target/Hexagon/HexagonVLIWPacketizer.cpp: Use the above function.
  * lib/Target/Hexagon/HexagonNewValueJump.cpp(getNewvalueJumpOpcode):
  Enhance existing function use branch probabilities like
  HexagonInstrInfo::GetDotNewPredOp but for New Value (GPR) Jumps.

llvm-svn: 180923
2013-05-02 15:39:30 +00:00
Tom Stellard 40b7f1f6c3 R600: Use new tablegen syntax for patterns
All but two patterns have been converted to the new syntax.  The
remaining two patterns will require COPY_TO_REGCLASS instructions, which
the VLIW DAG Scheduler cannot handle.

llvm-svn: 180922
2013-05-02 15:30:12 +00:00
Tom Stellard 5447ae20ff R600/SI: remove nonsense select pattern
Fortunately this pattern never matched, otherwise
we would have generated incorrect code.

Signed-off-by: Christian K??nig <christian.koenig@amd.com>
llvm-svn: 180921
2013-05-02 15:30:07 +00:00
Daniel Malea 5eff59e74c Update CMakeLists with RegisterContext* files added
llvm-svn: 180920
2013-05-02 15:23:53 +00:00
Tobias Grosser fe9b161fdd Added table of contents declaration in CommandLine Library documentation.
Contributed-by:  Dan Liew <daniel.liew@imperial.ac.uk>
llvm-svn: 180919
2013-05-02 14:59:52 +00:00
Hans Wennborg 4c02be3b83 Make sure we define wchar_t related macros correctly in -fms-extensions mode.
This adds a test to make sure we define _WCHAR_T_DEFINED and
_NATIVE_WCHAR_T_DEFINED correctly in the preprocessor, and updates
stddef.h to set it when typedeffing wchar_t.

llvm-svn: 180918
2013-05-02 13:12:32 +00:00
Hans Wennborg b2175b25a7 Fix typo in a stddef.h comment: s/risze_t/rsize_t/
llvm-svn: 180916
2013-05-02 10:36:31 +00:00
Michael Liao 06badde1ac 80-col fixup.
llvm-svn: 180915
2013-05-02 09:22:04 +00:00
Michael Liao afafa98fa8 Avoid duplicating logic on frame register selecting when lowering eh_return
No functionality change

llvm-svn: 180914
2013-05-02 09:18:38 +00:00
Michael Liao 31d39a4a47 Avoid duplicating logic on frame register selecting when lowering frameaddr
No functionality change

llvm-svn: 180912
2013-05-02 08:21:56 +00:00
Michael Liao 126680ffa1 Rewrite X86 codegen regression test with FileCheck
llvm-svn: 180910
2013-05-02 06:20:42 +00:00
Douglas Gregor a7130bfed6 Only evaluate __has_feature(c_thread_local) and __has_feature(cxx_thread_local) true when the target supports thread-local storage.
llvm-svn: 180909
2013-05-02 05:28:32 +00:00
Greg Clayton bca31a3d64 Correctly create the register contexts in RegisterContextThreadMemory.
llvm-svn: 180908
2013-05-02 04:15:24 +00:00
David Majnemer a18dfe6b96 Add a test for the foldSelectICmpAndOr fix committed in r180779.
This tests a case where C1 and C2 were the same but X and Y were different
widths.

llvm-svn: 180907
2013-05-02 02:44:23 +00:00
Evan Cheng f85a76f477 TiedTo flag can now be placed on implicit operands. isTwoAddrUse() should look
at all of the operands. Previously it was skipping over implicit operands which
cause infinite looping when the two-address pass try to reschedule a
two-address instruction below the kill of tied operand.

I'm unable to come up with a reasonably sized test case.
rdar://13747577

llvm-svn: 180906
2013-05-02 02:07:32 +00:00
Anton Yartsev 604518ccd4 [analyzer] Finally make c++-analyzer 'executable' again.
llvm-svn: 180905
2013-05-02 01:57:58 +00:00
Jordan Rose b147918252 [analyzer] RetainCountChecker: don't track through xpc_connection_set_context.
It is unfortunate that we have to mark these exceptions in multiple places.
This was already in CallEvent. I suppose it does let us be more precise
about saying /which/ arguments have their retain counts invalidated -- the
connection's is still valid even though the context object's isn't -- but
we're not tracking the retain count of XPC objects anyway.

<rdar://problem/13783514>

llvm-svn: 180904
2013-05-02 01:51:40 +00:00
Anton Yartsev 10f9d08c70 [analyzer] Recreated as a file.
llvm-svn: 180903
2013-05-02 01:41:51 +00:00
Anton Yartsev 2320d295af [analyzer] Temporary remove c++analyzer to recreate it as a separate file, not a symlink.
llvm-svn: 180902
2013-05-02 01:36:41 +00:00
Anton Yartsev 19993e8441 [analyzer] Added 'executable' property to c++analyzer.
llvm-svn: 180901
2013-05-02 01:18:17 +00:00
Anton Yartsev caaaf2ee28 [analyzer] scan-build for Windows
The patch allows Windows users to launch scan-build without any additional preparations in the same way as it described in http://clang-analyzer.llvm.org/scan-build.html. The only thing that should be done to make scan-build work from an arbitrary location is to add scan-build folder to the PATH environment variable.

llvm-svn: 180900
2013-05-02 00:52:46 +00:00
Sean Callanan 3fa3e65d3b Since the IR interpreter does not (currently)
support operands with vector types, it now reports
that it cannot interpret expressions that use
vector types.  They get sent to the JIT instead.

<rdar://problem/13733651>

llvm-svn: 180899
2013-05-02 00:33:44 +00:00
Jim Ingham acff895015 Recommitting r180831 with trivial fix - remember to return errors if you compute.
llvm-svn: 180898
2013-05-02 00:27:30 +00:00
Akira Hatanaka ae4a5567e1 [mips] Rename class and functions. Simplify code.
No functionality changes.

llvm-svn: 180897
2013-05-01 23:41:31 +00:00
Greg Clayton 7060f8976c Return zero when we don't support the byte size. Previously is we were asked to read 3, 5, 6, or 7 byte integers, we would set the error, but still return that we read that number of bytes without populating the scalar.
llvm-svn: 180896
2013-05-01 23:41:30 +00:00
Sean Callanan 16f45ca6ba Make our eliding of artificially-generated methods
in debug information more aggressive.  Emitting
classes containing these methods causes crashes in
Clang when dealing with complex code bases.

<rdar://problem/12640887>

llvm-svn: 180895
2013-05-01 23:18:34 +00:00
Jordan Rose 89bbd1fb64 [analyzer] Consolidate constant evaluation logic in SValBuilder.
Previously, this was scattered across Environment (literal expressions),
ExprEngine (default arguments), and RegionStore (global constants). The
former special-cased several kinds of simple constant expressions, while
the latter two deferred to the AST's constant evaluator.

Now, these are all unified as SValBuilder::getConstantVal(). To keep
Environment fast, the special cases for simple constant expressions have
been left in, but the main benefits are that (a) unusual constants like
ObjCStringLiterals now work as default arguments and global constant
initializers, and (b) we're not duplicating code between ExprEngine and
RegionStore.

This actually caught a bug in our test suite, which is awesome: we stop
tracking allocated memory if it's passed as an argument along with some
kind of callback, but not if the callback is 0. We were testing this in
a case where the callback parameter had a default value, but that value
was 0. After this change, the analyzer now (correctly) flags that as a
leak!

<rdar://problem/13773117>

llvm-svn: 180894
2013-05-01 23:10:44 +00:00
Filip Pizlo 85e0d2731b This exposes more MCJIT options via the C API:
CodeModel: It's now possible to create an MCJIT instance with any CodeModel you like.  Previously it was only possible to 
create an MCJIT that used CodeModel::JITDefault.

EnableFastISel: It's now possible to turn on the fast instruction selector.

The CodeModel option required some trickery.  The problem is that previously, we were ensuring future binary compatibility in 
the MCJITCompilerOptions by mandating that the user bzero's the options struct and passes the sizeof() that he saw; the 
bindings then bzero the remaining bits.  This works great but assumes that the bitwise zero equivalent of any field is a 
sensible default value.

But this is not the case for LLVMCodeModel, or its internal equivalent, llvm::CodeModel::Model.  In both of those, the default 
for a JIT is CodeModel::JITDefault (or LLVMCodeModelJITDefault), which is not bitwise zero.

Hence this change introduces LLVMInitializeMCJITCompilerOptions(), which will initialize the user's options struct with
defaults. The user will use this in the same way that they would have previously used memset() or bzero(). MCJITCAPITest.cpp
illustrates the change, as does the comment in ExecutionEngine.h.

llvm-svn: 180893
2013-05-01 22:58:00 +00:00
Michael Liao d2d42f1b2d Avoid generating tempfile(s) never used
As DejaGNU is deprecated, it seems pipe-jam issue doesn't exist any more.

llvm-svn: 180892
2013-05-01 22:46:50 +00:00
Filip Pizlo c65a6d7630 Rename 'struct LLVMTargetMachine' to 'struct LLVMOpaqueTargetMachine'.
This avoids namespace collisions with llvm::LLVMTargetMachine.

llvm-svn: 180891
2013-05-01 22:41:26 +00:00
Jordan Rose 7023a90378 [analyzer] Don't inline the [cd]tors of C++ iterators.
This goes with r178516, which instructed the analyzer not to inline the
constructors and destructors of C++ container classes. This goes a step
further and does the same thing for iterators, so that the analyzer won't
falsely decide we're trying to construct an iterator pointing to a
nonexistent element.

The heuristic for determining whether something is an iterator is the
presence of an 'iterator_category' member. This is controlled under the
same -analyzer-config option as container constructor/destructor inlining:
'c++-container-inlining'.

<rdar://problem/13770187>

llvm-svn: 180890
2013-05-01 22:39:31 +00:00
Bill Wendling 8f2e6feb8e Revert r180737. The companion patch was reverted, and this is not relevant right now.
llvm-svn: 180889
2013-05-01 22:32:08 +00:00
Sean Callanan 7f13bd7678 Fixed Process::ReadScalarIntegerFromMemory()
to report proper errors when the size is not
correct.

<rdar://problem/13784456>

llvm-svn: 180888
2013-05-01 22:01:40 +00:00
Greg Clayton 160c9d81e0 <rdar://problem/13700260>
<rdar://problem/13723772>

Modified the lldb_private::Thread to work much better with the OperatingSystem plug-ins. Operating system plug-ins can now return have a "core" key/value pair in each thread dictionary for the OperatingSystemPython plug-ins which allows the core threads to be contained with memory threads. It also allows these memory threads to be stepped, resumed, and controlled just as if they were the actual backing threads themselves.

A few things are introduced:
- lldb_private::Thread now has a GetProtocolID() method which returns the thread protocol ID for a given thread. The protocol ID (Thread::GetProtocolID()) is usually the same as the thread id (Thread::GetID()), but it can differ when a memory thread has its own id, but is backed by an actual API thread.
- Cleaned up the Thread::WillResume() code to do the mandatory parts in Thread::ShouldResume(), and let the thread subclasses override the Thread::WillResume() which is now just a notification.
- Cleaned up ClearStackFrames() implementations so that fewer thread subclasses needed to override them
- Changed the POSIXThread class a bit since it overrode Thread::WillResume(). It is doing the wrong thing by calling "Thread::SetResumeState()" on its own, this shouldn't be done by thread subclasses, but the current code might rely on it so I left it in with a TODO comment with an explanation.

llvm-svn: 180886
2013-05-01 21:54:04 +00:00
Jyotsna Verma 5ed5181178 Hexagon: Use multiclass for Jump instructions.
llvm-svn: 180885
2013-05-01 21:37:34 +00:00
Jyotsna Verma cd66c0a270 Hexagon: Clear isKill flag on the predicate register in
PredicateInstruction function.

llvm-svn: 180884
2013-05-01 21:27:30 +00:00
Rafael Espindola 5096adfb12 Add support for other typeinfo encodings in the ExceptionDemo.
The old jit always uses DW_EH_PE_absptr, but MCJIT can use other encodings.
This is in preparation for adding EH support to MCJIT, but not directly
related, so I am committing it first.

llvm-svn: 180883
2013-05-01 21:05:05 +00:00
Filip Pizlo 0d5b4aba65 Fix file header comment.
llvm-svn: 180882
2013-05-01 21:01:06 +00:00
Filip Pizlo dec20e43c0 This patch breaks up Wrap.h so that it does not have to include all of
the things, and renames it to CBindingWrapping.h.  I also moved 
CBindingWrapping.h into Support/.

This new file just contains the macros for defining different wrap/unwrap 
methods.

The calls to those macros, as well as any custom wrap/unwrap definitions 
(like for array of Values for example), are put into corresponding C++ 
headers.

Doing this required some #include surgery, since some .cpp files relied 
on the fact that including Wrap.h implicitly caused the inclusion of a 
bunch of other things.

This also now means that the C++ headers will include their corresponding 
C API headers; for example Value.h must include llvm-c/Core.h.  I think 
this is harmless, since the C API headers contain just external function 
declarations and some C types, so I don't believe there should be any 
nasty dependency issues here.

llvm-svn: 180881
2013-05-01 20:59:00 +00:00
Fariborz Jahanian b5f34681a6 [documenting declaration]: Remove arc liftime qualifiers
when doccumenting declrations in comments.
// rdar://13757500

llvm-svn: 180880
2013-05-01 20:53:21 +00:00
Ashok Thirumurthi 0f3b9b819a Build fixes for FreeBSD 9.1.
- TODO: Support extended register sets on FreeBSD.

Patch by Samuel Jacob.

llvm-svn: 180879
2013-05-01 20:38:19 +00:00