Commit Graph

130292 Commits

Author SHA1 Message Date
NAKAMURA Takumi 61d9268595 clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp: Fixup for -Asserts.
llvm-svn: 159898
2012-07-07 10:25:42 +00:00
Benjamin Kramer 1e250395fa Wire up -mrdrnd for X86.
For some reason GCC decided to call the feature rdrnd instead of rdrand,
which requires translating it for LLVM.

llvm-svn: 159897
2012-07-07 09:39:18 +00:00
Richard Smith e20c83d9ed PR12670: Support for initializing an array of non-aggregate class type from an
initializer list. Patch by Olivier Goffart, with extra testcases by Meador Inge
and Daniel Lunow.

llvm-svn: 159896
2012-07-07 08:35:56 +00:00
Richard Smith 4ff9ff974c When marking virtual functions as used for a class' vtable, mark all functions
which will appear in the vtable as used, not just those ones which were
declared within the class itself. Fixes an issue reported as comment#3 in
PR12763 -- we sometimes assert in codegen if we try to emit a reference to a
function declaration which we've not marked as referenced. This also matches
gcc's observed behavior.

llvm-svn: 159895
2012-07-07 06:59:51 +00:00
John McCall 8dda7b27ee Distinguish more carefully between free functions and C++ instance methods
in the ABI arrangement, and leave a hook behind so that we can easily
tweak CCs on platforms that use different CCs by default for C++
instance methods.

llvm-svn: 159894
2012-07-07 06:41:13 +00:00
Ted Kremenek 30105f67b4 Enhance 'diagtool list-warnings' to report number of diagnostics covered directly under -Wpedantic, and enhance warning-flags.c test to test that this set does not grow.
llvm-svn: 159893
2012-07-07 06:30:31 +00:00
Ted Kremenek b22ea2acea Re-apply r159875 with fixes.
- Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32
- Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic.

llvm-svn: 159892
2012-07-07 05:53:30 +00:00
Andrew Trick 87255e340e I'm introducing a new machine model to simultaneously allow simple
subtarget CPU descriptions and support new features of
MachineScheduler.

MachineModel has three categories of data:
1) Basic properties for coarse grained instruction cost model.
2) Scheduler Read/Write resources for simple per-opcode and operand cost model (TBD).
3) Instruction itineraties for detailed per-cycle reservation tables.

These will all live side-by-side. Any subtarget can use any
combination of them. Instruction itineraries will not change in the
near term. In the long run, I expect them to only be relevant for
in-order VLIW machines that have complex contraints and require a
precise scheduling/bundling model. Once itineraries are only actively
used by VLIW-ish targets, they could be replaced by something more
appropriate for those targets.

This tablegen backend rewrite sets things up for introducing
MachineModel type #2: per opcode/operand cost model.

llvm-svn: 159891
2012-07-07 04:00:00 +00:00
Andrew Trick 91118a6155 whitespace
llvm-svn: 159890
2012-07-07 03:59:51 +00:00
Andrew Trick 030e2f8f1a Tweak spelling.
llvm-svn: 159889
2012-07-07 03:59:48 +00:00
Manman Ren bb36074047 X86: Fix optimizeCompare to correctly check safe condition.
It is safe if EFLAGS is killed or re-defined.
When we are done with the basic block, check whether EFLAGS is live-out.
Do not optimize away cmp if EFLAGS is live-out.

llvm-svn: 159888
2012-07-07 03:34:46 +00:00
NAKAMURA Takumi 80eb0c502d LLVMConfig.cmake.in: Quote around @LLVM_INSTALL_PREFIX@, or it would not accept whitespace paths.
Thanks to Kai.

llvm-svn: 159887
2012-07-07 03:12:28 +00:00
NAKAMURA Takumi eec53e4069 Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement -Weverything." It broke several builds.
I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test.

> 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp

llvm-svn: 159886
2012-07-07 02:48:02 +00:00
Sean Callanan a0d17365ab On i386 we see occasional crashes when the register
context is not returning valid registers yet.  Don't
crash in these situations.

<rdar://problem/11650335>

llvm-svn: 159885
2012-07-07 01:38:30 +00:00
Greg Clayton 7820bd1e52 <rdar://problem/11357711>
Fixed a crasher where the section load list was not thread safe.

llvm-svn: 159884
2012-07-07 01:24:12 +00:00
Greg Clayton 9407302d37 Make const result value objects able to return dynamic types.
Modified the heap.py to be able to correctly indentify the exact ivar for the "ptr_refs" command no matter how deep the ivar is in a class hierarchy. Also fixed the ability for the heap command to symbolicate the stack backtrace when MallocStackLogging is set in the environment and the "--stack" option was specified.

