Commit Graph

129268 Commits

Author SHA1 Message Date
John McCall f60e437168 Adjust this code so that it strictly honors
TargetSimulatroVersionFromDefines if present;  this also makes
it easier to chain things correctly.  Noted by an internal
review.

llvm-svn: 158926
2012-06-21 17:46:38 +00:00
Jack Carter b2fd5f66b4 The inline asm operand modifier 'c' is suppose
to be generic across architectures. It has the
following description in the gnu sources:

    Substitute immediate value without immediate syntax

Several Architectures such as x86 have local implementations
of operand modifier 'c' which go beyond the above description
slightly. To make use of the generic modifiers without overriding
local implementation one can make a call to the base class method
for AsmPrinter::PrintAsmOperand() in the locally derived method's 
"default" case in the switch statement. That way if it is already
defined locally the generic version will never get called.

This change is needed when test/CodeGen/generic/asm-large-immediate.ll
failed on a native Mips board. The test was assuming a generic
implementation was in place.

Affected files:

    lib/Target/Mips/MipsAsmPrinter.cpp:
        Changed the default case to call the base method.
    lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
        Added 'c' to the switch cases.
    test/CodeGen/Mips/asm-large-immediate.ll
        Mips compiled version of the generic one

Contributer: Jack Carter
llvm-svn: 158925
2012-06-21 17:14:46 +00:00
Nuno Lopes beee2f10e0 move some typedefs so that we don't polute the llvm namespace. this should appease the GCC buildbots
llvm-svn: 158924
2012-06-21 16:58:41 +00:00
Nuno Lopes a6aa3d3b5f hopefully fix the buildbots: some tests have wrong definitions of malloc and were crashing this code on 64 bits machines
llvm-svn: 158923
2012-06-21 16:47:58 +00:00
Alexander Potapenko 245f4ae59a Small lint fix.
llvm-svn: 158922
2012-06-21 16:40:59 +00:00
Alexander Potapenko 70feed27ea Add a test for issue 81 -- AddressSanitizerMac.DISABLED_CFAllocatorDefaultDoubleFree_ChildPhread
llvm-svn: 158921
2012-06-21 16:08:11 +00:00
Nuno Lopes 0e967e0186 port the BoundsChecking patch to the new MemoryBuiltin API (i.e., remove most of the code from here).
Remove the alloc_size.ll test until we settle on a metadata format that makes everyone happy..

llvm-svn: 158920
2012-06-21 15:59:53 +00:00
Nuno Lopes 55fff83422 refactor the MemoryBuiltin analysis:
- provide more extensive set of functions to detect library allocation functions (e.g., malloc, calloc, strdup, etc)
 - provide an API to compute the size and offset of an object pointed by

Move a few clients (GVN, AA, instcombine, ...) to the new API.
This implementation is a lot more aggressive than each of the custom implementations being replaced.

Patch reviewed by Nick Lewycky and Chandler Carruth, thanks.

llvm-svn: 158919
2012-06-21 15:45:28 +00:00
Nadav Rotem 4e9012c2b1 Add a number of threshold arguments to the SRA pass.
A patch by Tom Stellard with minor changes.

llvm-svn: 158918
2012-06-21 13:44:31 +00:00
NAKAMURA Takumi 613663cfe2 Revert r158209, "test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since r157911."
It passes according to ppc changes.

llvm-svn: 158917
2012-06-21 13:43:06 +00:00
Alexey Samsonov 8d0c1eb784 Less restrictive check in unit test for unsupported debug info options
llvm-svn: 158916
2012-06-21 13:30:54 +00:00
NAKAMURA Takumi 84f133d69f Revert r158423 corresponding to r158796, "test/Driver/warning-options.cpp: Mark as XFAIL:cygming. -pedantic is passed with gcc-as driver. PR12920"
llvm-svn: 158915
2012-06-21 12:45:24 +00:00
NAKAMURA Takumi 9573c48aae llvm/unittests/ExecutionEngine/JIT/CMakeLists.txt: Unbreak build.
llvm-svn: 158914
2012-06-21 12:44:58 +00:00
Kostya Serebryany 6e26fa9dd1 [tsan] first step in implementing a custom allocator for tsan (and msan) which saves precious shadow
llvm-svn: 158913
2012-06-21 10:04:36 +00:00
Chandler Carruth 92f2f37bae Add a pragma to supress an MSVC warning on some of the absurd code I'm
using to test the alignment support library.

