]> granicus.if.org Git - clang/log
clang
14 years agoHard bifurcate the state into nil receiver and non-nil receiver, so that
Zhongxing Xu [Wed, 2 Dec 2009 05:49:12 +0000 (05:49 +0000)]
Hard bifurcate the state into nil receiver and non-nil receiver, so that
we don't need to use the DoneEvaluation hack when check for
ObjCMessageExpr.

PreVisitObjCMessageExpr() only checks for undefined receiver or arguments.

Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface.

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

14 years agolibFrontend depends on libDriver now.
Zhongxing Xu [Wed, 2 Dec 2009 05:45:19 +0000 (05:45 +0000)]
libFrontend depends on libDriver now.

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

14 years agoEliminate the unnecessary FirstFID cache variable from the source manager's ContentCache
Douglas Gregor [Wed, 2 Dec 2009 05:34:39 +0000 (05:34 +0000)]
Eliminate the unnecessary FirstFID cache variable from the source manager's ContentCache

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

14 years agoStop trying to analyze class-hierarchies for dependently-scoped id-expressions;
John McCall [Wed, 2 Dec 2009 03:53:29 +0000 (03:53 +0000)]
Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;
there's nothing interesting we can say now that we're correctly not requiring
the qualifier to name a known base class in dependent contexts.

Require scope specifiers on member access expressions to name complete types
if they're not dependent;  delay lookup when they are dependent.

Use more appropriate diagnostics when qualified implicit member access
expressions find declarations from unrelated classes.

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

14 years agoAdd ASTUnit::LoadFromCommandLine, which creates an ASTUnit out of a list of
Daniel Dunbar [Wed, 2 Dec 2009 03:23:45 +0000 (03:23 +0000)]
Add ASTUnit::LoadFromCommandLine, which creates an ASTUnit out of a list of
(clang/driver) command line arguments (including the source file).
 - The arguments are expected to include the source file.

 - The idea is that even though this is a somewhat odd API, its the form which
   many tools can most easily use (for example, by interposing with the compiler).

Also, switch index-test's -ast-from-source to use this entry point, and provide
a -arg command line argument which can be used to test that the command line
arguments are handled correctly.

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

14 years agoDriver: Add Command::Creator member variable, which tracks the tool that was
Daniel Dunbar [Wed, 2 Dec 2009 03:23:25 +0000 (03:23 +0000)]
Driver: Add Command::Creator member variable, which tracks the tool that was
used to create a particular command.

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

14 years agoAdded an assert.
Fariborz Jahanian [Tue, 1 Dec 2009 23:35:33 +0000 (23:35 +0000)]
Added an assert.

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

14 years agoFix a code gen. crash synthesizing a destructor.
Fariborz Jahanian [Tue, 1 Dec 2009 23:18:25 +0000 (23:18 +0000)]
Fix a code gen. crash synthesizing a destructor.
Fixes pr5660.

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

14 years agoIn SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source...
Daniel Dunbar [Tue, 1 Dec 2009 23:07:57 +0000 (23:07 +0000)]
In SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source locations with no common ancestor in the include stack, determine order by assuming memory buffers preceed files, and then that FileIDs are created in order.

The later assumption is patently false, but this was already broken -- this situation is conceptually impossible, my feeling is we should fix SourceManager and friends to make it impossible in practice as well. However, we need to fix PR5662 and perhaps some other things involving memory buffers first. In the short term I'm pretty sure this is reliable.

Chris, Argiris, is this going to break anything that wasn't already broken?

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

14 years agoAdded dead-stores test cases that involve the use of blocks.
Ted Kremenek [Tue, 1 Dec 2009 23:04:14 +0000 (23:04 +0000)]
Added dead-stores test cases that involve the use of blocks.

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

14 years agopass the reason for failure up from MemoryBuffer and report it
Chris Lattner [Tue, 1 Dec 2009 22:52:33 +0000 (22:52 +0000)]
pass the reason for failure up from MemoryBuffer and report it
in diagnostics when we fail to open a file.  This allows us to
report things like:

$ clang test.c -I.
test.c:2:10: fatal error: error opening file './foo.h': Permission denied
#include "foo.h"
         ^

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

