Commit Graph

111341 Commits

Author SHA1 Message Date
Ted Kremenek 369b3fa752 Rename -Wstrl-incorrect-size to -Wstrlcpy-strlcat-size. This warning really is just specific to strlcpy and strlcat.
llvm-svn: 138038
2011-08-19 14:35:32 +00:00
Kalle Raiskila 024d2614b6 Have SPU backend use the external TCE scheduler, if the library is loaded as a
module.

Patch by Pekka Jääskeläinen.

llvm-svn: 138037
2011-08-19 10:50:24 +00:00
Sean Callanan a87bee84cf Refined the rollback to LLVM, picking up a newer
revision and adding a patch that fixes an AsmParser
crash on ARM.

One feature that we unfortunately lost (for the
moment!) is the ability to cast unknown code symbols
to arbitrary function types and put the resulting
function pointer in a result variable.  This feature
will be back, though.

llvm-svn: 138036
2011-08-19 06:19:25 +00:00
Craig Topper ba6c2a52c7 Add TB encoding to VEX versions of SSE fp logical operations to fix disassembler
llvm-svn: 138034
2011-08-19 05:28:50 +00:00
Jakob Stoklund Olesen 90b6018c8f Add test case for r138018.
llvm-svn: 138033
2011-08-19 04:30:24 +00:00
Benjamin Kramer 56b675f8a1 Reflow code. No functionality change.
llvm-svn: 138032
2011-08-19 04:18:11 +00:00
Craig Topper 6eb2058a6a Warn about and truncate UCNs that are too big for their character literal type.
llvm-svn: 138031
2011-08-19 03:20:12 +00:00
Douglas Gregor 4dd3e948ef Teach ModuleManager::addModule() to check whether a particular module
has already been loaded before allocating a new Module structure. If
the module has already been loaded (uniquing based on file name), then
just return the existing module rather than trying to load it again.

This allows us to load a DAG of modules. Introduce a simple test case
that forms a diamond-shaped module graph, and illustrates that a
source file importing the bottom of the diamond can see declarations
in all four of the modules that make up the diamond.

Note that this version moves the file-opening logic into the module
manager, rather than splitting it between the module manager and the
AST reader. More importantly, it properly handles the
weird-but-possibly-useful case of loading an AST file from "-".

llvm-svn: 138030
2011-08-19 02:29:29 +00:00
Bruno Cardoso Lopes 22241acc29 Fix PR10677. Initial patch and idea by Peter Cooper but I've changed the
implementation!

llvm-svn: 138029
2011-08-19 02:23:56 +00:00
Jakob Stoklund Olesen 6949077f74 Add llc flags to disable machine DCE and CSE.
This is useful for unit tests.

llvm-svn: 138028
2011-08-19 02:05:35 +00:00
Anna Zaks be28d6c66d Fix a memory leak in the analyzer - BugReports didn't get freed. Plus, remove invalid assert from the destructor which wasn't called previously due to the leak.
llvm-svn: 138027
2011-08-19 01:57:09 +00:00
Enrico Granata da616d06e9 More thorough fix for the spaces-in-typename issue
llvm-svn: 138026
2011-08-19 01:47:11 +00:00
Benjamin Kramer 4938edb02c Make a bunch of symbols private.
llvm-svn: 138025
2011-08-19 01:42:18 +00:00
Chandler Carruth e92e42f3fd Fix the rest of the indent goofiness here.
llvm-svn: 138024
2011-08-19 01:40:11 +00:00
Chandler Carruth f8b554f0f2 Fix an egregious formatting goof.
llvm-svn: 138023
2011-08-19 01:38:33 +00:00
Benjamin Kramer 5a656883b1 C API functions must be able to see their extern "C" definitions, or it will be impossible to call them from C.
llvm-svn: 138022
2011-08-19 01:36:54 +00:00
Johnny Chen b5825b82ad Minor change for the @expectedFailureClang logic. For the non-clang test failure, re-raise
the exception to get more stack trace information.

llvm-svn: 138021
2011-08-19 01:17:09 +00:00
Enrico Granata 02b6676d2b Third round of code cleanups:
- reorganizing the PTS (Partial Template Specializations) in FormatManager.h
 - applied a patch by Filipe Cabecinhas to make LLDB compile with GCC
Functional changes:
 - fixed an issue where command type summary add for type "struct Foo" would not match any types.
   currently, "struct" will be stripped off and type "Foo" will be matched.
   similar behavior occurs for class, enum and union specifiers.

llvm-svn: 138020
2011-08-19 01:14:49 +00:00
Johnny Chen 31963cea0a Add a decorator for marking clang only expectedFailure. Use it for the test_step_over_3_times_with_dsym/dwarf()
test cases in TestThreadAPI.py by decorating it with @expectedFailureClang.

Example:

    @expectedFailureClang
    @python_api_test
    def test_step_over_3_times_with_dwarf(self):
        """Test Python SBThread.StepOver() API."""
        # We build a different executable than the default buildDwarf() does.
        d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name}
        self.buildDwarf(dictionary=d)
        self.setTearDownCleanup(dictionary=d)
        self.step_over_3_times(self.exe_name)

