Commit Graph

99892 Commits

Author SHA1 Message Date
Nick Lewycky 82d4db8662 Teach mergefunc that intptr_t is the same width as a pointer. We still can't
merge vector<intptr_t>::push_back() and vector<void*>::push_back() because
Enumerate() doesn't realize that "i64* null" and "i8** null" are equivalent.

llvm-svn: 124285
2011-01-26 09:13:58 +00:00
Nick Lewycky fb622f9920 There are no vectors of pointer or arrays, so we don't need to check vector
elements for type equivalence.

llvm-svn: 124284
2011-01-26 08:50:18 +00:00
Duncan Sands 8a33733228 APInt has a method for determining whether a number is a power of 2
which is more efficient than countPopulation - use it.

llvm-svn: 124283
2011-01-26 08:44:16 +00:00
Nick Lewycky d9e6b4a8ff Fix memory corruption. If one of the SCEV creation functions calls another but
doesn't return immediately after then the insert position in UniqueSCEVs will
be out of date. No test because this is a memory corruption issue. Fixes PR9051!

llvm-svn: 124282
2011-01-26 08:40:22 +00:00
Douglas Gregor db9d664244 Rvalue references for *this:
- Add ref-qualifiers to the type system; they are part of the
  canonical type. Print & profile ref-qualifiers
  - Translate the ref-qualifier from the Declarator chunk for
    functions to the function type. 
  - Diagnose mis-uses of ref-qualifiers w.r.t. static member
  functions, free functions, constructors, destructors, etc.
  - Add serialization and deserialization of ref-qualifiers.

llvm-svn: 124281
2011-01-26 05:01:58 +00:00
Ted Kremenek 5d068499a7 Teach -Wreturn-type that destructors can appear
after a 'return' in a CFGBlock.  This accidentally
was working before, but the false assumption that
'return' always appeared at the end of the block
was uncovered by a recent change.

llvm-svn: 124280
2011-01-26 04:49:52 +00:00
Ted Kremenek e543be3531 Merge -Wuninitialized-experimental into -Wuninitialized.
llvm-svn: 124279
2011-01-26 04:49:48 +00:00
Ted Kremenek 33ddd9692d Tweak -Wuninitialized-experimental to not emit
a warning for uses of an uninitialized variable
when the use is a void cast, e.g. (void) x.

llvm-svn: 124278
2011-01-26 04:49:43 +00:00
John McCall ce1de6172c Better framework for conditional cleanups; untested as yet.
I'm separately committing this because it incidentally changes some
block orderings and minor IR issues, like using a phi instead of
an unnecessary alloca.

llvm-svn: 124277
2011-01-26 04:00:11 +00:00
Douglas Gregor 5499235d13 Rvalue references for *this: parse ref-qualifiers.
llvm-svn: 124276
2011-01-26 03:43:54 +00:00
Eric Christopher 078159e310 Separate out the constant bonus from the size reduction metrics. Rework
a few loops accordingly. Should be no functional change.

This is a step for more accurate cost/benefit analysis of devirt/inlining
bonuses.

llvm-svn: 124275
2011-01-26 02:58:39 +00:00
Ken Dyck 02155cb8e8 Use RecordLayout::getBaseClassOffset() where CharUnits are needed instead of
converting getBaseClassOffsetInBits() to CharUnits.