14 years agoAdd new test case file that focuses on testing analyzer support for blocks.
Ted Kremenek [Tue, 1 Dec 2009 22:47:46 +0000 (22:47 +0000)]
Add new test case file that focuses on testing analyzer support for blocks.

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

14 years agoMake EmitStoreOfScalar generate a more sane representation of boolean stores.
Eli Friedman [Tue, 1 Dec 2009 22:31:51 +0000 (22:31 +0000)]
Make EmitStoreOfScalar generate a more sane representation of boolean stores.
"Fixes" PR5645.

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

14 years agoFix IsProvablyNotDerivedFrom to always use record definitions when available.
John McCall [Tue, 1 Dec 2009 22:28:41 +0000 (22:28 +0000)]
Fix IsProvablyNotDerivedFrom to always use record definitions when available.
Gets clang-on-clang passing again.

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

14 years agoThe minimum element size in BumpVector should be 1, not 0.
Ted Kremenek [Tue, 1 Dec 2009 22:13:00 +0000 (22:13 +0000)]
The minimum element size in BumpVector should be 1, not 0.

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

14 years agoProvide the correct vector size for referenced variables.
Ted Kremenek [Tue, 1 Dec 2009 22:12:34 +0000 (22:12 +0000)]
Provide the correct vector size for referenced variables.

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

14 years agoRework how we support C++ implicit member accesses. If we can resolve an
John McCall [Tue, 1 Dec 2009 22:10:20 +0000 (22:10 +0000)]
Rework how we support C++ implicit member accesses.  If we can resolve an
implicit member access to a specific declaration, go ahead and create
it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as
appropriate.  Otherwise, create an UnresolvedMemberExpr or
DependentScopeMemberExpr with a null base expression.

By representing implicit accesses directly in the AST, we get the ability
to correctly delay the decision about whether it's actually an instance
member access or not until resolution is complete.  This permits us
to correctly avoid diagnosing the 'problem' of 'MyType::foo()'
where the relationship to the type isn't really known until instantiation.

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

14 years agoAdd test case for PR5662.
Daniel Dunbar [Tue, 1 Dec 2009 21:57:39 +0000 (21:57 +0000)]
Add test case for PR5662.

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

14 years agoASTUnit: Make sure to preserve the TargetInfo for later use.
Daniel Dunbar [Tue, 1 Dec 2009 21:57:33 +0000 (21:57 +0000)]
ASTUnit: Make sure to preserve the TargetInfo for later use.

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

14 years agoFix typo.
Daniel Dunbar [Tue, 1 Dec 2009 21:57:27 +0000 (21:57 +0000)]
Fix typo.

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

14 years agoAdd {ExternalSemaSource,SemaConsumer}::ForgetSema callback, and update PCHReader
Daniel Dunbar [Tue, 1 Dec 2009 21:57:20 +0000 (21:57 +0000)]
Add {ExternalSemaSource,SemaConsumer}::ForgetSema callback, and update PCHReader
to use it so it at least won't try to access Sema once it is gone.

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

14 years agoExit the command line into <built-in> instead of going directly from the command...
Rafael Espindola [Tue, 1 Dec 2009 18:28:16 +0000 (18:28 +0000)]
Exit the command line into <built-in> instead of going directly from the command line to the input file.

We passed <built-in> on the way in, so we should pass it again on the way out.

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

14 years ago(objc2 nonfragile-abi specific). If the translation unit includes an implementation
Fariborz Jahanian [Tue, 1 Dec 2009 18:25:24 +0000 (18:25 +0000)]
(objc2 nonfragile-abi specific). If the translation unit includes an implementation
of a subclass (direct or indirect) of a weak_import root class, emit a weak reference
for the root class's metaclass (should complete radar 6815425).

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

14 years agoFix early-return logic in scanReachableSymbols() to match the rest of the recursive...
Ted Kremenek [Tue, 1 Dec 2009 17:50:25 +0000 (17:50 +0000)]
Fix early-return logic in scanReachableSymbols() to match the rest of the recursive logic in the methods of ScanReachableSymbols.

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

14 years agoConvert Diagnostic::getCustomDiagID to take a StringRef.
Daniel Dunbar [Tue, 1 Dec 2009 17:42:06 +0000 (17:42 +0000)]
Convert Diagnostic::getCustomDiagID to take a StringRef.

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