llvm-svn: 138019
2011-08-19 00:54:27 +00:00
Jakob Stoklund Olesen 9eb77bf615 Don't treat a partial <def,undef> operand as a read.
Normally, a partial register def is treated as reading the
super-register unless it also defines the full register like this:

  %vreg110:sub_32bit<def> = COPY %vreg77:sub_32bit, %vreg110<imp-def>

This patch also uses the <undef> flag on partial defs to recognize
non-reading operands:

  %vreg110:sub_32bit<def,undef> = COPY %vreg77:sub_32bit

This fixes a subtle bug in RegisterCoalescer where LIS->shrinkToUses
would treat a coalesced copy as still reading the register, extending
the live range artificially.

My test case only works when I disable DCE so a dead copy is left for
RegisterCoalescer, so I am not including it.

<rdar://problem/9967101>

llvm-svn: 138018
2011-08-19 00:30:17 +00:00
Eric Christopher 84fbdb4a8f Add a completely hacky workaround for pch kext files with different extensions
when falling back to cc1plus for our compile.

rdar://9963920

llvm-svn: 138017
2011-08-19 00:30:14 +00:00
Dan Gohman b38940135b Track a retain+release nesting level independently of the
known-incremented level, because the two concepts can be used
to prove the saftey of a retain+release removal in different
ways.

llvm-svn: 138016
2011-08-19 00:26:36 +00:00
Bill Wendling c61f7659ba Intelligently split the landing pad block.
We have to be careful when splitting the landing pad block, because the
landingpad instruction is required to remain as the first non-PHI of an invoke's
unwind edge. To retain this, we split the block into two blocks, moving the
predecessors within the loop to one block and the remaining predecessors to the
other. The landingpad instruction is cloned into the new blocks.

llvm-svn: 138015
2011-08-19 00:09:22 +00:00
Bill Wendling ca7d309623 Add SplitLandingPadPredecessors().
SplitLandingPadPredecessors is similar to SplitBlockPredecessors in that it
splits the current block and attaches a set of predecessors to the new basic
block. However, it differs from SplitBlockPredecessors in that it's specifically
designed to handle landing pad blocks.

Two new basic blocks are created: one that is has the vector of predecessors as
its predecessors and one that has the remaining predecessors as its
predecessors. Those two new blocks then receive a cloned copy of the landingpad
instruction from the original block. The landingpad instructions are joined in a
PHI, etc. Like SplitBlockPredecessors, it updates the LLVM IR, AliasAnalysis,
DominatorTree, DominanceFrontier, LoopInfo, and LCCSA analyses.

llvm-svn: 138014
2011-08-19 00:05:40 +00:00
Johnny Chen 42f192ad17 Revert the previous addition of expectedFailure decorators, it was a mistake.
llvm-svn: 138013
2011-08-19 00:00:55 +00:00
Bruno Cardoso Lopes 5647d84aa4 Re-encoded 128-bit AVX versions of SQRT, RSQRT, RCP have 3 operands
instead of 2. They were already defined this way in their regular
version, but not for the intrinsics versions (*_Int), and that would work
for assembly emission but not for object code, since a MachineOperand
would be missing. This commit fix PR10697.

Also removed the {VSQRT,VRSQRT,VRCP}r_Int forms and match the intrinsic
via INSERT_SUBREG+EXTRACT_SUBREG patterns. The same couldn't be done for
memory versions because sse_load_f32/sse_load_f64 operand need special
handling and don't work like regular "addr" operands.

There are right now 114 "*_Int" and 98 "Int_*" forms! I'm slowly
removing them as I step through, but hope we can get rid of these
someday, they are really annoying :)

llvm-svn: 138012
2011-08-18 23:59:21 +00:00
Johnny Chen 904cb64d64 Add expectedFailure decorator.
Failed possibly due to rollback of llvm/clang.

llvm-svn: 138011
2011-08-18 23:53:03 +00:00
Devang Patel 425b4dcc30 There is no need to add file as context for subroutine type. The subroutine type does not need any context.
llvm-svn: 138010
2011-08-18 23:50:57 +00:00
Renato Golin c8d4065781 add the comments of each declaration follow it, making it easier to read and compare to GCC's result.
llvm-svn: 138009
2011-08-18 23:43:14 +00:00
Bill Wendling 2b31c45e8e Use 'getFirstInsertionPt' when trying to insert new instructions during LICM.
llvm-svn: 138008
2011-08-18 23:42:36 +00:00
Akira Hatanaka fb4161ae88 Use subword loads instead of a 4-byte load when the size of a structure (or a
piece of it) that is being passed by value is smaller than a word.

llvm-svn: 138007
2011-08-18 23:39:37 +00:00
Devang Patel 0ecbcbd12c Eliminate unnecessary forwarding function.
llvm-svn: 138006
2011-08-18 23:17:55 +00:00
Ivan Krasin 44306e2e5f Add NativeClient operating system support.
This patch adds support of NativeClient (*-*-nacl) OS support to LLVM.
It's already supported in autoconf/config.sub.