Patch from Nikola on IRC.

llvm-svn: 158912
2012-06-21 10:02:41 +00:00
Chandler Carruth 33af93f7a6 Add some missing dependencies here that I missed in my first pass
through. Also sort them.

llvm-svn: 158911
2012-06-21 10:02:40 +00:00
Chandler Carruth 016bbd88cf Clang side of a refactoring of the CMake unit test build strategy.
The fundamental change is to put a CMakeLists.txt file in the unittest
directory, with a single test binary produced from it. This has several
advantages.

Among other fundamental advantages, we start to get the checking logic
for when a file is missing from the CMake build, and this caught one
missing file already! More fun details in the LLVM commit corresponding
to this one.

Note that the LLVM commit and this one most both be applied, or neither.
Sorry for any skew issues.

llvm-svn: 158910
2012-06-21 09:51:42 +00:00
Chandler Carruth 94d0251824 Completely refactor the structuring of unittest CMake files to match the
Makefiles, the CMake files in every other part of the LLVM tree, and
sanity.

This should also restore the output tree structure of all the unit
tests, sorry for breaking that, and thanks for letting me know.

The fundamental change is to put a CMakeLists.txt file in the unittest
directory, with a single test binary produced from it. This has several
advantages:

- No more weird directory stripping in the unittest macro, allowing it
  to be used more readily in other projects.
- No more directory prefixes on all the source files.
- Allows correct and precise use of LLVM's per-directory dependency
  system.
- Allows use of the checking logic for source files that have not been
  added to the CMake build. This uncovered a file being skipped with
  CMake in LLVM and one in Clang's unit tests.
- Makes Specifying conditional compilation or other custom logic for JIT
  tests easier.

It did require adding the concept of an explicit 'optional' source file
to the CMake build so that the missing-file check can skip cases where
the file is *supposed* to be missing. =]

This is another chunk of refactoring the CMake build in order to make it
usable for other clients like CompilerRT / ASan / TSan.

Note that this is interdependent with a Clang CMake change.

llvm-svn: 158909
2012-06-21 09:51:26 +00:00
Nadav Rotem 0fb7408144 llvm-stress: Stabalize (by using an ordered container) and add randomness to the order in which loops are generated.
llvm-svn: 158908
2012-06-21 08:58:15 +00:00
Daniel Jasper c4dabab941 Make the RecursiveASTVisitor visit the body of a range-based for loop
again. This was broken in r158395.

llvm-svn: 158907
2012-06-21 08:50:04 +00:00
Alexey Samsonov f50a9ffd0b Improve support for -g options accepted by Clang:
1. Accept flags -g[0-3], -ggdb[0-3], -gdwarf-[2-4] and collapse them to simple -g (except -g0/-ggdb0).
2. Produce driver error on unsupported formats (-gcoff, -gstabs, -gvms) and options (-gtoggle).
3. Recognize and ignore flags -g[no-]strict-dwarf, -g[no-]record-gcc-switches.