14 years agoFuntion templates and function template specializations do not
Douglas Gregor [Tue, 1 Dec 2009 17:35:23 +0000 (17:35 +0000)]
Funtion templates and function template specializations do not
override virtual functions. Also, eliminate a (now redundant) call to
AddOverriddenMethods.

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

14 years agoMove the checking of overridden virtual functions into the code path
Douglas Gregor [Tue, 1 Dec 2009 17:24:26 +0000 (17:24 +0000)]
Move the checking of overridden virtual functions into the code path
common to both parsing and template instantiation, so that we'll find
overridden virtuals for member functions of class templates when they
are instantiated.

Additionally, factor out the checking for pure virtual functions, so
that it will be executed both at parsing time and at template
instantiation time.

These changes fix PR5656 (for real), although one more tweak
w.r.t. member function templates will be coming along shortly.

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

14 years agoDon't automatically assume that an id-expression refers to a
Douglas Gregor [Tue, 1 Dec 2009 16:58:18 +0000 (16:58 +0000)]
Don't automatically assume that an id-expression refers to a
ValueDecl, because that isn't always the case in ill-formed
code. Diagnose a common mistake (forgetting to provide a template
argument list for a class template, PR5655) and dyn_cast so that we
handle the general problem of referring to a non-value declaration
gracefully.

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

