Commit Graph

57561 Commits

Author SHA1 Message Date
Anders Carlsson 43168129d0 Add Expr::EvaluateAsLValue which will (believe it or not) try to evaluate an Expr as an LValue.
llvm-svn: 68763
2009-04-10 04:54:13 +00:00
Anders Carlsson 0e6d2b3a70 Fix thinko noticed by Chris.
llvm-svn: 68762
2009-04-10 04:52:36 +00:00
Anders Carlsson 9b5038ed64 Use the same alignment for reference declarations as for pointer declarations.
llvm-svn: 68761
2009-04-10 04:47:03 +00:00
Chris Lattner 7671c45108 fix indentation
llvm-svn: 68760
2009-04-10 04:42:25 +00:00
Ted Kremenek b3b2395520 Split failing test case from misc-ps.m to misc-ps-ranges.m (which tests
functionality specific to RangeConstraintManager).

llvm-svn: 68759
2009-04-10 04:02:38 +00:00
Douglas Gregor a7f71a91c5 PCH serialization/deserialization of the source manager. With this
improvement, source locations read from the PCH file will properly
resolve to the source files that were used to build the PCH file
itself.

Once we have the preprocessor state stored in the PCH file, source
locations that refer to macro instantiations that occur in the PCH
file should have the appropriate instantiation information.

llvm-svn: 68758
2009-04-10 03:52:48 +00:00
Ted Kremenek 5054663daa Fix: <rdar://problem/6776949> Branch condition evaluates to an uninitialized value (argc is guaranteed to be >= 1)
The analyzer now adds the precondition that the first argument of 'main' is > 0.

llvm-svn: 68757
2009-04-10 00:59:50 +00:00
Chris Lattner 6bc4aaa2eb Make messages consistent.
llvm-svn: 68756
2009-04-10 00:37:08 +00:00
Chris Lattner 5286e774ee reject codegen of __thread variables as unimplemented, rdar://6775265
llvm-svn: 68755
2009-04-10 00:35:59 +00:00
Chris Lattner 428f71623b a few fixes to "addrspace(256) is reference offset of GS segment register".
It turns out that there are still several problems with this, will file a bugzilla.

llvm-svn: 68749
2009-04-10 00:16:23 +00:00
Bill Wendling 992f846dc7 Pass in the std::string parameter instead of returning it by value.
llvm-svn: 68747
2009-04-10 00:12:49 +00:00
Ted Kremenek 40f4ee74fd Implement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allows
clients of the analyzer to designate custom assertion routines as "noreturn"
functions from the analyzer's perspective but not the compiler's.

llvm-svn: 68746
2009-04-10 00:01:14 +00:00
Bill Wendling fe56c25065 Constify getter methods.
llvm-svn: 68745
2009-04-10 00:00:25 +00:00
Dan Gohman de912e2475 Remove the obsolete SelectionDAG::getNodeValueTypes and simplify
code that uses it by using SelectionDAG::getVTList instead.

llvm-svn: 68744
2009-04-09 23:54:40 +00:00
Dan Gohman 4c56c1c736 Change the NumVTs field from short to int, since there's no
real need for it to be short.

llvm-svn: 68742
2009-04-09 23:53:31 +00:00
Bill Wendling 16abfc97fb StringMap<DIE*>::iterator::first() returns a pointer to the first character of
the key. This will cause it to create a new std::string, which isn't
wanted. Instead, pass back the "const char*". Modify the EmitString() method to
take a "const char*".

llvm-svn: 68741
2009-04-09 23:51:31 +00:00
Devang Patel a68bdef482 Silence unused variable warning.
llvm-svn: 68735
2009-04-09 23:45:17 +00:00
Chris Lattner 66ab904f5a ignore register zero in isRegTiedToUseOperand, following the example of
isRegTiedToDefOperand.  Thanks to Bob for pointing this out!

llvm-svn: 68734
2009-04-09 23:33:34 +00:00
Douglas Gregor ef84c4b434 Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.

llvm-svn: 68732
2009-04-09 22:27:44 +00:00
Ted Kremenek f2489ea043 - Move ownership of MemRegionManager into ValueManager.
- Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly
simplifies the calling interface to clients.

llvm-svn: 68731
2009-04-09 22:22:44 +00:00
Owen Anderson 5eb8d26f19 Give register alias checking the hash table treatment too.
llvm-svn: 68730
2009-04-09 22:19:30 +00:00
Anders Carlsson 39b2e130f0 Add @encode support for complex types.
llvm-svn: 68729
2009-04-09 21:55:45 +00:00
Bill Wendling e65fd1a302 Use a StringMap instead of std::map for storing std::string->DIE* maps. This
gives a micro speedup in the Dwarf writer.

llvm-svn: 68728
2009-04-09 21:49:15 +00:00
Devang Patel a2c2b85df4 llvm.dbg.func_start also defines beginning of function scope.
llvm-svn: 68727
2009-04-09 21:42:11 +00:00
Douglas Gregor bcced4ec31 Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).