llvm-svn: 158906
2012-06-21 08:22:39 +00:00
Alexey Samsonov f8947a3360 [ASan] fix lint error
llvm-svn: 158905
2012-06-21 08:13:49 +00:00
Bill Wendling a10801fe6f Cleanup some encoding mishaps.
llvm-svn: 158904
2012-06-21 07:01:02 +00:00
Bill Wendling b5c7aa515e Sphinxify the tablegen document.
llvm-svn: 158903
2012-06-21 06:58:24 +00:00
Lang Hames 90b2a4cbad Add a missing llvm.fma -> VFNMS pattern to the ARM backend.
llvm-svn: 158902
2012-06-21 06:10:00 +00:00
Bill Wendling 5b26461e09 Sphinxify the outdated Packaging documentation.
llvm-svn: 158901
2012-06-21 06:09:37 +00:00
Evan Cheng 8c2ad81238 Emit a single _udivmodsi4 libcall instead of two separate _udivsi3 and
_umodsi3 libcalls if they have the same arguments. This optimization
was apparently broken if one of the node was replaced in place.
rdar://11714607

llvm-svn: 158900
2012-06-21 05:56:05 +00:00
Jordan Rose 422080f547 Pretend that enum constants have enum type when inferring a block return type.
In C, enum constants have the type of the enum's underlying integer type,
rather than the type of the enum. (This is not true in C++.) This leads to
odd warnings when returning enum constants directly in blocks with inferred
return types. The easiest way out of this is to pretend that, like C++, enum
constants have enum type when being returned from a block.

<rdar://problem/11662489>

llvm-svn: 158899
2012-06-21 05:54:55 +00:00
Jordan Rose 815fe26ed3 Don't warn for -Wstatic-in-inline if the used function is also inline.
Also, don't warn if the used function is __attribute__((const)), in which case
it's not supposed to use global variables anyway.

The inline-in-inline thing is a heuristic, and one that's possibly incorrect
fairly often because the function being inlined could definitely use global
variables. However, even some C standard library functions are written using
other (trivial) static-inline functions in the headers, and we definitely don't
want to be warning on that (or on anything that /uses/ these trivial inline
functions). So we're using "inlined" as a marker for "fairly trivial".