14 years agoAn inherited virtual (where "virtual" wasn't written explicitly) can
Douglas Gregor [Tue, 1 Dec 2009 16:18:00 +0000 (16:18 +0000)]
An inherited virtual (where "virtual" wasn't written explicitly) can
be defined as pure. Fixes PR5656.

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

14 years agofix build on linux
Nuno Lopes [Tue, 1 Dec 2009 12:49:04 +0000 (12:49 +0000)]
fix build on linux

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

14 years agoAdd ASTUnit::LoadFromCompilerInvocation, which does what it says.
Daniel Dunbar [Tue, 1 Dec 2009 09:51:01 +0000 (09:51 +0000)]
Add ASTUnit::LoadFromCompilerInvocation, which does what it says.

Also, add an -ast-from-source option to index-test which allows index-test to
run on source files directly.

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

14 years agoTuck away scan-build related files into tools/scan-build
Kovarththanan Rajaratnam [Tue, 1 Dec 2009 06:52:01 +0000 (06:52 +0000)]
Tuck away scan-build related files into tools/scan-build

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

14 years agoMove ubiviz to analyzer directory
Kovarththanan Rajaratnam [Tue, 1 Dec 2009 06:34:06 +0000 (06:34 +0000)]
Move ubiviz to analyzer directory

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

14 years agoSwitch the clang-to-CIndex interface for code-completion to a binary format, for...
Douglas Gregor [Tue, 1 Dec 2009 05:55:20 +0000 (05:55 +0000)]
Switch the clang-to-CIndex interface for code-completion to a binary format, for a massive speedup

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

14 years agoUpdate for llvm intrinsics change.
Eric Christopher [Tue, 1 Dec 2009 05:00:51 +0000 (05:00 +0000)]
Update for llvm intrinsics change.

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

14 years agoMuch work on try/catch statement. WIP.
Mike Stump [Tue, 1 Dec 2009 03:41:18 +0000 (03:41 +0000)]
Much work on try/catch statement.  WIP.

Highlights include:

  Fix __cxa_begin_catch so it now returns a value.
  Added getUnwindResumeOrRethrowFn helper to build up calls to
  _Unwind_Resume_or_Rethrow.
  Broke out object copying code into CopyObject from EmitCXXThrowExpr.
  Built up another version of CopyObject that can copy from memory for
  use in the catch parameter code.
  RTTI generation for type matching for catch.
  Code to check for the type match for catch.
  Code to generate the catch parameter, WIP, need make sure references
  and pointers and copy ctors work.

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

14 years agoEliminate warning in Release-Asserts mode. No functionality change
Douglas Gregor [Tue, 1 Dec 2009 03:34:29 +0000 (03:34 +0000)]
Eliminate warning in Release-Asserts mode. No functionality change

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

14 years agoclang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
Daniel Dunbar [Tue, 1 Dec 2009 03:16:53 +0000 (03:16 +0000)]
clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
where it belongs.

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

14 years agoAdd a very minimal README.txt for examples/PrintFunctionNames.
Daniel Dunbar [Tue, 1 Dec 2009 03:15:49 +0000 (03:15 +0000)]
Add a very minimal README.txt for examples/PrintFunctionNames.

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

14 years agoCIndex: Normalize formatting some more.
Daniel Dunbar [Tue, 1 Dec 2009 03:14:51 +0000 (03:14 +0000)]
CIndex: Normalize formatting some more.

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

14 years agoClean up BuiltinBug class.
Zhongxing Xu [Tue, 1 Dec 2009 03:06:19 +0000 (03:06 +0000)]
Clean up BuiltinBug class.

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

14 years agoc-index-test: Split "function scanning" behavior into its own "filter" -- its
Daniel Dunbar [Tue, 1 Dec 2009 02:35:37 +0000 (02:35 +0000)]
c-index-test: Split "function scanning" behavior into its own "filter" -- its
quite slow and doesn't really stress the APIs people should really use.
 - I'm not even sure if this mode is still useful given the other scanning mode;
   Steve?

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

14 years agoAdd c-index-test -test-load-source, which loads the translation unit from a source...
Daniel Dunbar [Tue, 1 Dec 2009 02:03:10 +0000 (02:03 +0000)]
Add c-index-test -test-load-source, which loads the translation unit from a source file (and other command line arguments).

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

14 years agoAllocate MultipleDC objects using the allocator associated with
Ted Kremenek [Tue, 1 Dec 2009 00:07:10 +0000 (00:07 +0000)]
Allocate MultipleDC objects using the allocator associated with
ASTContext instead of malloc.  Besides reducing malloc traffic, this
also removes a source of memory leaks when using a BumpPtrAllocator
for the allocator of ASTContext.  There are still leaks when using
MallocAllocator because Decl::Destroy() isn't fully finished.

Fixes: <rdar://problem/7431556>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90174 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix and test for a problem caught by the clang-on-clang buildbot: qualified
John McCall [Mon, 30 Nov 2009 23:50:49 +0000 (23:50 +0000)]
Fix and test for a problem caught by the clang-on-clang buildbot:  qualified
IDs in dependent contexts are not dependent if the context names a namespace.

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

14 years agoHave ASTRecordLayout keep track of the key function, in preparation of fixing a synth...
Anders Carlsson [Mon, 30 Nov 2009 23:41:22 +0000 (23:41 +0000)]
Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.

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

14 years agoRemove all of Sema's explicit uses of OverloadedFunctionDecl except for
John McCall [Mon, 30 Nov 2009 22:55:35 +0000 (22:55 +0000)]
Remove all of Sema's explicit uses of OverloadedFunctionDecl except for
those associated with TemplateNames.

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

14 years agoEliminate the use of OverloadedFunctionDecl in member expressions.
John McCall [Mon, 30 Nov 2009 22:42:35 +0000 (22:42 +0000)]
Eliminate the use of OverloadedFunctionDecl in member expressions.
Create a new UnresolvedMemberExpr for these lookups.  Assorted hackery
around qualified member expressions;  this will all go away when we
implement the correct (i.e. extremely delayed) implicit-member semantics.

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

14 years agoTest for my last patch.
Fariborz Jahanian [Mon, 30 Nov 2009 22:07:56 +0000 (22:07 +0000)]
Test for my last patch.

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

14 years agoMore support for virtual destructor calls.
Fariborz Jahanian [Mon, 30 Nov 2009 22:07:18 +0000 (22:07 +0000)]
More support for virtual destructor calls.
Fixes pr5619

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

14 years agoWhen we're trying to define an implicit virtual destructor, make sure that we have...
Anders Carlsson [Mon, 30 Nov 2009 21:24:50 +0000 (21:24 +0000)]
When we're trying to define an implicit virtual destructor, make sure that we have a valid delete operator.

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

14 years agoReindent buffer, switches in particular were totally out of style.
Daniel Dunbar [Mon, 30 Nov 2009 20:42:49 +0000 (20:42 +0000)]
Reindent buffer, switches in particular were totally out of style.

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

14 years agoStrip trailing space.
Daniel Dunbar [Mon, 30 Nov 2009 20:42:43 +0000 (20:42 +0000)]
Strip trailing space.

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

14 years agoAdd const to accessors that don't modify the object.
Mike Stump [Mon, 30 Nov 2009 20:10:58 +0000 (20:10 +0000)]
Add const to accessors that don't modify the object.

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

14 years agoReflow comments and fix 80-col violation.
Mike Stump [Mon, 30 Nov 2009 20:08:49 +0000 (20:08 +0000)]
Reflow comments and fix 80-col violation.

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

14 years agoAdd missing assignment operator to test, and add tests for while loops and for
Daniel Dunbar [Mon, 30 Nov 2009 20:00:35 +0000 (20:00 +0000)]
Add missing assignment operator to test, and add tests for while loops and for
loops (including temporaries inside the initializers).

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

14 years agoFix an assert.
Anders Carlsson [Mon, 30 Nov 2009 19:43:26 +0000 (19:43 +0000)]
Fix an assert.

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

14 years agoFix a crash when ivar type is a __strong SEL. Fallout from
Fariborz Jahanian [Mon, 30 Nov 2009 18:43:52 +0000 (18:43 +0000)]
Fix a crash when ivar type is a __strong SEL. Fallout from
recent change to make SEL a builtin type (fixes radar 7425510).

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

14 years agoAdd more sophisticated test for destruction order of C++ temporaries, please
Daniel Dunbar [Mon, 30 Nov 2009 18:17:34 +0000 (18:17 +0000)]
Add more sophisticated test for destruction order of C++ temporaries, please
feel free to extend!

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

14 years agoUse StringRef in Attr constructors.
Benjamin Kramer [Mon, 30 Nov 2009 17:08:26 +0000 (17:08 +0000)]
Use StringRef in Attr constructors.

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

14 years agoEliminate another VISIBILITY_HIDDEN
Douglas Gregor [Mon, 30 Nov 2009 16:08:24 +0000 (16:08 +0000)]
Eliminate another VISIBILITY_HIDDEN

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

14 years agoAdapt to the DOTGraphTraits changes in LLVM.
Tobias Grosser [Mon, 30 Nov 2009 14:16:05 +0000 (14:16 +0000)]
Adapt to the DOTGraphTraits changes in LLVM.

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

14 years agoclang-cc: Add code (currently disabled) for parsing arguments using clang -cc1 functi...
Daniel Dunbar [Mon, 30 Nov 2009 08:42:10 +0000 (08:42 +0000)]
clang-cc: Add code (currently disabled) for parsing arguments using clang -cc1 functionality instead of LLVM's CommandLine.
 - It works and passes test suite, but I want to polish and test a wee bit more before making the switch.

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

14 years agoAdd CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) place...
Daniel Dunbar [Mon, 30 Nov 2009 08:42:00 +0000 (08:42 +0000)]
Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.

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

14 years agoclang -cc1: Fix initialization of PreprocessorOptions::TokenCache.
Daniel Dunbar [Mon, 30 Nov 2009 08:41:42 +0000 (08:41 +0000)]
clang -cc1: Fix initialization of PreprocessorOptions::TokenCache.

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

14 years agoAdd TextDiagnosticBuffer::FlushDiagnostics, for forwarding the buffered diagnostics...
Daniel Dunbar [Mon, 30 Nov 2009 08:41:34 +0000 (08:41 +0000)]
Add TextDiagnosticBuffer::FlushDiagnostics, for forwarding the buffered diagnostics to a different diagnostics engine.

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

14 years agoclang -cc1: Fix -include-pch now that the test code is in clang-cc.
Daniel Dunbar [Mon, 30 Nov 2009 08:41:22 +0000 (08:41 +0000)]
clang -cc1: Fix -include-pch now that the test code is in clang-cc.

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

14 years agoclang -cc1: Initialize LangOptions::{Optimize,NoInline}
Daniel Dunbar [Mon, 30 Nov 2009 08:41:13 +0000 (08:41 +0000)]
clang -cc1: Initialize LangOptions::{Optimize,NoInline}

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

14 years agoUse '-FOO' 'BAR' instead of '-FOO=BAR' in tests.
Daniel Dunbar [Mon, 30 Nov 2009 08:41:04 +0000 (08:41 +0000)]
Use '-FOO' 'BAR' instead of '-FOO=BAR' in tests.

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

14 years agoAlways pass -fmessage-length using separate arguments.
Daniel Dunbar [Mon, 30 Nov 2009 08:40:54 +0000 (08:40 +0000)]
Always pass -fmessage-length using separate arguments.

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

14 years agoclang -cc1: Initialize LangOptions::DollarIdents correctly.
Daniel Dunbar [Mon, 30 Nov 2009 08:40:46 +0000 (08:40 +0000)]
clang -cc1: Initialize LangOptions::DollarIdents correctly.

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

14 years agoDon't try to generate common globals for C++ files, instead of depending on the FE...
Daniel Dunbar [Mon, 30 Nov 2009 08:40:34 +0000 (08:40 +0000)]
Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.

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

14 years agoEliminate CodeGenOptions::TimePasses.
Daniel Dunbar [Mon, 30 Nov 2009 08:39:52 +0000 (08:39 +0000)]
Eliminate CodeGenOptions::TimePasses.

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

14 years agoEliminate CodeGenOptions::SimplifyLibCalls.
Daniel Dunbar [Mon, 30 Nov 2009 08:39:32 +0000 (08:39 +0000)]
Eliminate CodeGenOptions::SimplifyLibCalls.

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

14 years agoSimplify.
Daniel Dunbar [Mon, 30 Nov 2009 07:18:20 +0000 (07:18 +0000)]
Simplify.

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

14 years agoPut CompilerInvocation testing code in clang-cc instead of clang for now, I can't...
Daniel Dunbar [Mon, 30 Nov 2009 07:18:13 +0000 (07:18 +0000)]
Put CompilerInvocation testing code in clang-cc instead of clang for now, I can't bear to link all of clang into 'clang' yet. :)
 - Still triggered by a magic leading -cc1 argument, as before.

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

14 years agoFix PR5633 by making the preprocessor handle the case where we can
Chris Lattner [Mon, 30 Nov 2009 04:18:44 +0000 (04:18 +0000)]
Fix PR5633 by making the preprocessor handle the case where we can
stat a file but where mmaping it fails.  In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'

instead of "cannot find file".

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

14 years agoMinor cleanup (no functionality change).
Eli Friedman [Mon, 30 Nov 2009 01:19:33 +0000 (01:19 +0000)]
Minor cleanup (no functionality change).

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

14 years agoclang -cc1: Use proper diagnostics for all parsing errors.
Daniel Dunbar [Sun, 29 Nov 2009 21:52:53 +0000 (21:52 +0000)]
clang -cc1: Use proper diagnostics for all parsing errors.

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

14 years agoDon't pass false (default) for isVolatile parameter to CreateLoad.
Daniel Dunbar [Sun, 29 Nov 2009 21:23:36 +0000 (21:23 +0000)]
Don't pass false (default) for isVolatile parameter to CreateLoad.

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

14 years agoExplicitly use setVolatile instead of extra IRBuilder argument.
Daniel Dunbar [Sun, 29 Nov 2009 21:11:47 +0000 (21:11 +0000)]
Explicitly use setVolatile instead of extra IRBuilder argument.

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

14 years agoDon't pass false (default) for isVolatile parameter to CreateStore.
Daniel Dunbar [Sun, 29 Nov 2009 21:11:41 +0000 (21:11 +0000)]
Don't pass false (default) for isVolatile parameter to CreateStore.

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

14 years agoChange CompilerInvocation::CreateFromArgs to report errors using a proper diagnostic...
Daniel Dunbar [Sun, 29 Nov 2009 20:58:50 +0000 (20:58 +0000)]
Change CompilerInvocation::CreateFromArgs to report errors using a proper diagnostic engine.
 - Clients that care about having the diagnostics output honor the user-controllable diagnostic options can buffer the diagnostics and issue them later.

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

14 years agoSimplify.
Daniel Dunbar [Sun, 29 Nov 2009 20:58:39 +0000 (20:58 +0000)]
Simplify.

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

14 years agoChange CompilerInvocation::CreateFromArgs to take Argv0 and the address of main ...
Daniel Dunbar [Sun, 29 Nov 2009 20:58:32 +0000 (20:58 +0000)]
Change CompilerInvocation::CreateFromArgs to take Argv0 and the address of main (or something in the main executable) so it can find the builtin compiler files.

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

14 years agoRemove useless c_str() calls in SemaCodeComplete.
Benjamin Kramer [Sun, 29 Nov 2009 20:18:50 +0000 (20:18 +0000)]
Remove useless c_str() calls in SemaCodeComplete.

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

14 years agoSimplify code. No functionality change.
Benjamin Kramer [Sun, 29 Nov 2009 19:51:45 +0000 (19:51 +0000)]
Simplify code. No functionality change.

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

14 years agoPort BugReporter and BugType to StringRef.
Benjamin Kramer [Sun, 29 Nov 2009 18:27:55 +0000 (18:27 +0000)]
Port BugReporter and BugType to StringRef.

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

14 years agoKill some unnecessary calls to c_str().
Benjamin Kramer [Sun, 29 Nov 2009 18:03:28 +0000 (18:03 +0000)]
Kill some unnecessary calls to c_str().

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

14 years agoKill off clang/win32 which contains the hand generated Visual Studio project files...
Kovarththanan Rajaratnam [Sun, 29 Nov 2009 17:13:54 +0000 (17:13 +0000)]
Kill off clang/win32 which contains the hand generated Visual Studio project files. These files are severely out of date and have been superseded by the CMake build system. RIP.

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

14 years agoremove stall comment
Nuno Lopes [Sun, 29 Nov 2009 17:07:16 +0000 (17:07 +0000)]
remove stall comment

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

14 years agoStreamline Stmt::CollectingStats() and Decl::CollectingStats(). No functionality...
Kovarththanan Rajaratnam [Sun, 29 Nov 2009 14:54:35 +0000 (14:54 +0000)]
Streamline Stmt::CollectingStats() and Decl::CollectingStats(). No functionality change.

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

14 years agoDon't call Decl::CollectingStats(false) and Stmt::CollectingStats(false). When called...
Kovarththanan Rajaratnam [Sun, 29 Nov 2009 14:50:29 +0000 (14:50 +0000)]
Don't call Decl::CollectingStats(false) and Stmt::CollectingStats(false). When called with false these functions return whether statistics are enabled. They don't change any state. Since we're not using the return value avoid calling them in the first place.

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

14 years agoRemove empty test directory. lit was moved to llvm/utils/lit in r82524
Kovarththanan Rajaratnam [Sun, 29 Nov 2009 10:09:37 +0000 (10:09 +0000)]
Remove empty test directory. lit was moved to llvm/utils/lit in r82524

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

14 years agoThis patch moves the frontend timer from clang-cc into CompilerInstance.
Kovarththanan Rajaratnam [Sun, 29 Nov 2009 09:57:35 +0000 (09:57 +0000)]
This patch moves the frontend timer from clang-cc into CompilerInstance.
CompilerInstance already contains various objects that are used
throughout the entire run.

Also addresses Daniels review comments in:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091123/024508.html

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

14 years agoUse '-FOO' 'BAR' instead of '-FOO=BAR' for FOO in -stack-protector, -fvisibility...
Daniel Dunbar [Sun, 29 Nov 2009 09:33:20 +0000 (09:33 +0000)]
Use '-FOO' 'BAR' instead of '-FOO=BAR' for FOO in -stack-protector, -fvisibility, and -fconstant-string-class.

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

14 years agoNormalize options to use '-FOO' instead of '--FOO'.
Daniel Dunbar [Sun, 29 Nov 2009 09:33:10 +0000 (09:33 +0000)]
Normalize options to use '-FOO' instead of '--FOO'.

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

14 years agoRemove unnecessary -fblocks=0.
Daniel Dunbar [Sun, 29 Nov 2009 09:32:38 +0000 (09:32 +0000)]
Remove unnecessary -fblocks=0.

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

14 years agoUse '-x' 'foo' instead of '-x=foo'.
Daniel Dunbar [Sun, 29 Nov 2009 09:32:31 +0000 (09:32 +0000)]
Use '-x' 'foo' instead of '-x=foo'.

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

14 years agoclang -cc1: Allow -triple= as an alias for -triple, -code-compiletion-at= as an alias...
Daniel Dunbar [Sun, 29 Nov 2009 09:32:20 +0000 (09:32 +0000)]
clang -cc1: Allow -triple= as an alias for -triple, -code-compiletion-at= as an alias for -code-completion-at, and spell "-std=" option correctly.

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