llvm-svn: 124274
2011-01-26 02:17:08 +00:00
Bill Wendling d13d13496f Add needed braces.
llvm-svn: 124273
2011-01-26 02:06:22 +00:00
NAKAMURA Takumi 0cfdac078e Target/X86: Tweak win64's tailcall.
llvm-svn: 124272
2011-01-26 02:04:09 +00:00
NAKAMURA Takumi 31aafbd501 TableGen: PointerLikeRegClass can be accepted to operand.
llvm-svn: 124271
2011-01-26 02:03:48 +00:00
NAKAMURA Takumi 9d29eff198 Fix whitespace.
llvm-svn: 124270
2011-01-26 02:03:37 +00:00
NAKAMURA Takumi c780782560 lib/Target/X86/X86RegisterInfo.cpp: Fix whitespace.
llvm-svn: 124268
2011-01-26 01:28:06 +00:00
NAKAMURA Takumi 86278dc3ea lib/Target/X86/X86RegisterInfo.cpp: Fix a typo in comment.
llvm-svn: 124267
2011-01-26 01:27:58 +00:00
Argyrios Kyrtzidis c7ffd35cb7 [analyzer] Enable the self-init checker under command-line option '-analyzer-check-objc-self-init' which by default
is enabled by the driver for '--analyze'.

llvm-svn: 124266
2011-01-26 01:26:50 +00:00
Argyrios Kyrtzidis 7e71884ecb Correct r124242 making sure function chunk that gets diagnosed is really about the block.
Clairvoyance by John!

llvm-svn: 124264
2011-01-26 01:26:44 +00:00
Argyrios Kyrtzidis 8781b7dded [analyzer] Improve the diagnostic for the self-init checker. Suggestion by Ted!
llvm-svn: 124263
2011-01-26 01:26:41 +00:00
Johnny Chen f6aaf31103 Remove duplicated comments.
llvm-svn: 124262
2011-01-26 01:24:45 +00:00
Johnny Chen 832d3137df Move #define's out of ARMUtils.h and into a newly created file ARMDefines.h.
llvm-svn: 124261
2011-01-26 01:18:52 +00:00
Eric Christopher 58f157a677 Coding style formatting changes.
llvm-svn: 124260
2011-01-26 01:09:59 +00:00
Johnny Chen 74889b29a8 Move the generic instruction bits manipulation routines into a newly created file
named InstructionUtils.h and modify some existing code to use them.

llvm-svn: 124259
2011-01-26 01:00:55 +00:00
Fariborz Jahanian 9312fcc2d3 Tweak the rule for deciding if a provisional ivar is needed
in default ivar synthesis.  Fixes // rdar://8913053.

llvm-svn: 124258
2011-01-26 00:57:01 +00:00
Jakob Stoklund Olesen b308902024 Rename member variables to follow the rest of LLVM.
No functional change.

llvm-svn: 124257
2011-01-26 00:50:53 +00:00
Jeffrey Yasskin d5642d0bcd Remove CompilerInstance::getOutputFileList because it is unimplemented and unused.
llvm-svn: 124256
2011-01-26 00:18:08 +00:00
Douglas Gregor d18302f1bb Teach move_iterator that rvalue references cannot bind to non-function
lvalues, nor can one take the address of an xvalue, by adding
appropriate static_cast's (in the first case) and a temporary (in the
second case).

llvm-svn: 124255
2011-01-26 00:12:48 +00:00
Johnny Chen 3fde51b820 Add Encoding T1 entry of emulate_sub_sp_imm to the g_thumb_opcodes table.
Update emulate_sub_sp_imm to handle Encoding T1.

llvm-svn: 124253
2011-01-26 00:08:59 +00:00
Howard Hinnant ad16003517 Add always_inline to string move constructors
llvm-svn: 124252
2011-01-26 00:06:59 +00:00
Greg Clayton 9ac6c5e2d4 Removed unused directory.
llvm-svn: 124251
2011-01-25 23:58:39 +00:00
Greg Clayton 1a65ae11bd Enabled extra warnings and fixed a bunch of small issues.
llvm-svn: 124250
2011-01-25 23:55:37 +00:00
Argyrios Kyrtzidis 3ae681eb12 [analyzer] Do the self-init check only on NSObject subclasses. Patch by Jean-Daniel Dupas!
llvm-svn: 124249
2011-01-25 23:54:44 +00:00
Johnny Chen d5cd645c74 Add Encoding T2 & T3 entries of emulate_sub_sp_imm to the g_thumb_opcodes table.
Update emulate_sub_sp_imm to handle Encoding T2 & T3.

