Commit Graph

100210 Commits

Author SHA1 Message Date
Kevin Enderby 96f6e379e2 Changed the TableGen created MatchInstructionImpl() setting of ErrorInfo.
The algorithm for identifying which operand is invalid will now always point to
some operand and not the mnemonic sometimes.  The change is now that ErrorInfo
is the index of the highest operand that does not match for any of the matching
mnemonics records.  And no longer the ~0U value when the mnemonic matches and
not every record with a matching mnemonic has the same mismatching operand
index.

llvm-svn: 124734
2011-02-02 18:20:55 +00:00
Caroline Tice 2bf67986ef Fix breakpoint id test to work with clang as well as gcc; added a few
more test cases

Fixed minor bug in the breakpoint id range translation code.

llvm-svn: 124729
2011-02-02 17:48:16 +00:00
Howard Hinnant da3b02fdb3 Missing traits::to_int_type in fstream
llvm-svn: 124727
2011-02-02 17:37:16 +00:00
Howard Hinnant 72c5e14203 Qualify calls to addressof with std::. Bug 9106
llvm-svn: 124726
2011-02-02 17:36:20 +00:00
Bob Wilson 09a6b46c89 Update comment to match my recent change.
llvm-svn: 124725
2011-02-02 17:29:40 +00:00
Benjamin Kramer f4ea1d5f79 SimplifyCFG: Turn switches into sub+icmp+branch if possible.
This makes the job of the later optzn passes easier, allowing the vast amount of
icmp transforms to chew on it.

We transform 840 switches in gcc.c, leading to a 16k byte shrink of the resulting
binary on i386-linux.

The testcase from README.txt now compiles into
  decl  %edi
  cmpl  $3, %edi
  sbbl  %eax, %eax
  andl  $1, %eax
  ret

llvm-svn: 124724
2011-02-02 15:56:22 +00:00
Daniel Dunbar 27734fdbbf Frontend: Factor out header include dumping (-H) into its own preprocessor
callbacks class.
 - Aside from being generally cleaner, this also allows -H to work correctly in
   modes other than standard preprocessing (e.g., -c, -MM, etc.)

llvm-svn: 124723
2011-02-02 15:41:17 +00:00
Richard Osborne 8607a67d37 Add support for trampolines on the XCore.
llvm-svn: 124722
2011-02-02 14:57:41 +00:00
John McCall c63de66c4f An insomniac stab at making block declarations list the variables they close
on, as well as more reliably limiting invalid references to locals from
nested scopes.

llvm-svn: 124721
2011-02-02 13:00:07 +00:00
Duncan Sands fdfdbd091d Remove NoVendor and NoOS, added in commit 123990, from Triple. While it
may be useful to understand "none", this is not the place for it.  Tweak
the fix to Normalize while there: the fix added in 123990 works correctly,
but I like this way better.  Finally, now that Triple understands some
non-trivial environment values, teach the unittests about them.

llvm-svn: 124720
2011-02-02 10:08:38 +00:00
Nick Lewycky fe719128e9 Fix test by fully specifying the platform.
llvm-svn: 124719
2011-02-02 07:17:02 +00:00
Nick Lewycky 75033770f4 Turn on -momit-leaf-frame-pointer by default on all non-Darwin platforms.
Fixes PR9121!

llvm-svn: 124718
2011-02-02 06:43:03 +00:00
Nick Lewycky a46c898314 Remove wasteful caching. This isn't needed for correctness because any function
that might have changed been affected by a merge elsewhere will have been
removed from the function set, and it isn't needed for performance because we
call grow() ahead of time to prevent reallocations.

llvm-svn: 124717
2011-02-02 05:31:01 +00:00
Greg Clayton 4272cc7d4c Modified the PluginManager to be ready for loading plug-ins from a system
LLDB plugin directory and a user LLDB plugin directory. We currently still
need to work out at what layer the plug-ins will be, but at least we are 
prepared for plug-ins. Plug-ins will attempt to be loaded from the 
"/Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Plugins" 
folder, and from the "~/Library/Application Support/LLDB/Plugins" folder on
MacOSX. Each plugin will be scanned for:

