Commit Graph

101043 Commits

Author SHA1 Message Date
Oscar Fuentes 79b52bfc46 CMake: updated source file list.
llvm-svn: 125783
2011-02-17 22:07:39 +00:00
Johnny Chen fc5c19dec5 A8.6.6 ADD (register)
Renamed EmulateAddRdnRm() to EmulateAddReg(), and added Encoding T1 to it.
Where Encoding T2 can potentially modify the PC, causing a brnach.

llvm-svn: 125782
2011-02-17 22:03:29 +00:00
Ted Kremenek 48d9626055 Add -Warray-bounds test showing how the warning currently interoperates with macros.
llvm-svn: 125781
2011-02-17 21:40:51 +00:00
Argyrios Kyrtzidis 57d736fd46 [analyzer] Use the new registration mechanism for the debugging info "checks".
The relative checker package is 'debug':

'-dump-live-variables' is replaced by '-analyzer-checker=debug.DumpLiveVars'
'-cfg-view' is replaced by '-analyzer-checker=debug.ViewCFG'
'-cfg-dump' is replaced by '-analyzer-checker=debug.DumpCFG'

llvm-svn: 125780
2011-02-17 21:39:39 +00:00
Argyrios Kyrtzidis af45aca670 [analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:
DeadStoresChecker
  ObjCMethSigsChecker
  ObjCUnusedIvarsChecker
  SizeofPointerChecker
  ObjCDeallocChecker
  SecuritySyntaxChecker

llvm-svn: 125779
2011-02-17 21:39:33 +00:00
Argyrios Kyrtzidis 24ffc08f39 [analyzer]
-Introduce CheckerV2, a set of templates for convenient declaration & registration of checkers.
 Currently useful just for checkers working on the AST not the path-sensitive ones.
-Enhance CheckerManager to actually collect the checkers and turn it into the entry point for
 running the checkers.
-Use the new mechanism for the LLVMConventionsChecker.

llvm-svn: 125778
2011-02-17 21:39:24 +00:00
Argyrios Kyrtzidis 507ff53e39 [analyzer] Pass CheckerManager to the registration functions.
llvm-svn: 125777
2011-02-17 21:39:17 +00:00
Nadav Rotem 7cc6d12ad0 Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.

llvm-svn: 125776
2011-02-17 21:22:27 +00:00
Chandler Carruth 1af88f12a3 Enhance the array bounds checking to work for several other constructs,
especially C++ code, and generally expand the test coverage.

Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and
another Googler.

llvm-svn: 125775
2011-02-17 21:10:52 +00:00
Chris Lattner d406764d52 add is always integer, thanks to Frits for noticing this.
llvm-svn: 125774
2011-02-17 20:55:29 +00:00
Chandler Carruth 2a666fc2c7 Clean up the style of this function to match the conventions in the rest
of Clang, and reflows the code a bit to make it easier to read.

llvm-svn: 125773
2011-02-17 20:55:08 +00:00
Chris Lattner d28cc8113b add a fixme
llvm-svn: 125772
2011-02-17 20:54:00 +00:00
Chris Lattner cab02a60d2 Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and 
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.

llvm-svn: 125771
2011-02-17 20:34:02 +00:00
Chris Lattner 50c3c1316a Inline LocalInstantiationScope::getInstantiationOf into its one
client, making room for future hacking.

llvm-svn: 125770
2011-02-17 19:47:42 +00:00
Chris Lattner 15a776fff7 remove some defensive code: LocalInstantiationScope::getInstantiationOf
and findInstantiationOf can never return null, even on invalid code.

llvm-svn: 125769
2011-02-17 19:38:27 +00:00
Chris Lattner bdc1a42aef remove some dead overloads.
llvm-svn: 125768
2011-02-17 19:37:28 +00:00
Johnny Chen 2789706059 Add EmulateTB() method to emulate "Table Branch Byte" and "Table Branch Halfword"
operations for Thumb2.

llvm-svn: 125767
2011-02-17 19:34:27 +00:00
Caroline Tice 032d2dd576 Add stubs for pseudocode functions "MemA[]" amd "MemU[]", corresponding to aligned
and unaligned memory accesses.  The new stub functions are MemARead, MemAWrite,
MemURead, and MemUWrite.  At the moment these stubs just call ReadMemoryUnsigned or
WriteMemoryUnsigned, but we can fill them out further later if we decide we need
more accurate emulation of the memory system.

Replaced all the direct calls to ReadMemoryUnsigned and WriteMemoryUnsigned in
EmulateInstructionARM.cpp with calls to the appropriate new stub function.

llvm-svn: 125766
2011-02-17 19:20:40 +00:00
David Greene 3a2b508e8f [AVX] Recorganize X86ShuffleDecode into its own library
(LLVMX86Utils.a) to break cyclic library dependencies between
LLVMX86CodeGen.a and LLVMX86AsmParser.a.  Previously this code was in
a header file and marked static but AVX requires some additional
functionality here that won't be used by all clients.  Since including
unused static functions causes a gcc compiler warning, keeping it as a
header would break builds that use -Werror.  Putting this in its own
library solves both problems at once.

llvm-svn: 125765
2011-02-17 19:18:59 +00:00
Jakob Stoklund Olesen 93c8736abb Split local live ranges.
A local live range is live in a single basic block. If such a range fails to
allocate, try to find a sub-range that would get a larger spill weight than its
interference.

llvm-svn: 125764
2011-02-17 19:13:53 +00:00
Douglas Gregor d6f8124c9c Eliminate the internal command-line option for viewing inheritance in C++ classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful
llvm-svn: 125762
2011-02-17 19:04:40 +00:00
John McCall e6be5e1c0d Remove the "conditional save" hashtables from IR generation.
llvm-svn: 125761
2011-02-17 19:02:56 +00:00
Douglas Gregor 428d75ffd9 The internal -fdump-record-layouts flag already dumps the layout when it was computed; no need to do so again at the end of the translation unit
llvm-svn: 125760
2011-02-17 18:59:06 +00:00
Dan Gohman f0f8e14370 The labyrinthine X86 backend no longer appears to require
these patterns.

llvm-svn: 125759
2011-02-17 18:50:19 +00:00
Argyrios Kyrtzidis 9d5235d527 When building StaticAnalyzer/Frontend add -I "<Checkers build dir>" to allow Checkers.inc to be
included without '..', thus being compatible with build systems of *BSDs.

Patch by Joerg Sonnenberger!

llvm-svn: 125758
2011-02-17 18:40:33 +00:00
Douglas Gregor 65f57fe6ea Replace a FIXME with a comment describing why we did what we did
llvm-svn: 125757
2011-02-17 18:32:37 +00:00
Douglas Gregor e5de7013c7 Remove the last virtual member function from the Decl hierarchy,
reducing the size of all declarations by one pointer. For a 64-bit
Clang parsing Cocoa.h, this saves ~630k of memory (about 3.5% of
ASTContext's memory usage for this header).

llvm-svn: 125756
2011-02-17 18:14:32 +00:00
Douglas Gregor b494173c93 Devirtualize TagDecl::completeDefinition().
llvm-svn: 125755
2011-02-17 18:06:05 +00:00
Douglas Gregor fe590dfa84 Devirtualize DeclaratorDecl::getInnerLocStart() and TagDecl::getInnerLocStart().
llvm-svn: 125754
2011-02-17 17:39:40 +00:00
Johnny Chen 0f60574fd7 Move Align(val, alignment) utility function to ARMUtils.h.
llvm-svn: 125753
2011-02-17 17:31:08 +00:00
Fariborz Jahanian 5fc74804a6 Improve diagnostics on missing property decl.
llvm-svn: 125752
2011-02-17 17:30:05 +00:00
Douglas Gregor a991f3a4e9 Devirtualize NamedDecl::getNameForDiagnostic().
llvm-svn: 125751
2011-02-17 17:23:19 +00:00
Douglas Gregor 0215459c37 Devirtualize RedeclarableTemplateDecl::newCommon().
llvm-svn: 125750
2011-02-17 17:10:20 +00:00
Duncan Sands c6196aa481 Fix wrong logic in promotion of signed mul-with-overflow (I pointed this out at
the time but presumably my email got lost).  Examples where the previous logic
got it wrong: (1) a signed i8 multiply of 64 by 2 overflows, but the high part is
zero; (2) a signed i8 multiple of -128 by 2 overflows, but the high part is all
ones. 

llvm-svn: 125748
2011-02-17 12:42:48 +00:00
NAKAMURA Takumi 4c14a5cc2c Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

llvm-svn: 125747
2011-02-17 12:24:17 +00:00
NAKAMURA Takumi 0544fe7287 Fix whitespace.
llvm-svn: 125746
2011-02-17 12:23:50 +00:00
Chandler Carruth 22c7a79a1d Implement a sub-group of -Wconversion: -Wliteral-conversion. This
specifically targets literals which are implicitly converted, a those
are more often unintended and trivial to fix. This can be especially
helpful for diagnosing what makes 'const int x = 1e6' not an ICE.

Original patch authored by Jim Meehan with contributions from other
Googlers and a few cleanups from myself.

llvm-svn: 125745
2011-02-17 11:05:49 +00:00
John McCall c07a0c7e48 Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr.  This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait;  or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here.  In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some          
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.

llvm-svn: 125744
2011-02-17 10:25:35 +00:00
NAKAMURA Takumi 49ddc3646f lib/Frontend/InitHeaderSearch.cpp: Add mingw-w64's include paths.
llvm-svn: 125743
2011-02-17 08:51:47 +00:00
NAKAMURA Takumi 31ea2f14bc Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.

llvm-svn: 125742
2011-02-17 08:51:38 +00:00
NAKAMURA Takumi 029d74b264 Fix whitespace.
llvm-svn: 125741
2011-02-17 08:50:50 +00:00
Douglas Gregor 133edddd82 Devirtualize Decl::getNextRedeclaration().
llvm-svn: 125740
2011-02-17 08:47:29 +00:00
Chandler Carruth 712563bba4 Implement -Wenum-compare, which warns when comparing two enums of
different types. We omit the warning when the enum types are anonymous.
Unlike GCC, this warning does not distinguish between C++ and C/ObjC for
controling whether it is on by default, it is always on by default.

Original patch contributed by Richard Trieu (@ Google), I fixed some
style issues, and cleaned it up for submission.

llvm-svn: 125739
2011-02-17 08:37:06 +00:00
Duncan Sands 491eb276a7 This has been implemented.
llvm-svn: 125738
2011-02-17 08:16:56 +00:00
Douglas Gregor 5ee06f02f9 Simple little optimization to Decl::getCanonicalDecl(), eliminating some heavyweight machinery and indirection that we don't need
llvm-svn: 125737
2011-02-17 08:14:56 +00:00
Douglas Gregor 00716e8bd3 Devirtualize Decl::getSourceRange()
llvm-svn: 125736
2011-02-17 08:12:32 +00:00
Douglas Gregor 7edc20ac24 Devirtualize Decl::getCanonicalDecl().
llvm-svn: 125735
2011-02-17 07:58:36 +00:00
Duncan Sands e522001171 Transform "A + B >= A + C" into "B >= C" if the adds do not wrap. Likewise for some
variations (some of these were already present so I unified the code).  Spotted by my
auto-simplifier as occurring a lot.

llvm-svn: 125734
2011-02-17 07:46:37 +00:00
Chris Lattner c8e630e4db Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt.  There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself.  This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.

llvm-svn: 125733
2011-02-17 07:39:24 +00:00
Douglas Gregor f7b2c93b2f Devirtualize Decl::getBody() and Decl::hasBody().
llvm-svn: 125731
2011-02-17 07:13:24 +00:00