llvm-svn: 124248
2011-01-25 23:49:39 +00:00
Douglas Gregor 41e4e2c798 Speculatively revert r124236
llvm-svn: 124247
2011-01-25 23:49:36 +00:00
Devang Patel efc6b16e4b Provide an interface to transfer SDDbgValue from one SDNode to another.
llvm-svn: 124245
2011-01-25 23:27:42 +00:00
Argyrios Kyrtzidis 4e52cc7de4 Diagnose calling convention attribute incompatibilities. Fixes rdar://8876096.
llvm-svn: 124244
2011-01-25 23:16:40 +00:00
Argyrios Kyrtzidis cd81fe033c Fix infinite loop during error diagnostics. Fixes rdar://8875304.
llvm-svn: 124243
2011-01-25 23:16:36 +00:00
Argyrios Kyrtzidis 20ad245e3e Change error "function cannot return array type" -> "blocks cannot return array type" when blocks are involved.
Addresses rdar://8876238.

llvm-svn: 124242
2011-01-25 23:16:33 +00:00
Douglas Gregor 175a104028 Remove an (incorrect) compiler workaround in the __mu function. The
workaround relied on rvalue references binding to non-function
lvalues, while the original formulation (with std::forward) does the
right thing.

llvm-svn: 124241
2011-01-25 23:11:15 +00:00
Stephen Wilson f3e78a3040 Simple makefile fixups.
With the current target revision of Clang libclangChecker no longer exists and
is not needed.  Update the include path so we can get at ARM_DWARF_Registers.h
and friends.

llvm-svn: 124240
2011-01-25 23:03:42 +00:00
Ted Kremenek 4fd3fda33b Tweak return-noreturn.cpp test to have its original
contents, with the additional warning flag (and still marked XFAIL).

llvm-svn: 124239
2011-01-25 22:57:41 +00:00
Ted Kremenek ebe6260137 Fix regression in -Wreturn-type caused by not
handling all CFGElement kinds.  While writing
the test case, it turned out that return-noreturn.cpp
wasn't actually testing anything since it has the wrong -W
flag.  That uncovered another regression with
the handling of destructors marked noreturn.  WIP.

llvm-svn: 124238
2011-01-25 22:50:47 +00:00
Johnny Chen ccc9963e34 Add an entry to the g_arm_opcodes table named emulate_sub_sp_imm which corresponds
to an operation to adjust the stack pointer (allocate space for local storage).

llvm-svn: 124237
2011-01-25 22:45:28 +00:00
Douglas Gregor 407371a1e4 Speculatively implement a tweak to the C++0x overload resolution rules
for reference binding (C++ [over.rank.ics]p3b1sb4), so that we prefer
the binding of an lvalue reference to a function lvalue over the
binding of an rvalue reference. This change resolves the ambiguity
with std::forward and lvalue references to function types in a way
that seems consistent with the original rvalue references proposal.

My proposed wording for this change is shown in
isBetterReferenceBindingKind(); we'll try to get this change adopted
in the C++0x working paper as well.

llvm-svn: 124236
2011-01-25 22:19:32 +00:00
Ted Kremenek 7e1ec9ccd8 Unbreak CMake build.
llvm-svn: 124235
2011-01-25 22:10:37 +00:00
David Greene 78221d4679 [AVX] Fix a typo in the extract subvector type constraints to specify
the correct number of operands.

llvm-svn: 124234
2011-01-25 22:05:41 +00:00
Bill Wendling 57990c4910 Revert 124230. It was causing test failures.
llvm-svn: 124233
2011-01-25 21:48:36 +00:00
Greg Clayton 1ea20bf6ed http://llvm.org/bugs/show_bug.cgi?id=8260
Removed incorrect enumeration from switch.

llvm-svn: 124232
2011-01-25 21:39:46 +00:00