extern "C" bool LLDBPluginInitialize(void);
extern "C" void LLDBPluginTerminate(void);

If at least LLDBPluginInitialize is found, the plug-in will be loaded. The
LLDBPluginInitialize function returns a bool that indicates if the plug-in
should stay loaded or not (plug-ins might check the current OS, current
hardware, or anything else and determine they don't want to run on the current
host). The plug-in is uniqued by path and added to a static loaded plug-in
map. The plug-in scanning happens during "lldb_private::Initialize()" which
calls to the PluginManager::Initialize() function. Likewise with termination
lldb_private::Terminate() calls PluginManager::Terminate(). The paths for the
plug-in directories is fetched through new Host calls:

    bool Host::GetLLDBPath (ePathTypeLLDBSystemPlugins, dir_spec);
    bool Host::GetLLDBPath (ePathTypeLLDBUserPlugins, dir_spec);

This way linux and other systems can define their own appropriate locations
for plug-ins to be loaded.

To allow dynamic shared library loading, the Host layer has also been modified
to include shared library open, close and get symbol:

    static void *
    Host::DynamicLibraryOpen (const FileSpec &file_spec, 
                              Error &error);

    static Error
    Host::DynamicLibraryClose (void *dynamic_library_handle);

    static void *
    Host::DynamicLibraryGetSymbol (void *dynamic_library_handle, 
                                  const char *symbol_name, 
                                  Error &error);

lldb_private::FileSpec also has been modified to support directory enumeration
in an attempt to abstract the directory enumeration into one spot in the code.
The directory enumertion function is static and takes a callback:


    typedef enum EnumerateDirectoryResult
    {
        eEnumerateDirectoryResultNext,  // Enumerate next entry in the current directory
        eEnumerateDirectoryResultEnter, // Recurse into the current entry if it is a directory or symlink, or next if not
        eEnumerateDirectoryResultExit,  // Exit from the current directory at the current level.
        eEnumerateDirectoryResultQuit   // Stop directory enumerations at any level
    };

    typedef FileSpec::EnumerateDirectoryResult (*EnumerateDirectoryCallbackType) (void *baton,
                                                                                  FileSpec::FileType file_type,
                                                                                  const FileSpec &spec);

    static FileSpec::EnumerateDirectoryResult
    FileSpec::EnumerateDirectory (const char *dir_path,
                                  bool find_directories,
                                  bool find_files,
                                  bool find_other,
                                  EnumerateDirectoryCallbackType callback,
                                  void *callback_baton);

This allow clients to specify the directory to search, and specifies if only
files, directories or other (pipe, symlink, fifo, etc) files will cause the
callback to be called. The callback also gets to return with the action that
should be performed after this directory entry. eEnumerateDirectoryResultNext
specifies to continue enumerating through a directory with the next entry.
eEnumerateDirectoryResultEnter specifies to recurse down into a directory
entry, or if the file is not a directory or symlink/alias to a directory, then
just iterate to the next entry. eEnumerateDirectoryResultExit specifies to 
exit the current directory and skip any entries that might be remaining, yet
continue enumerating to the next entry in the parent directory. And finally
eEnumerateDirectoryResultQuit means to abort all directory enumerations at 
all levels.

Modified the Declaration class to not include column information currently
since we don't have any compilers that currently support column based 
declaration information. Columns support can be re-enabled with the
additions of a #define.

Added the ability to find an EmulateInstruction plug-in given a target triple
and optional plug-in name in the plug-in manager.

Fixed a few cases where opendir/readdir was being used, but yet not closedir
was being used. Soon these will be deprecated in favor of the new directory
enumeration call that was added to the FileSpec class.

