Commit Graph

131580 Commits

Author SHA1 Message Date
Eli Friedman 0415f3e138 Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531.  <rdar://problem/12048621>.

llvm-svn: 161523
2012-08-08 21:08:34 +00:00
Chad Rosier b1886eb604 [ms-inline asm] Make sure IsSimple is correctly handled.
llvm-svn: 161522
2012-08-08 21:08:20 +00:00
Chad Rosier 66753b3835 Remove extraneous comment.
llvm-svn: 161521
2012-08-08 20:38:22 +00:00
Chad Rosier 83916498b8 [ms-inline asm] Add a very simple test case. Basically, we're only testing for
crashers at the moment (and coincidentally this case was causing a crash).

llvm-svn: 161520
2012-08-08 20:37:31 +00:00
Bob Wilson 4c65c505e0 Add test triples to fix win32 failures. Revert workaround from r161292.
I don't have a win32 system to test, so hopefully I got them all fixed here.

llvm-svn: 161519
2012-08-08 20:31:37 +00:00
Chad Rosier 3ed0bd9938 [ms-inline asm] Refactor the logic to generate the AsmString into Sema. No
functional change intended.

llvm-svn: 161518
2012-08-08 19:48:07 +00:00
Chad Rosier 55a2d9397c Whitespace.
llvm-svn: 161517
2012-08-08 18:51:50 +00:00
Chad Rosier 1dcde96842 Whitespace.
llvm-svn: 161516
2012-08-08 18:46:20 +00:00
Bill Wendling 55d28436a7 Remove OpenBSD defines:
- The defines are in stddint.h, which is #include'd already.
- The block wasn't used anyway, since it was _OpenBSD_, and not __OpenBSD__

Patch by David Hill!

llvm-svn: 161515
2012-08-08 18:37:39 +00:00
Chandler Carruth 33453d06c4 Add a copy of the LLVM license here so that even a stand-alone checkout
includes the proper license text.

llvm-svn: 161514
2012-08-08 18:30:15 +00:00
Jakob Stoklund Olesen fa8a26f9df Heed -stress-early-ifcvt.
llvm-svn: 161513
2012-08-08 18:24:23 +00:00
Jordan Rose d86b3bdb7a [analyzer] Clean up the printing of FieldRegions for leaks.
Unfortunately, generalized region printing is very difficult:
- ElementRegions are used both for casting and as actual elements.
- Accessing values through a pointer means going through an intermediate
  SymbolRegionValue; symbolic regions are untyped.
- Referring to implicitly-defined variables like 'this' and 'self' could be
  very confusing if they come from another stack frame.

We fall back to simply not printing the region name if we can't be sure it
will print well. This will allow us to improve in the future.

llvm-svn: 161512
2012-08-08 18:23:36 +00:00
Jordan Rose 356279ca2d [analyzer] Track malloc'd regions stored in structs.
The main blocker on this (besides the previous commit) was that
ScanReachableSymbols was not looking through LazyCompoundVals.
Once that was fixed, it's easy enough to clear out malloc data on return,
just like we do when we bind to a global region.

<rdar://problem/10872635>