The motivation for this change is to start upstreaming PNaCl work. The
whole set of patches include llvm backends (i686, x86_64, ARM),
llvm-gcc (probably, would not be upstreamed because it's deprecated)
and clang (the work has been just started, the amount of changes is
going to be low and the most of the work is expected to be done close
to the mainline).

llvm-svn: 138005
2011-08-18 22:54:21 +00:00
Ted Kremenek 18db5d4e9d Enhance -Wstrl-incorrect-size to not report a FIXIT for destinations that are flexible arrays or have size 1.
llvm-svn: 138004
2011-08-18 22:48:41 +00:00
Owen Anderson 96b7ad2e17 STC2L_POST and STC2L_POST should be handled the same as STCL_POST/LDC_POST for the purposes of decoding all operands except the predicate.
Found by randomized testing.

llvm-svn: 138003
2011-08-18 22:47:44 +00:00
Johnny Chen 293683b6c4 Add an option (-p regexp-pattern) to specify the regular expression symbol pattern we're interested in disassembling.
An example:

utils/test/lldb-disasm.py -C "platform select remote-ios" -o "-b -n" -e '~/CoreFoundation' -n 20 -p '-\[NSArray .+\]'

disassembles the first 20 NSArray instance methods found in the CoreFoundation module.

llvm-svn: 138002
2011-08-18 22:46:50 +00:00
Anna Zaks f4dd4ae7cc Static Analyzer Diagnostics: Move custom diagnostic visitors from BugReporterContext to BugReport.
One API change: I added BugReporter as an additional parameter to the BugReporterVisitor::VisitNode() method to allow visitors register other visitors with the report on the fly (while processing a node). This functionality is used by NilReceiverVisitor, which registers TrackNullOrUndefValue when the receiver is null.

llvm-svn: 138001
2011-08-18 22:37:56 +00:00
Owen Anderson 192a760b54 Fix the decoding of RFE instruction. RFEs have the load bit set, while SRSs have it unset.
llvm-svn: 138000
2011-08-18 22:31:17 +00:00
Ted Kremenek 288d31d62a [libclang] Remove NestedNameSpecifierVisit, as Clang says that this code is dead.
llvm-svn: 137999
2011-08-18 22:25:21 +00:00
Devang Patel a6576a146d Add new DIE into the map asap.
llvm-svn: 137998
2011-08-18 22:21:50 +00:00
Owen Anderson 5d2db89ba6 Remember to fill in some operands so we can print _something_ coherent even when decoding the CPS instruction soft-fails.
llvm-svn: 137997
2011-08-18 22:15:25 +00:00
Owen Anderson 67d6f11974 Improve handling of failure and unpredictable cases for CPS, STR, and SMLA instructions.
Fixes a large class of disassembler crashes found by randomized testing.

llvm-svn: 137995
2011-08-18 22:11:02 +00:00
Ivan Krasin d7cbd4c518 FastISel: avoid function calls between the materialization of the constant and its use.
llvm-svn: 137993
2011-08-18 22:06:10 +00:00
Johnny Chen f6cb9bcf55 Apply some workaround for known crashers.
llvm-svn: 137991
2011-08-18 22:05:58 +00:00
Johnny Chen 901209dcca Add an option '-q' to have quiet disassembly by not printing out the disassembled result.
This could be useful by reducing the strain on standard output.

Example:

utils/test/lldb-disasm.py -C "platform select remote-ios" -o "-b -n" -e '~/CoreFoundation' -n 50 -q

llvm-svn: 137988
2011-08-18 22:04:27 +00:00
Kaelyn Uhrain 40aa7c91b6 Don't accept a typo correction if the corrected identifier is the same as the
uncorrected identifier. Fixes a problem pointed out by Eli.

llvm-svn: 137987
2011-08-18 21:57:36 +00:00
Jim Grosbach 90103ccc05 Thumb assembly parsing and encoding for LDM instruction.
Fix base register type and canonicallize to the "ldm" spelling rather than
"ldmia." Add diagnostics for incorrect writeback token and out-of-range
registers.

llvm-svn: 137986
2011-08-18 21:50:53 +00:00
Dan Gohman c57b58cc40 Make it clear that this code is iterating in reverse order through the array.
llvm-svn: 137985
2011-08-18 21:27:42 +00:00
Ivan Krasin 764b0c1408 Update autoconfig/config.{sub,guess} to the latest version
from the GNU upstream: git://git.savannah.gnu.org/config.git

1. It eliminates a local LLVM patch for auroraux (because, the
mainline config.sub has already got support of auroraux)
2. It adds several new recognized target cpus and operating systems
(in particular, PNaCl)

llvm-svn: 137984
2011-08-18 21:23:18 +00:00
Ted Kremenek 0a57df1981 Remove main() *errors* from warning group.
llvm-svn: 137983
2011-08-18 21:20:46 +00:00