llvm-svn: 68726
2009-04-09 21:40:53 +00:00
Eli Friedman 32e6e8ed3b Add some FIXMEs for missing checks.
llvm-svn: 68725
2009-04-09 21:26:42 +00:00
Chris Lattner c86ffc3583 document the x86 address space extension for GS.
llvm-svn: 68724
2009-04-09 19:58:15 +00:00
Bill Wendling f704f90f6e Revert r68708. It was causing this failure in the self-hosting buildbot:
llvm[2]: Compiling lto.cpp for Debug build  (PIC)
make[2]: *** No rule to make target `/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Debug/lib/libLLVMBitWriter.a', needed by `/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/lib/libLTO.dylib'.  Stop.
make[1]: *** [all] Error 1
make: *** [all] Error 1

llvm-svn: 68721
2009-04-09 18:26:57 +00:00
Ted Kremenek 11e13fae69 Fix grammar. Bold face feature points.
llvm-svn: 68720
2009-04-09 18:22:40 +00:00
Ted Kremenek 4adfee4ff7 More cleanup.
llvm-svn: 68719
2009-04-09 18:20:08 +00:00
Ted Kremenek 8918025272 More cleanups.
llvm-svn: 68718
2009-04-09 18:17:39 +00:00
Ted Kremenek df0d9070b8 Add link from internals manual to PTH documentation.
llvm-svn: 68717
2009-04-09 18:08:18 +00:00
Ted Kremenek 6b27a811c6 Minor cleanups. Added a blurb about the advantages of fast PTH file generation.
llvm-svn: 68716
2009-04-09 18:03:21 +00:00
Douglas Gregor 9615ec20a2 Simple DeclContext's internal representation by always storing a
StoredDeclsMap, instead of using the it's-an-array-or-its-a-map
trick. I'll verify that performance isn't impacted later; for now, I
need the common representation.

llvm-svn: 68715
2009-04-09 17:29:08 +00:00
Bob Wilson 51856173c8 Fix pr3954. The register scavenger asserts for inline assembly with
register destinations that are tied to source operands.  The
TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
assembly.  The existing MachineInstr::isRegReDefinedByTwoAddr was very
close to doing what is needed, so this revision makes a few changes to
that method and also renames it to isRegTiedToUseOperand (for consistency
with the very similar isRegTiedToDefOperand and because it handles both
two-address instructions and inline assembly with tied registers).

llvm-svn: 68714
2009-04-09 17:16:43 +00:00
Sanjiv Gupta 38533d48dd The way we are trying to figure out banksel immediate operand may yield different results for different type of insns. This will eventually need to be changed but currently let us prevent the crash in cases of incorrect detection of banksel operand.
llvm-svn: 68713
2009-04-09 17:06:24 +00:00
Chris Lattner a725028d41 reg0 references are not real registers. This fixes a crash on the
attached testcase.

llvm-svn: 68712
2009-04-09 16:50:43 +00:00
Ted Kremenek f8cb51c20e Remove SVal::MakeZero and replace it with ValueManager::makeZeroVal.
llvm-svn: 68711
2009-04-09 16:46:55 +00:00
Daniel Dunbar b041085c17 Add more builtin definitions, including strcmp.
- PR3964.

llvm-svn: 68710
2009-04-09 16:42:50 +00:00
Ted Kremenek aa4cfc2604 analyzer: Introduce a new class, ValueManager, that serves as an aggregate
"manager of symbolic values", wrapping BasicValueFactory, SymbolManager, and
MemRegionManager. While these individual managers nicely separate functionality
in the analyzer, constructing symbolic values can sometimes be cumbersome
because it requires using multiple managers at once. The goal of this class is
to create some factory methods to create SVals that require the use of these
different managers, thus (hopefully) simplifying the analyzer API for clients.

llvm-svn: 68709
2009-04-09 16:13:17 +00:00
Misha Brukman a04ede8d5b Make sure to rebuild dependencies for the `check' and `unittests' targets so
we're not testing out-of-date code.  This also makes "make check" and
"make unittests" work out-of-the box right after the configure step, without
requiring the user to run "make tools-only" or "make libs-only".

Tested on Linux/x86_64 and Darwin/x86.

llvm-svn: 68708
2009-04-09 14:57:00 +00:00
Ted Kremenek 8cdc351ed3 Update analyzer build.
llvm-svn: 68707
2009-04-09 14:06:37 +00:00
Sanjiv Gupta 60fd2cd503 Arguments to indirect calls were being passed incorrectly. They are not fixed to start after return value.
llvm-svn: 68705
2009-04-09 10:29:32 +00:00
Zhongxing Xu 7e9c193398 stop using loc::SymbolVal and clean up code with new API.
llvm-svn: 68703
2009-04-09 07:39:46 +00:00
Zhongxing Xu 48abb5d91f clean up code with new API.
llvm-svn: 68701
2009-04-09 07:04:45 +00:00
Zhongxing Xu 783cd82487 clean up code with new API.
llvm-svn: 68700
2009-04-09 07:01:16 +00:00
Zhongxing Xu 726876b385 clean up code with new API.
llvm-svn: 68699
2009-04-09 06:56:25 +00:00
Zhongxing Xu 2945210d71 clean up code with new API.
llvm-svn: 68698
2009-04-09 06:53:24 +00:00
Zhongxing Xu c48eb32872 stop using loc::SymbolVal.
llvm-svn: 68697
2009-04-09 06:49:52 +00:00
Zhongxing Xu 22f72485ed stop using loc::SymbolVal.
llvm-svn: 68696
2009-04-09 06:43:44 +00:00