(Note that __attribute__((pure)) does /not/ guarantee safety like ((const),
because ((const)) does not guarantee that global variables are not being used,
and the warning is about globals not being shared across TUs.)

llvm-svn: 158898
2012-06-21 05:54:50 +00:00
Chandler Carruth f0dcac6800 Switch Clang to re-use the the newly factored common LLVM
implementation. Yay for '-' lines in CMake!

llvm-svn: 158897
2012-06-21 05:23:23 +00:00
Chandler Carruth a5d42f83f9 Factor the logic for setting up a GoogleTest unit test executable into
a helper function in CMake. This will allow us to share all of this
logic with Clang, and eventually CompilerRT.

llvm-svn: 158896
2012-06-21 05:16:58 +00:00
Richard Smith 73af5c6dda MS: Mangle rvalue references and nullptr_t, and produce back-references when
appropriate. Patch by João Matos!

llvm-svn: 158895
2012-06-21 02:52:27 +00:00
Chandler Carruth 8897331381 Simplify the Clang unittest function in the CMake build, and make it
match the LLVM implemenation. This also simplifies the name management
and splits the custom library management out from the unittest specific
management. It finally drops the dependency on parsing cmake arguments.

llvm-svn: 158894
2012-06-21 02:04:39 +00:00
Chandler Carruth 1313d9860d Simplify the naming pattern in the unittests' CMake file
llvm-svn: 158893
2012-06-21 02:02:48 +00:00
Jason Molenda a5609c8588 Preliminary set of changes to ObjectFileMachO::ParseSymtab when lldb
is being run on iOS natively and we are examining a binary that is
in the shared-cache.  The shared cache may be set up to not load the
symbol names in memory (and may be missing some local symbols entirely,
to boot) so we need to read the on-disk-but-not-mapped-into-memory cache
of symbol names/symbols before we start processing the in-memory nlist
entries.  

This code needs to be reorganized into its own separate method, ideally
we'll find some way to not duplicate the nlist symbol handling.  But 
we need to handle this new format quickly and we'll clean up later.

Thanks for James McIlree for the patch.  Fixes <rdar://problem/11639018>.

llvm-svn: 158891
2012-06-21 01:51:02 +00:00
Jason Molenda 06bca9ed0e Bump version number to lldb-160.
llvm-svn: 158890
2012-06-21 01:41:15 +00:00
Chandler Carruth e530d2ba4d Remove one of the LLVM-specific CMake hacks in favor of standard CMake
facilities.

This was only used in one place in LLVM, and was used pervasively (but
with different code!) in Clang. It has no advantages over the standard
CMake facilities and in some cases disadvantages.

llvm-svn: 158889
2012-06-21 01:35:09 +00:00
Chandler Carruth 28969b4139 Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

llvm-svn: 158888
2012-06-21 01:30:21 +00:00
Richard Smith c7b0bdffe7 If an object (such as a std::string) with an appropriate c_str() member function
is passed to a variadic function in a position where a format string indicates
that c_str()'s return type is desired, provide a note suggesting that the user
may have intended to call the c_str() member.

Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and
move it to SemaChecking in order to facilitate this. Factor the call checking
out of function call checking and block call checking, and extend it to cover
constructor calls too.

Patch by Sam Panzer!

llvm-svn: 158887
2012-06-21 01:08:35 +00:00
Alexander Potapenko 15b4cafd2c Enable AddressSanitizerMac.CFAllocatorDefaultDoubleFree and AddressSanitizerMac.CFAllocatorMallocDoubleFree, which now work fine.
llvm-svn: 158886
2012-06-21 01:04:30 +00:00
Alexander Potapenko 1bde28b464 Factor the common code out of cf_free and mz_free.
Introduce the mac_ignore_invalid_free flag (0 by default) which makes both cf_free and mz_free ignore invalid free invocations and leak memory.

llvm-svn: 158885
2012-06-21 01:01:20 +00:00
Chandler Carruth 4b3d2c801c Remove an unused feature of the clang unittest macro.
llvm-svn: 158884
2012-06-21 00:40:48 +00:00
Richard Smith d0124578ee Do not complain about junk on the end of a #endif in a skipped block. Such junk
is permitted by all relevant language standards. Patch by Andy Gibbs!

llvm-svn: 158883
2012-06-21 00:35:03 +00:00
Dmitri Gribenko 7bedfda489 RawCommentList::addComment: fix the assertion so it actually checks that new comment is after the last one (change Comments[0] to Comments.back()), and handle the case of two consecutive comments, e.g. /** *//* */. There is already a testcase for that (but it didn't trigger the assert because the assert itself was wrong).
llvm-svn: 158882
2012-06-21 00:28:14 +00:00
Jakob Stoklund Olesen 58713de545 Update regunits in RegisterCoalescer::reMaterializeTrivialDef.
Old code would only update physreg live intervals.

llvm-svn: 158881
2012-06-21 00:09:15 +00:00
Meador Inge 6a706af708 Put space after "code-block::".
llvm-svn: 158880
2012-06-20 23:57:00 +00:00
Jakob Stoklund Olesen 88ef957e74 Remove LiveIntervals::iterator.
Live intervals for regunits and virtual registers are stored separately,
and physreg live intervals are going away.

To visit the live ranges of all virtual registers, use this pattern
instead:

  for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) {
    unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
    if (MRI->reg_nodbg_empty(Reg))
      continue;

llvm-svn: 158879
2012-06-20 23:54:20 +00:00
Jakob Stoklund Olesen 37a1338a16 Remove spurious typedefs.
llvm-svn: 158878
2012-06-20 23:54:18 +00:00
Meador Inge 46137da795 Removed some left over HTML tags and a '}'.
llvm-svn: 158877
2012-06-20 23:48:01 +00:00
Jakob Stoklund Olesen 1911a0203d Remove the RenderMachineFunction HTML output pass.
I don't think anyone has been using this functionality for a while, and
it is getting in the way of refactoring now.

llvm-svn: 158876
2012-06-20 23:47:58 +00:00