llvm-svn: 161511
2012-08-08 18:23:31 +00:00
Jordan Rose 3a80cec5e9 [analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.
RegionStore currently uses a (Region, Offset) pair to describe the locations
of memory bindings. However, this representation breaks down when we have
regions like 'array[index]', where 'index' is unknown. We used to store this
as (SubRegion, 0); now we mark them specially as (SubRegion, SYMBOLIC).

Furthermore, ProgramState::scanReachableSymbols depended on the existence of
a sub-region map, but RegionStore's implementation doesn't provide for such
a thing. Moving the store-traversing logic of scanReachableSymbols into the
StoreManager allows us to eliminate the notion of SubRegionMap altogether.

This fixes some particularly awkward broken test cases, now in
array-struct-region.c.

llvm-svn: 161510
2012-08-08 18:23:27 +00:00
Jordan Rose 55edf5ff14 Constify CXXRecordDecl::isVirtuallyDerivedFrom.
No functionality change. A couple ugly const_casts because the ancestor
search code is used for other purposes as well.

llvm-svn: 161509
2012-08-08 18:23:20 +00:00
Chad Rosier d12b7a64dc [ms-inline asm] Add support for detecting simple ms-style inline asm. Simple
asm statements are those that don't reference variable names, function names,
and labels.

Add logic to generate a patched AsmString that will eventually be consumed by
the AsmParser.  No functional change at this point, so unfortunately no test
case.

llvm-svn: 161508
2012-08-08 18:22:06 +00:00
Jakob Stoklund Olesen e71b6c6b20 Get the MispredictPenalty from MCSchedModel.
Thanks, Andy!

llvm-svn: 161507
2012-08-08 18:19:58 +00:00
Chandler Carruth 661d7ff913 Replace the stub README with a proper one based on Clang's.
Also test the commit hooks for the new repository.

llvm-svn: 161506
2012-08-08 18:16:41 +00:00
Sebastian Pop 82622dc3e9 revert my previous patch
llvm-svn: 161505
2012-08-08 18:04:45 +00:00
Sebastian Pop 7e9da1d4e8 enable Hexagon target from cmake
This patch allows us to use cmake to specify a cross compiler for Hexagon.

In particular, the patch adds a missing case for the target Hexagon in
cmake/config-ix.cmake, and it moves LLVM_DEFAULT_TARGET_TRIPLE and TARGET_TRIPLE
variables from cmake/config-ix.cmake to the toplevel CMakeLists.txt to make them
available at configure time. Here is the command line that I have used to test
my patches:

$ cmake -G Ninja -D BUILD_SHARED_LIBS:BOOL=ON -D LLVM_TARGETS_TO_BUILD:STRING=Hexagon -D TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_DEFAULT_TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_TARGET_ARCH:STRING=hexagon-unknown-linux-gnu -D LLVM_ENABLE_PIC:BOOL=OFF ..
$ ninja check

llvm-svn: 161504
2012-08-08 17:45:43 +00:00
Chad Rosier d2ff32aa94 Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.
llvm-svn: 161503
2012-08-08 17:35:36 +00:00
Sean Callanan bf154daee6 Added a 'void' format so that the user can manually
suppress all non-error output from the "expression"
command.

<rdar://problem/11225150>

llvm-svn: 161502
2012-08-08 17:35:10 +00:00
David Blaikie 1c7c8f7637 Implement warning for integral null pointer constants other than the literal 0.
This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

llvm-svn: 161501
2012-08-08 17:33:31 +00:00
Fariborz Jahanian a5063a6208 objc: Include all types when issuing warning under
-Wdirect-ivar-access.

llvm-svn: 161500
2012-08-08 16:41:04 +00:00
Chad Rosier 4577cd3036 Add various MC components to clang build to support MS-style inline assembly.
llvm-svn: 161498
2012-08-08 16:27:29 +00:00
Howard Hinnant d79842c2bf Change size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for 64 bit targets. This is controls the data layout of all exceptions defined in <stdexcept>. This aligns the ABI with that of gcc-4.2.
llvm-svn: 161497
2012-08-08 16:17:31 +00:00
Howard Hinnant 2c2b55f27f Change size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for 64 bit targets. This is controls the data layout of all exceptions defined in <stdexcept>. This aligns the ABI with that of gcc-4.2.
llvm-svn: 161496
2012-08-08 16:15:16 +00:00
Dylan Noblesmith 4c004f3e13 Preprocessor: fix __OPTIMIZE_SIZE__ and -Oz
Add some tests for __OPTIMIZE_SIZE__ and  __NO_INLINE__,
removing the superfluous copies in the target-specific
tests, since it's target-independent.

This uncovered a bug in the handling of -Oz: it would
attempt to store the value 2 in the 1-bit bitfield OptimizeSize,
leaving a value of 0 and never defining __OPTIMIZE_SIZE__.

llvm-svn: 161495
2012-08-08 16:09:15 +00:00
Dylan Noblesmith c0cebeddb2 Frontend: further document __BYTE_ORDER__
llvm-svn: 161494
2012-08-08 16:09:12 +00:00
Filipe Cabecinhas f2bac60f74 Indentation fix for dotest.py.
llvm-svn: 161493
2012-08-08 15:23:24 +00:00
Filipe Cabecinhas d6cab1f6af Make dotest.py runnable from a directory other than lldb/test
llvm-svn: 161492
2012-08-08 15:05:04 +00:00
Rafael Espindola cb7eadfe7e Typedefs and indentation fixes from the Andy Zhang/PAX macro argument patch.
Committing it first as it makes the "real" patch a lot easier to read.

llvm-svn: 161491
2012-08-08 14:51:03 +00:00
NAKAMURA Takumi ec934cd64d llvm/test/MC/COFF/seh.s: Fixup corresponding to r161487.
llvm-svn: 161489
2012-08-08 13:27:04 +00:00
Anton Korobeynikov cc8c539300 Fix for .pdata and .xdata section attributes on COFF.
Patch by kai@redstar.de !

llvm-svn: 161487
2012-08-08 12:46:46 +00:00
Alexey Samsonov 4750230ac6 [Sanitizer] cleanup CMake files for interception and sanitizer_common helper libraries
llvm-svn: 161485
2012-08-08 09:46:51 +00:00
Benjamin Kramer 90653a1920 Remove unused variables.
llvm-svn: 161483
2012-08-08 09:26:28 +00:00
Hans Wennborg 29fbe3e0d7 Revert part of r161175 which was wrong for OpenBSD's PowerPC target.
Contributed by Brad Smith <brad@comstyle.com>

llvm-svn: 161481
2012-08-08 08:41:02 +00:00
Bill Wendling 26f1f00999 Sphinxify the CommandLine document.
llvm-svn: 161479
2012-08-08 08:21:24 +00:00
Bill Wendling 7daef91de0 Move header so that it can be picked up by other .rst files.
llvm-svn: 161478
2012-08-08 06:42:30 +00:00
Bill Wendling ce4fe41d21 Add `.pushsection', `.popsection', and `.previous' directives to Darwin ASM.
There are situations where inline ASM may want to change the section -- for
instance, to create a variable in the .data section. However, it cannot do this
without (potentially) restoring to the wrong section. E.g.:

  asm volatile (".section __DATA, __data\n\t"
                ".globl _fnord\n\t"
                "_fnord: .quad 1f\n\t"
                ".text\n\t"
                "1:" :::);

This may be wrong if this is inlined into a function that has a "section"
attribute. The user should use `.pushsection' and `.popsection' here instead.

The addition of `.previous' is added for completeness.
<rdar://problem/12048387>

llvm-svn: 161477
2012-08-08 06:30:30 +00:00
Richard Smith f2b084fc5a Implement final piece of DR963 and also DR587:
A conditional operator between glvalues of types cv1 T and cv2 T produces a
glvalue if the expressions are of the same value kind and one of cv1 and cv2
is a subset of the other.

A conditional operator between two null pointer constants is permitted if one
of them is of type std::nullptr_t.

llvm-svn: 161476
2012-08-08 06:13:49 +00:00
Chris Lattner b35f34105e clarify that the advantages of the BSD license apply to when you incorporate clang into proprietary code bases,
patch by Jonathan Sauer.

llvm-svn: 161475
2012-08-08 05:26:51 +00:00
Eli Friedman ecffd83c85 Get rid of an early return in Sema::ActOnFields which doesn't make sense anymore.
Fixes a crash (<rdar://problem/11067144>), and generally seems to improve
recovery in other cases.

llvm-svn: 161474
2012-08-08 04:39:56 +00:00
Eli Friedman f6d2184c83 Fix an assertion failure with a C++ constructor initializing a
member of reference type in an anonymous struct.  PR13154.

llvm-svn: 161473
2012-08-08 03:51:37 +00:00
Eli Friedman 70bc6e6019 Fix a -ast-dump crash.
llvm-svn: 161472
2012-08-08 03:47:15 +00:00
Andrew Trick 352abc19a5 Added MispredictPenalty to SchedMachineModel.
This replaces an existing subtarget hook on ARM and allows standard
CodeGen passes to potentially use the property.

llvm-svn: 161471
2012-08-08 02:44:16 +00:00
Andrew Trick db9b1b5e66 Minor cleanup of defaultDefLatency API
llvm-svn: 161470
2012-08-08 02:44:11 +00:00
Andrew Trick 207c569cf3 whitespace
llvm-svn: 161469
2012-08-08 02:44:08 +00:00
Eli Friedman 08ec0a8122 isAllocLikeFn is allowed to return true for functions which read memory; make
sure we account for that correctly in DeadStoreElimination.  Fixes a regression
from r158919.  PR13547.

llvm-svn: 161468
2012-08-08 02:17:32 +00:00
Enrico Granata 40d557107f <rdar://problem/11975483> Removing user-visible references to 'dict' as a parameter name for Python summary-generating functions since it is a Python keyword.
llvm-svn: 161467
2012-08-08 02:06:30 +00:00