]> granicus.if.org Git - clang/log
clang
15 years agoUse correct alignment and size for references in records as well.
Anders Carlsson [Fri, 10 Apr 2009 05:31:15 +0000 (05:31 +0000)]
Use correct alignment and size for references in records as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68769 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWording changes.
Ted Kremenek [Fri, 10 Apr 2009 05:04:22 +0000 (05:04 +0000)]
Wording changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68766 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd blurb about attribute "analyzer_noreturn"
Ted Kremenek [Fri, 10 Apr 2009 05:03:33 +0000 (05:03 +0000)]
Add blurb about attribute "analyzer_noreturn"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68765 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename variables to avoid conflict.
Anders Carlsson [Fri, 10 Apr 2009 04:59:59 +0000 (04:59 +0000)]
Rename variables to avoid conflict.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68764 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd Expr::EvaluateAsLValue which will (believe it or not) try to evaluate an Expr...
Anders Carlsson [Fri, 10 Apr 2009 04:54:13 +0000 (04:54 +0000)]
Add Expr::EvaluateAsLValue which will (believe it or not) try to evaluate an Expr as an LValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68763 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix thinko noticed by Chris.
Anders Carlsson [Fri, 10 Apr 2009 04:52:36 +0000 (04:52 +0000)]
Fix thinko noticed by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68762 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse the same alignment for reference declarations as for pointer declarations.
Anders Carlsson [Fri, 10 Apr 2009 04:47:03 +0000 (04:47 +0000)]
Use the same alignment for reference declarations as for pointer declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68761 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix indentation
Chris Lattner [Fri, 10 Apr 2009 04:42:25 +0000 (04:42 +0000)]
fix indentation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68760 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSplit failing test case from misc-ps.m to misc-ps-ranges.m (which tests
Ted Kremenek [Fri, 10 Apr 2009 04:02:38 +0000 (04:02 +0000)]
Split failing test case from misc-ps.m to misc-ps-ranges.m (which tests
functionality specific to RangeConstraintManager).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68759 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPCH serialization/deserialization of the source manager. With this
Douglas Gregor [Fri, 10 Apr 2009 03:52:48 +0000 (03:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68758 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix: <rdar://problem/6776949> Branch condition evaluates to an uninitialized value...
Ted Kremenek [Fri, 10 Apr 2009 00:59:50 +0000 (00:59 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68757 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake messages consistent.
Chris Lattner [Fri, 10 Apr 2009 00:37:08 +0000 (00:37 +0000)]
Make messages consistent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68756 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoreject codegen of __thread variables as unimplemented, rdar://6775265
Chris Lattner [Fri, 10 Apr 2009 00:35:59 +0000 (00:35 +0000)]
reject codegen of __thread variables as unimplemented, rdar://6775265

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68755 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allows
Ted Kremenek [Fri, 10 Apr 2009 00:01:14 +0000 (00:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68746 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplementation of pre-compiled headers (PCH) based on lazy
Douglas Gregor [Thu, 9 Apr 2009 22:27:44 +0000 (22:27 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago- Move ownership of MemRegionManager into ValueManager.
Ted Kremenek [Thu, 9 Apr 2009 22:22:44 +0000 (22:22 +0000)]
- Move ownership of MemRegionManager into ValueManager.
- Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly
simplifies the calling interface to clients.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68731 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd @encode support for complex types.
Anders Carlsson [Thu, 9 Apr 2009 21:55:45 +0000 (21:55 +0000)]
Add @encode support for complex types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68729 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPropagate the ASTContext to various AST traversal and lookup functions.
Douglas Gregor [Thu, 9 Apr 2009 21:40:53 +0000 (21:40 +0000)]
Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some FIXMEs for missing checks.
Eli Friedman [Thu, 9 Apr 2009 21:26:42 +0000 (21:26 +0000)]
Add some FIXMEs for missing checks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68725 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodocument the x86 address space extension for GS.
Chris Lattner [Thu, 9 Apr 2009 19:58:15 +0000 (19:58 +0000)]
document the x86 address space extension for GS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68724 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix grammar. Bold face feature points.
Ted Kremenek [Thu, 9 Apr 2009 18:22:40 +0000 (18:22 +0000)]
Fix grammar.  Bold face feature points.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68720 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore cleanup.
Ted Kremenek [Thu, 9 Apr 2009 18:20:08 +0000 (18:20 +0000)]
More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68719 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore cleanups.
Ted Kremenek [Thu, 9 Apr 2009 18:17:39 +0000 (18:17 +0000)]
More cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68718 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd link from internals manual to PTH documentation.
Ted Kremenek [Thu, 9 Apr 2009 18:08:18 +0000 (18:08 +0000)]
Add link from internals manual to PTH documentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68717 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMinor cleanups. Added a blurb about the advantages of fast PTH file generation.
Ted Kremenek [Thu, 9 Apr 2009 18:03:21 +0000 (18:03 +0000)]
Minor cleanups.  Added a blurb about the advantages of fast PTH file generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68716 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimple DeclContext's internal representation by always storing a
Douglas Gregor [Thu, 9 Apr 2009 17:29:08 +0000 (17:29 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68715 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove SVal::MakeZero and replace it with ValueManager::makeZeroVal.
Ted Kremenek [Thu, 9 Apr 2009 16:46:55 +0000 (16:46 +0000)]
Remove SVal::MakeZero and replace it with ValueManager::makeZeroVal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68711 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd more builtin definitions, including strcmp.
Daniel Dunbar [Thu, 9 Apr 2009 16:42:50 +0000 (16:42 +0000)]
Add more builtin definitions, including strcmp.
 - PR3964.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68710 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoanalyzer: Introduce a new class, ValueManager, that serves as an aggregate
Ted Kremenek [Thu, 9 Apr 2009 16:13:17 +0000 (16:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68709 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate analyzer build.
Ted Kremenek [Thu, 9 Apr 2009 14:06:37 +0000 (14:06 +0000)]
Update analyzer build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68707 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostop using loc::SymbolVal and clean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 07:39:46 +0000 (07:39 +0000)]
stop using loc::SymbolVal and clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68703 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 07:04:45 +0000 (07:04 +0000)]
clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68701 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 07:01:16 +0000 (07:01 +0000)]
clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68700 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 06:56:25 +0000 (06:56 +0000)]
clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68699 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 06:53:24 +0000 (06:53 +0000)]
clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68698 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostop using loc::SymbolVal.
Zhongxing Xu [Thu, 9 Apr 2009 06:49:52 +0000 (06:49 +0000)]
stop using loc::SymbolVal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68697 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostop using loc::SymbolVal.
Zhongxing Xu [Thu, 9 Apr 2009 06:43:44 +0000 (06:43 +0000)]
stop using loc::SymbolVal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68696 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostop using loc::SymbolVal.
Zhongxing Xu [Thu, 9 Apr 2009 06:41:51 +0000 (06:41 +0000)]
stop using loc::SymbolVal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68695 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 06:35:30 +0000 (06:35 +0000)]
clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68694 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 06:32:20 +0000 (06:32 +0000)]
clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68693 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a new method because sometimes the type of the conjured symbol is not the
Zhongxing Xu [Thu, 9 Apr 2009 06:30:17 +0000 (06:30 +0000)]
Add a new method because sometimes the type of the conjured symbol is not the
type of the expression where we create the symbol.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68692 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake a conjured symbol as the original code.
Zhongxing Xu [Thu, 9 Apr 2009 06:18:05 +0000 (06:18 +0000)]
make a conjured symbol as the original code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68691 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up code with new API.
Zhongxing Xu [Thu, 9 Apr 2009 06:03:54 +0000 (06:03 +0000)]
clean up code with new API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68687 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a null pointer dereference error due to state caching in a loop involving
Ted Kremenek [Thu, 9 Apr 2009 06:02:06 +0000 (06:02 +0000)]
Fix a null pointer dereference error due to state caching in a loop involving
sending a message to a nil receiver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68686 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCreate a symbolic region instead of a loc::SymbolVal. This is a continued step
Zhongxing Xu [Thu, 9 Apr 2009 05:57:11 +0000 (05:57 +0000)]
Create a symbolic region instead of a loc::SymbolVal. This is a continued step
to eliminate the use of loc::SymbolVal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68685 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGRExprEngine: Don't try to reason about the size of 'void' for the return type
Ted Kremenek [Thu, 9 Apr 2009 05:45:56 +0000 (05:45 +0000)]
GRExprEngine: Don't try to reason about the size of 'void' for the return type
of messages sent to nil.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68683 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAnother ParentMap bug: only the right side of a comma expression is consumed.
Ted Kremenek [Thu, 9 Apr 2009 05:34:31 +0000 (05:34 +0000)]
Another ParentMap bug: only the right side of a comma expression is consumed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68680 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix another regression introduced by changes to the analyzer's reasoning about
Ted Kremenek [Thu, 9 Apr 2009 04:06:51 +0000 (04:06 +0000)]
Fix another regression introduced by changes to the analyzer's reasoning about
nil receivers in message expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68672 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake -include, -imacros paths absolute in Frontend.
Daniel Dunbar [Thu, 9 Apr 2009 00:51:16 +0000 (00:51 +0000)]
Make -include, -imacros paths absolute in Frontend.
 - Otherwise paths will be resolved relative to the main input file,
   which is incorrect.

 - I don't know how to make a reasonable test case for this with our
   testing infrastructure.

 - PR3395

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68665 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefactor/cleanup reasoning of nil receivers in message expressions.
Ted Kremenek [Thu, 9 Apr 2009 00:00:02 +0000 (00:00 +0000)]
Refactor/cleanup reasoning of nil receivers in message expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68661 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Split out CPP specific options for clang so that we don't end
Daniel Dunbar [Wed, 8 Apr 2009 23:54:23 +0000 (23:54 +0000)]
Driver: Split out CPP specific options for clang so that we don't end
up adding them twice when running with -no-integrated-cpp or
-save-temps.
 - <rdar://problem/6766636> -save-temps falls over with prefix headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68660 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6770998> make cast of super illegal (again:-)
Steve Naroff [Wed, 8 Apr 2009 23:52:26 +0000 (23:52 +0000)]
Fix <rdar://problem/6770998> make cast of super illegal (again:-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68659 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse the new EmitCallArgs function. No indented functionality change.
Anders Carlsson [Wed, 8 Apr 2009 23:13:16 +0000 (23:13 +0000)]
Use the new EmitCallArgs function. No indented functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68652 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoForce triple for these tests.
Daniel Dunbar [Wed, 8 Apr 2009 23:02:51 +0000 (23:02 +0000)]
Force triple for these tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68651 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd driver support for -Wno-trigraphs
Chris Lattner [Wed, 8 Apr 2009 22:38:30 +0000 (22:38 +0000)]
add driver support for -Wno-trigraphs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68650 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd support for -Wtrigraphs and -Wno-trigraphs.
Chris Lattner [Wed, 8 Apr 2009 22:37:15 +0000 (22:37 +0000)]
add support for -Wtrigraphs and -Wno-trigraphs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68649 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded a FIXME.
Fariborz Jahanian [Wed, 8 Apr 2009 21:54:52 +0000 (21:54 +0000)]
Added a FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68646 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd driver headers to xcode proj
Chris Lattner [Wed, 8 Apr 2009 20:57:57 +0000 (20:57 +0000)]
add driver headers to xcode proj

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68642 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement -imacros support in driver.
Chris Lattner [Wed, 8 Apr 2009 20:57:44 +0000 (20:57 +0000)]
implement -imacros support in driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68641 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofinish the implementation of -imacros. The driver still needs to be hooked up.
Chris Lattner [Wed, 8 Apr 2009 20:53:24 +0000 (20:53 +0000)]
finish the implementation of -imacros.  The driver still needs to be hooked up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68640 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd code for emitting call arguments (not used yet).
Anders Carlsson [Wed, 8 Apr 2009 20:47:54 +0000 (20:47 +0000)]
Add code for emitting call arguments (not used yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68639 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWe weren't generating correct code for calls to variadic member functions.
Anders Carlsson [Wed, 8 Apr 2009 20:31:57 +0000 (20:31 +0000)]
We weren't generating correct code for calls to variadic member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68635 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix buffer overrun when laying out synthesized ivars.
Daniel Dunbar [Wed, 8 Apr 2009 20:18:15 +0000 (20:18 +0000)]
Fix buffer overrun when laying out synthesized ivars.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68634 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAccording to the GCC man page, all -imacros are included before any -include's.
Chris Lattner [Wed, 8 Apr 2009 20:15:42 +0000 (20:15 +0000)]
According to the GCC man page, all -imacros are included before any -include's.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68633 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoproperly escape filenames when generating implicit #includes, this handles
Chris Lattner [Wed, 8 Apr 2009 20:10:57 +0000 (20:10 +0000)]
properly escape filenames when generating implicit #includes, this handles
things like " in paths etc.  Found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68632 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed a problem using property syntax on a 'super'
Fariborz Jahanian [Wed, 8 Apr 2009 19:50:10 +0000 (19:50 +0000)]
Fixed a problem using property syntax on a 'super'
used as receiver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68631 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse presumed location to get line number info.
Devang Patel [Wed, 8 Apr 2009 19:47:04 +0000 (19:47 +0000)]
Use presumed location to get line number info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68630 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhance analyzer reasoning about sending messages to nil. A nil receiver returns...
Ted Kremenek [Wed, 8 Apr 2009 18:51:08 +0000 (18:51 +0000)]
Enhance analyzer reasoning about sending messages to nil.  A nil receiver returns 0 for scalars of size <= sizeof(void*).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68629 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix bug in ParentMap::isConsumedExpr. A BinaryOperator always "consumes" the
Ted Kremenek [Wed, 8 Apr 2009 18:49:36 +0000 (18:49 +0000)]
Fix bug in ParentMap::isConsumedExpr. A BinaryOperator always "consumes" the
value of its subexpressions unless it is a comma (in which case it doesn't
consume the left subexpression).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68628 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoreject the #__include_macros directive unless it comes from the
Chris Lattner [Wed, 8 Apr 2009 18:46:40 +0000 (18:46 +0000)]
reject the #__include_macros directive unless it comes from the
predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68627 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd initial support for -imacros. Right now it has the same semantics as
Chris Lattner [Wed, 8 Apr 2009 18:24:34 +0000 (18:24 +0000)]
Add initial support for -imacros.  Right now it has the same semantics as
-include, but that will be fixed soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68625 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore fixes to builtin preprocessor defines.
Daniel Dunbar [Wed, 8 Apr 2009 18:03:55 +0000 (18:03 +0000)]
More fixes to builtin preprocessor defines.
 - Add -static-define option driver can use when __STATIC__ should be
   defined (instead of __DYNAMIC__).

 - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz.

 - Set __NO_INLINE__ following GCC 4.2.

 - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2.

 - Set __EXCEPTIONS for Objective-C NonFragile ABI.

 - Set __STRICT_ANSI__ for standard conforming modes.

 - I added a clang style test case in utils for this, but its not
   particularly portable and I don't think it belongs in the test
   suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68621 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSema::CheckConditionalOperands(): Soften pointer/integer mismatch from error->warning.
Steve Naroff [Wed, 8 Apr 2009 17:05:15 +0000 (17:05 +0000)]
Sema::CheckConditionalOperands(): Soften pointer/integer mismatch from error->warning.

Fixes <rdar://problem/6762239> [sema] gcc incompatibility; error on incompatible operand types in ?:.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68617 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure value is initialized when built w/o asserts.
Daniel Dunbar [Wed, 8 Apr 2009 16:23:09 +0000 (16:23 +0000)]
Make sure value is initialized when built w/o asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68615 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago-Wmissing-prototypes shouldn't complain about main() missing a prototype.
Douglas Gregor [Wed, 8 Apr 2009 15:21:36 +0000 (15:21 +0000)]
-Wmissing-prototypes shouldn't complain about main() missing a prototype.

Fixes <rdar://problem/6759522>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68611 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDarwin ld: Unconditionally add -lstdc++ if we are pretending to be
Daniel Dunbar [Wed, 8 Apr 2009 06:06:21 +0000 (06:06 +0000)]
Darwin ld: Unconditionally add -lstdc++ if we are pretending to be
g++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68601 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agouse escapes.
Chris Lattner [Wed, 8 Apr 2009 06:00:32 +0000 (06:00 +0000)]
use escapes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68600 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosome minor edits
Chris Lattner [Wed, 8 Apr 2009 05:50:25 +0000 (05:50 +0000)]
some minor edits

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68599 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake debug info work when using -save-temps.
Daniel Dunbar [Wed, 8 Apr 2009 05:11:16 +0000 (05:11 +0000)]
Make debug info work when using -save-temps.
 - This is pretty ugly, but the most obvious solution. Chime in if you
   have a nicer one.

 - The problem is that with -save-temps, clang-cc has no idea what the
   name of the original input file is. However, the user expects to be
   able to set breakpoints based on the input file name.

 - We support this by providing a new option -main-file-name (similar
   to -dumpbase used by gcc) which allows the driver to pass in the
   original file name.

 - <rdar://problem/6753383> building with clang using --save-temps
   gets the compile unit name from the .i file...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68595 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInitial draft of PTH internals.
Ted Kremenek [Wed, 8 Apr 2009 05:07:30 +0000 (05:07 +0000)]
Initial draft of PTH internals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68594 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a destination type argument to EmitConstantExpr. This will be used for when the...
Anders Carlsson [Wed, 8 Apr 2009 04:48:15 +0000 (04:48 +0000)]
Add a destination type argument to EmitConstantExpr. This will be used for when the destination has a reference type. (No functionality change yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68593 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplementation definition of interfaces with __objc_exception attribute.
Daniel Dunbar [Wed, 8 Apr 2009 04:21:03 +0000 (04:21 +0000)]
Implementation definition of interfaces with __objc_exception attribute.
 - Complete <rdar://problem/6635883> Support __objc_exception__
   attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68591 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPointer width on targets like PIC16 is 16-bit, while the valid index size to GEP...
Sanjiv Gupta [Wed, 8 Apr 2009 04:16:39 +0000 (04:16 +0000)]
Pointer width on targets like PIC16 is 16-bit, while the valid index size to GEP is only 32 or 64. So promote index to 32 in such cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68590 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove fixme!
Chris Lattner [Wed, 8 Apr 2009 03:47:39 +0000 (03:47 +0000)]
remove fixme!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68589 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix typo, noticed by Gabor
Chris Lattner [Wed, 8 Apr 2009 03:36:03 +0000 (03:36 +0000)]
fix typo, noticed by Gabor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68587 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprove compatibility with VC+, patch by John Thompson!
Chris Lattner [Wed, 8 Apr 2009 03:33:43 +0000 (03:33 +0000)]
improve compatibility with VC+, patch by John Thompson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68586 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNew static analyzer check by Nikita Zhuk!
Ted Kremenek [Wed, 8 Apr 2009 03:07:17 +0000 (03:07 +0000)]
New static analyzer check by Nikita Zhuk!

"The attached patch generates warnings of cases where an ObjC message is sent to
a nil object and the size of return type of that message is larger than the size
of void pointer. This may result in undefined return values as described in PR
2718.  The patch also includes test cases."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68585 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet __PIC__ (more) correctly.
Daniel Dunbar [Wed, 8 Apr 2009 03:03:23 +0000 (03:03 +0000)]
Set __PIC__ (more) correctly.
 - Add -pic-level clang-cc option to specify the value for the define,
   updated driver to pass this.

 - Added __pic__

 - Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68584 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't assume that a block always has a FunctionProtoType. Fixes rdar://6768379.
Anders Carlsson [Wed, 8 Apr 2009 02:55:55 +0000 (02:55 +0000)]
Don't assume that a block always has a FunctionProtoType. Fixes rdar://6768379.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68583 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd basic support for arm static analysis checking. Radar 6699395
Mike Stump [Wed, 8 Apr 2009 02:07:04 +0000 (02:07 +0000)]
Add basic support for arm static analysis checking.  Radar 6699395

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68582 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Fix forwarding of -fpascal-strings.
Daniel Dunbar [Tue, 7 Apr 2009 23:51:44 +0000 (23:51 +0000)]
Driver: Fix forwarding of -fpascal-strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68570 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6764172> [sema] crash on invalid.
Steve Naroff [Tue, 7 Apr 2009 22:56:58 +0000 (22:56 +0000)]
Fix <rdar://problem/6764172> [sema] crash on invalid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68568 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoVisibility attributes should only be set on definition.
Daniel Dunbar [Tue, 7 Apr 2009 22:36:33 +0000 (22:36 +0000)]
Visibility attributes should only be set on definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68561 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Fix forwarding of -{std,ansi,trigraphs} when there are
Daniel Dunbar [Tue, 7 Apr 2009 22:13:21 +0000 (22:13 +0000)]
Driver: Fix forwarding of -{std,ansi,trigraphs} when there are
multiple instances of an option.

Also, removed direct -ansi support from clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68558 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoShuffle some call code around. No functionality change.
Anders Carlsson [Tue, 7 Apr 2009 22:10:22 +0000 (22:10 +0000)]
Shuffle some call code around. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68557 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Forward remaining -f options to clang manually.
Daniel Dunbar [Tue, 7 Apr 2009 21:51:40 +0000 (21:51 +0000)]
Driver: Forward remaining -f options to clang manually.
 - Groups are really just intended to hold inherent structure of the
   options, not be abused for individual tool argument translation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68554 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Only forward last instance of -mmacosx-version-min= and
Daniel Dunbar [Tue, 7 Apr 2009 21:42:00 +0000 (21:42 +0000)]
Driver: Only forward last instance of -mmacosx-version-min= and
-isysroot to clang.
 - Don't forward arbitrary -i* options to clang, just the ones we know
   about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68553 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNow that we have __weak defined as attribute in all modes,
Fariborz Jahanian [Tue, 7 Apr 2009 21:25:06 +0000 (21:25 +0000)]
Now that we have __weak defined as attribute in all modes,
we must not issue gc-specific errors in non-gc mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68551 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Manually translate a number of -f with no- variants options to
Daniel Dunbar [Tue, 7 Apr 2009 21:16:11 +0000 (21:16 +0000)]
Driver: Manually translate a number of -f with no- variants options to
clang.
 - We will eventually want some more driver infrastructre for this
   probably.

 - For now, the clang-cc interface stays relatively the same, but we
   don't accept multiple instances anymore, or the [no-] variants
   directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68550 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add default for ArgList::hasFlag and simplify implementation.
Daniel Dunbar [Tue, 7 Apr 2009 21:08:57 +0000 (21:08 +0000)]
Driver: Add default for ArgList::hasFlag and simplify implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68549 91177308-0d34-0410-b5e6-96231b3b80d8