llvm-svn: 124716
2011-02-02 02:24:04 +00:00
Dan Gohman b93f581948 Update this test following recent optimizer changes.
llvm-svn: 124715
2011-02-02 02:21:10 +00:00
Ted Kremenek ae022096db Remove redundant check to not warn for warn_equality_with_extra_parens if we are in a macro. This is checked twice.
llvm-svn: 124714
2011-02-02 02:20:30 +00:00
Dan Gohman c6f0bda839 Conservatively, clear optional flags, such as nsw, when performing
reassociation. No testcase, because I wasn't able to create a testcase
which actually demonstrates a problem.

llvm-svn: 124713
2011-02-02 02:05:46 +00:00
Dan Gohman 08d2c98c23 Fix reassociate to clear optional flags, such as nsw.
llvm-svn: 124712
2011-02-02 02:02:34 +00:00
Caroline Tice 31f7d460fa Make sure the confirmation input reader calls fflush after writing its output.
(<rdar://problem/8946573>)

llvm-svn: 124711
2011-02-02 01:17:56 +00:00
Johnny Chen d07a57f222 Add EmulateBLXImmediate() and EmulateBLXRm() to the g_arm_opcodes and g_thumb_opcodes tables,
which represent "bl <label>", "blx <label>", and "blx <Rm>" instructions.

llvm-svn: 124710
2011-02-02 01:13:56 +00:00
Sean Callanan 26fc7858db Fixed a bug in the disassembler where the mandatory 0x66
prefix would be misinterpreted in some cases on 32-bit
x86 platforms.  Thanks to Olivier Meurant for identifying
the bug.

llvm-svn: 124709
2011-02-02 01:09:02 +00:00
Evan Cheng d42641c6b5 Given a pair of floating point load and store, if there are no other uses of
the load, then it may be legal to transform the load and store to integer
load and store of the same width.

This is done if the target specified the transformation as profitable. e.g.
On arm, this can transform:
vldr.32 s0, []
vstr.32 s0, []

to

ldr r12, []
str r12, []

rdar://8944252

llvm-svn: 124708
2011-02-02 01:06:55 +00:00
Johnny Chen ab62873b63 Fix test function breakpoint_command_script_parameters()'s expect-pattern so that
it passes when using clang as the compiler to build the inferior.

llvm-svn: 124707
2011-02-02 00:56:40 +00:00
Greg Clayton 03dbf2e2a5 Added missing return statement (patch from Kirk Beitz).
llvm-svn: 124706
2011-02-02 00:52:14 +00:00
Bob Wilson e68f70fadd Fix comment typo.
llvm-svn: 124705
2011-02-02 00:46:09 +00:00
Douglas Gregor 801acff462 Unique code-completion strings. On Cocoa.h, this costs us about 4% in
speed but saves us about 25% of the memory usage for strings.

llvm-svn: 124704
2011-02-01 23:59:42 +00:00
Sean Callanan 0917d6e5d5 Added a new class, ASTDumper, that provides verbose
diagnostics of Clang AST classes for the purpose of
debugging the types LLDB produces for DWARF objects.

The ASTDumper is currently only used in log output
if you enable verbose mode in the expression log:

log enable -v lldb expr

Its output then appears in the log for external
variables used by the expr command.

llvm-svn: 124703
2011-02-01 23:43:26 +00:00
John McCall 71de91cc09 When diagnosing address-space changes, apply array-to-pointer decay first.
llvm-svn: 124702
2011-02-01 23:28:01 +00:00
Fariborz Jahanian 265c325ef3 -fapple-kext support for indirect call to virtuals dtors - wip.
llvm-svn: 124701
2011-02-01 23:22:34 +00:00
Douglas Gregor 6c7cb188e9 Fix name lookup issue
llvm-svn: 124700
2011-02-01 23:14:23 +00:00
Nick Lewycky 22197c1334 Add support for x86-64 Mandriva 2010.2. Reported by 'rindolf' on IRC!
llvm-svn: 124699
2011-02-01 23:03:29 +00:00
Douglas Gregor bcbf46c7b7 Create a special allocator class for code completion, so that all of
the string copying goes through a single place that can have
associated state.

llvm-svn: 124698
2011-02-01 22:57:45 +00:00
Matt Beaumont-Gay 06cebfd9a5 Use tempfiles for the .o outputs.
llvm-svn: 124697
2011-02-01 22:44:06 +00:00
Ted Kremenek 1dd5646da0 Enable the self-init checker in scan-build.
llvm-svn: 124696
2011-02-01 22:36:11 +00:00
Ted Kremenek c358d9f305 Don't warn about extraneous '()' around a comparison if it occurs within a macro.
Macros frequently contain extra '()' to make instantiation less error prone.
This warning was flagging a ton of times on postgresql because of its use of macros.

llvm-svn: 124695
2011-02-01 22:36:09 +00:00
Bob Wilson 59513209aa PR9081: Split up LDM instruction with deprecated use of both LR and PC.
This is completely untested but pretty straightforward, so hopefully I
got it right.

llvm-svn: 124694
2011-02-01 22:30:51 +00:00
Argyrios Kyrtzidis f4f8278c95 Don't warn for "if ((a == b))" if the parens came from a macro. Thanks to Fariborz for the hint!
llvm-svn: 124689
2011-02-01 22:23:56 +00:00
Matt Beaumont-Gay 29c8c8fe92 Take Bill Wendling's suggestion for structuring a couple of asserts.
llvm-svn: 124688
2011-02-01 22:12:50 +00:00
Devang Patel 195e69536f Update to match changes in lldb interface.
llvm-svn: 124687
2011-02-01 21:47:35 +00:00
John McCall 2725aa13ea Do the right thing for zero-initializing VLAs that don't have a zero
bit-pattern.  It's not clear that this is actually useful given current
language restrictions.

llvm-svn: 124685
2011-02-01 21:35:06 +00:00
Nick Lewycky edda72658a Add updated Debian ARM include path.
llvm-svn: 124684
2011-02-01 21:32:14 +00:00
Douglas Gregor 304f9b0803 Provide constant strings for certain common code completion strings,
eliminating the need to copy those strings.

llvm-svn: 124683
2011-02-01 21:15:40 +00:00
Ted Kremenek e57d88c6a3 Add test case for dead stores checker to not flag dead assignments to 'self' within a nested assignment.
llvm-svn: 124681
2011-02-01 20:45:26 +00:00
Argyrios Kyrtzidis c1b4534e42 Fix the message. Thanks to Thomas Clement for noticing.
llvm-svn: 124680
2011-02-01 20:33:05 +00:00
Anton Korobeynikov 1f3bc9b5e6 Fix imm printing for logical instructions.
Patch by Brian G. Lucas!

llvm-svn: 124679
2011-02-01 20:22:53 +00:00
Anton Korobeynikov 3e956af404 Document the LLVM GIT mirror
llvm-svn: 124677
2011-02-01 20:08:28 +00:00
Argyrios Kyrtzidis 582dd68541 For "if ((a == b))" only warn if 'a' is a modifiable l-value. Caught by John!
llvm-svn: 124675
2011-02-01 19:32:59 +00:00
Argyrios Kyrtzidis 15a3daa189 [analyzer] Slightly improve the diagnostic message of ObjCSelfInitChecker.
llvm-svn: 124674
2011-02-01 19:32:55 +00:00
Douglas Gregor b278aafbfb Allocate CodeCompletionString and all of its components in a
BumpPtrAllocator, rather than manually new/delete'ing them. This
optimization also allows us to avoid allocating memory for and copying
constant strings (e.g., "return", "class").

This also required embedding the priority and availability of results
within the code completion string, to avoid extra memory allocation
within libclang.

llvm-svn: 124673
2011-02-01 19:23:04 +00:00
David Greene 433c6180ab [AVX] Implement EnforceSmallerThan for mixed int/fp type lists. This
makes type checking for extract_subvector and insert_subvector more
robust and will allow stricter typechecking of more patterns in the
future.

This change handles int and fp as disjoint sets so that it will
enforce integer types to be smaller than the largest integer type and
fp types to be smaller than the largest fp type.  There is no attempt
to check type sizes across the int/fp sets.

llvm-svn: 124672
2011-02-01 19:12:32 +00:00