llvm-svn: 159883
2012-07-07 01:22:45 +00:00
Sean Callanan 3b18fbd983 Fixed a crasher that happens if we try to inspect
a NULL symbol file.

<rdar://problem/11795939>

llvm-svn: 159882
2012-07-07 01:07:33 +00:00
Bill Wendling 786de35fa0 Use the DebugInfo wrappers instead of mucking about with the MDNode directly.
llvm-svn: 159881
2012-07-07 00:52:35 +00:00
Sean Callanan 210b815f9d Fixed a crash in the class uniq'ing code where we
didn't check if the two classes had the same number
of members.

<rdar://problem/11678873>

llvm-svn: 159880
2012-07-07 00:29:33 +00:00
Bill Wendling 56543735c9 Print the name last.
llvm-svn: 159879
2012-07-06 23:43:12 +00:00
Dmitri Gribenko 44cd7e6746 Restrict the set of declaration kinds for which we allow trailing comments.
llvm-svn: 159878
2012-07-06 23:27:33 +00:00
Chad Rosier 73b02825d0 Fix the naming of ensureAlignment. Per the coding standard function names
should be camel case, and start with a lower case letter.

llvm-svn: 159877
2012-07-06 23:13:38 +00:00
Nuno Lopes fa0dffccee teach instcombine to remove allocated buffers even if there are stores, memcpy/memmove/memset, and objectsize users.
This means we can do cheap DSE for heap memory.
Nothing is done if the pointer excapes or has a load.

The churn in the tests is mostly due to objectsize, since we want to make sure we
don't delete the malloc call before evaluating the objectsize (otherwise it becomes -1/0)

llvm-svn: 159876
2012-07-06 23:09:25 +00:00
Ted Kremenek 9877f689f2 Implement -Wpedantic and --no-pedantic to complement -Weverything.
This patch introduces some magic in tablegen to create a "Pedantic" diagnostic
group which automagically includes all warnings that are extensions.  This
allows a user to suppress specific warnings traditionally under -pedantic used
an ordinary warning flag.  This also allows users to use #pragma to silence
specific -pedantic warnings, or promote them to errors, within blocks of text
(just like any other warning).

-Wpedantic is NOT an alias for -pedantic.  Instead, it provides another way
to (a) activate -pedantic warnings and (b) disable them.  Where they differ
is that -pedantic changes the behavior of the preprocessor slightly, whereas
-Wpedantic does not (it just turns on the warnings).

The magic in the tablegen diagnostic emitter has to do with computing the minimal
set of diagnostic groups and diagnostics that should go into -Wpedantic, as those
diagnostics that already members of groups that themselves are (transitively) members
of -Wpedantic do not need to be included in the Pedantic group directly.  I went
back and forth on whether or not to magically generate this group, and the invariant
was that we always wanted extension warnings to be included in -Wpedantic "some how",
but the bookkeeping would be very onerous to manage by hand.

-no-pedantic (and --no-pedantic) is included for completeness, and matches many of the
same kind of flags the compiler already supports.  It does what it says: cancels out
-pedantic.  One discrepancy is that if one specifies --no-pedantic and -Weverything or
-Wpedantic the pedantic warnings are still enabled (essentially the -W flags win).  We
can debate the correct behavior here.

Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp
that determine whether to include the "-pedantic" flag in the warning output.  This is
no longer needed, as all extensions now have a -W flag.

This patch also significantly reduces the number of warnings not under flags from 229
to 158 (all extension warnings).  That's a 31% reduction.

llvm-svn: 159875
2012-07-06 23:07:31 +00:00
Dmitri Gribenko d01af8772d Since SmallMap was removed in r158644, remove documentation in ProgrammersManual.html.
llvm-svn: 159874
2012-07-06 23:06:47 +00:00
Bill Wendling 3270582ceb Check if it's a scope last, because several things are scopes.
llvm-svn: 159873
2012-07-06 23:06:16 +00:00
Jordan Rose 183096d0c4 [analyzer] Fix mis-committed test. No functionality change.
llvm-svn: 159869
2012-07-06 22:10:39 +00:00
Jordan Rose 1e0719ef6f Constify the argument to SourceLocation::getFromPtrEncoding.
This allows SourceLocations to be stored in generic "data" fields
that are typed as "const void *" and are also used to point to
const objects.

Really we should probably be returning a const pointer from
getPtrEncoding as well, but in some places we want to store
SourceLocations in the same generic "data" field as proper
pointers to /mutable/ objects. Oh well.

llvm-svn: 159868
2012-07-06 22:00:04 +00:00
Jordan Rose 5df10aa540 [analyzer] Add comments to Calls.h.
No functionality change.

llvm-svn: 159867
2012-07-06 22:00:01 +00:00
Jordan Rose 3f89e0ec93 [analyzer] Be careful about LazyCompoundVals, which may be for the first field.
We use LazyCompoundVals to avoid copying the contents of structs and arrays
around in the store, and when we need to pass a struct around that already
has a LazyCompoundVal we just use the original one. However, it's possible
that the first field of a struct may have a LazyCompoundVal of its own, and
we currently can't distinguish a LazyCompoundVal for the first element of a
struct from a LazyCompoundVal for the entire struct. In this case we should
just drop the optimization and make a new LazyCompoundVal that encompasses
the old one.

PR13264 / <rdar://problem/11802440>

llvm-svn: 159866
2012-07-06 21:59:56 +00:00
Howard Hinnant 8a9ee14803 Apply noexcept to tuple.
llvm-svn: 159865
2012-07-06 21:53:48 +00:00
Jim Grosbach 09487775d3 ARM: Add test cleanup entry to the README.
llvm-svn: 159864
2012-07-06 21:52:04 +00:00
Matt Beaumont-Gay 4106ea3b4e Sprinkle llvm_unreachable around to placate GCC's -Wreturn-type.
llvm-svn: 159860
2012-07-06 21:13:09 +00:00
Fariborz Jahanian dabd133186 objc-arc: warn when assigning retained object to
a 'weak' property just as we do the same for
'weak' variables. // rdar://11814185

llvm-svn: 159859
2012-07-06 21:09:27 +00:00
Howard Hinnant a0f4c45c38 As a conforming extension give tuple a noexcept default constructor conditionalized on its held types.
llvm-svn: 159858
2012-07-06 20:50:27 +00:00
Howard Hinnant a62ebe043e Give tuple a constexpr default constructor.
llvm-svn: 159857
2012-07-06 20:39:45 +00:00
Dmitry Vyukov 239ae7186b tsan: Go language support fixes
llvm-svn: 159856
2012-07-06 20:23:59 +00:00
Akira Hatanaka b577ff116d revert r159851.
llvm-svn: 159854
2012-07-06 20:16:48 +00:00
Howard Hinnant 9f06558f86 New Windows libc++ test results provided by Ruben Van Boxem.
llvm-svn: 159852
2012-07-06 19:35:31 +00:00
Akira Hatanaka cfa35fa0ff Reapply r158846.
Include file MipsGenRegisterInfo.inc.

llvm-svn: 159851
2012-07-06 19:29:11 +00:00
Howard Hinnant 9d6d1c6860 Apply noexcept to those functions implemented in <cstdlib> as a conforming extension.
llvm-svn: 159850
2012-07-06 19:16:56 +00:00
Howard Hinnant 9c14b75a37 Apply noexcept to those functions implemented in <cmath> as a conforming extension.
llvm-svn: 159849
2012-07-06 19:13:50 +00:00
Bill Wendling aa02e36fa8 Add a print method to the ObjC property object.
llvm-svn: 159848
2012-07-06 19:12:31 +00:00
Fariborz Jahanian 0021347926 objective-c++11: extend c++11 range-based loop to iterate
over objective-c container collection. // rdar://9293227

llvm-svn: 159847
2012-07-06 19:04:04 +00:00
Howard Hinnant 227001d12e Add noexcept test for offsetof macro per [support.types]/p4.
llvm-svn: 159846
2012-07-06 18:39:01 +00:00
Dmitri Gribenko 7dd29d4d3d Don't store pointers into a std::vector (RawCommentList::Comments). Although
currently we take address of std::vector's contents only after we finished
adding all comments (so no reallocation can happen), this will change in
future.

llvm-svn: 159845
2012-07-06 18:19:34 +00:00
Greg Clayton a98fde5d70 <rdar://problem/11819635>
llvm-svn: 159844
2012-07-06 17:58:01 +00:00
Bill Wendling 5ef3159820 Remove trailing comma in array initialization list.
llvm-svn: 159843
2012-07-06 17:49:19 +00:00
Bill Wendling 7154c43eff Remove unnecessary 'llvm::'.
llvm-svn: 159842
2012-07-06 17:47:36 +00:00
Bill Wendling 16d944ce11 Remove unnecessary 'llvm::'.
llvm-svn: 159841
2012-07-06 17:46:28 +00:00