]> granicus.if.org Git - clang/log
clang
17 years agoImplemented 90% functionality of new child_iterator for Stmt objects
Ted Kremenek [Thu, 18 Oct 2007 00:24:38 +0000 (00:24 +0000)]
Implemented 90% functionality of new child_iterator for Stmt objects
that will (soon) allow iteration over the initializers in
declarations.  This new iterator mechanism is implemented by the
classes StmtIterator and ConstStmtIterator.

Patched a few files to use "operator++" instead of "operator+" on
child_iterators.

Friendship added in VarDecl to StmtIterator to allow returning a
reference to the initializer within the VarDecl.  We may not wish this
as a permanent solution.

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

17 years agoMake control flow in Expr::isConstantExpr more simple and
Chris Lattner [Thu, 18 Oct 2007 00:20:32 +0000 (00:20 +0000)]
Make control flow in Expr::isConstantExpr more simple and
local, making the code easier to read.

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

17 years agoAdd new API to rewrite one stmt/expr with another.
Chris Lattner [Wed, 17 Oct 2007 22:35:30 +0000 (22:35 +0000)]
Add new API to rewrite one stmt/expr with another.

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

17 years agoAdd rewriter support for @encode expressions. For example,
Chris Lattner [Wed, 17 Oct 2007 21:28:00 +0000 (21:28 +0000)]
Add rewriter support for @encode expressions. For example,
we currently turn:

    c = @encode(char *)[2] + 4;

into:

    c = "foo"[2] + 4;

Right now the foo string is hard coded, but you can imagine a world
where it wouldn't be :)

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

17 years agoThe size returned by Rewriter::getRangeSize should include
Chris Lattner [Wed, 17 Oct 2007 21:23:07 +0000 (21:23 +0000)]
The size returned by Rewriter::getRangeSize should include
the size of the last token.

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

17 years agoFix assertion for raw lexer.
Chris Lattner [Wed, 17 Oct 2007 21:22:38 +0000 (21:22 +0000)]
Fix assertion for raw lexer.

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

17 years agoMove token length calculation out of the diagnostics machinery into
Chris Lattner [Wed, 17 Oct 2007 21:18:47 +0000 (21:18 +0000)]
Move token length calculation out of the diagnostics machinery into
the lexer, where it can be shared.

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

17 years agowean the diagnostics machinery off the preprocessor.
Chris Lattner [Wed, 17 Oct 2007 20:53:57 +0000 (20:53 +0000)]
wean the diagnostics machinery off the preprocessor.

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

17 years agoAdd a new type of lexer: a raw lexer, which does not require a preprocessor
Chris Lattner [Wed, 17 Oct 2007 20:41:00 +0000 (20:41 +0000)]
Add a new type of lexer: a raw lexer, which does not require a preprocessor
object in order to do its thing.

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

17 years agorename test file for builtin "id"...
Steve Naroff [Wed, 17 Oct 2007 18:39:04 +0000 (18:39 +0000)]
rename test file for builtin "id"...

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

17 years agoFixed includes of "clang/AST/DeclObjC.h" to work on case-sensitive
Ted Kremenek [Wed, 17 Oct 2007 18:36:42 +0000 (18:36 +0000)]
Fixed includes of "clang/AST/DeclObjC.h" to work on case-sensitive
filesystems (was "#include "clang/AST/DeclObjc.h", which worked fine
on a case-insensitive HFS+ volume on the Mac).

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

17 years agoadd some comments.
Chris Lattner [Wed, 17 Oct 2007 18:28:59 +0000 (18:28 +0000)]
add some comments.

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

17 years agoPredefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from...
Steve Naroff [Wed, 17 Oct 2007 17:53:50 +0000 (17:53 +0000)]
Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from the respective test files. Moving forward, it will be very nice to assume these builtin!

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

17 years agoImplementation of AST for @protocol expression.
Fariborz Jahanian [Wed, 17 Oct 2007 16:58:11 +0000 (16:58 +0000)]
Implementation of AST for @protocol expression.

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

17 years agoUpdated VC++ build system.
Hartmut Kaiser [Wed, 17 Oct 2007 15:00:17 +0000 (15:00 +0000)]
Updated VC++ build system.
Silenced some VC++ warnings.
Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review.
Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues?

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

17 years agofix problems with test/sema/Cocoa.m etc on non-apple machines.
Chris Lattner [Wed, 17 Oct 2007 06:04:46 +0000 (06:04 +0000)]
fix problems with test/sema/Cocoa.m etc on non-apple machines.

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

17 years agoGenerate code for static variables that don't have initializers. Also, report an...
Anders Carlsson [Wed, 17 Oct 2007 00:52:43 +0000 (00:52 +0000)]
Generate code for static variables that don't have initializers. Also, report an error if a static initializer is not constant.

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

17 years agoFix the build.
Anders Carlsson [Wed, 17 Oct 2007 00:50:25 +0000 (00:50 +0000)]
Fix the build.

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

17 years agoAdded Driver/SerializationTest.cpp to the XCode project.
Ted Kremenek [Tue, 16 Oct 2007 23:40:12 +0000 (23:40 +0000)]
Added Driver/SerializationTest.cpp to the XCode project.

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

17 years agoStarted work on clang object serialization. Experimental
Ted Kremenek [Tue, 16 Oct 2007 23:37:27 +0000 (23:37 +0000)]
Started work on clang object serialization.  Experimental
serialization logic as well as driver code is now in
Driver/SerializationTest.cpp.  The status of this code is that it
should be used by no clients.

Added --test-pickling option to driver to run the serialization code.

Modified IdentifierInfo and IdentifierTable to have friend classes
that permit object serialization.  Such friendship may not be needed
in the final design.

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

17 years agoFix location processing of @selector: the range should include the @ sign.
Fariborz Jahanian [Tue, 16 Oct 2007 23:21:02 +0000 (23:21 +0000)]
Fix location processing of @selector: the range should include the @ sign.

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

17 years agoAdd Sema::CheckMessageArgumentTypes()...
Steve Naroff [Tue, 16 Oct 2007 23:12:48 +0000 (23:12 +0000)]
Add Sema::CheckMessageArgumentTypes()...

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

17 years agoFix location processing of @encode: the range should include the @ sign.
Chris Lattner [Tue, 16 Oct 2007 22:51:17 +0000 (22:51 +0000)]
Fix location processing of @encode: the range should include the @ sign.
@selector probably gets this wrong also.

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

17 years agoAdd a new Rewriter::getRangeSize method.
Chris Lattner [Tue, 16 Oct 2007 22:36:42 +0000 (22:36 +0000)]
Add a new Rewriter::getRangeSize method.
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for
consistency with other code.
Start building the rewriter towards handling @encode.

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

17 years agoPatch to diagnose duplicate method implementations.
Fariborz Jahanian [Tue, 16 Oct 2007 21:52:23 +0000 (21:52 +0000)]
Patch to diagnose duplicate method implementations.

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

17 years agoRemove ObjcMethodDecl::getNumMethodParams/getMethodParamDecl, they aren't used/needed.
Steve Naroff [Tue, 16 Oct 2007 21:36:54 +0000 (21:36 +0000)]
Remove ObjcMethodDecl::getNumMethodParams/getMethodParamDecl, they aren't used/needed.
Change ObjcMethodDecl::getMethodType to getResultType, to match FunctionDecl.

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

17 years agopublish location info
Chris Lattner [Tue, 16 Oct 2007 21:21:26 +0000 (21:21 +0000)]
publish location info

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

17 years agoSteve, pointer out that getName() is available for selectors. Made code much smaller...
Fariborz Jahanian [Tue, 16 Oct 2007 21:07:53 +0000 (21:07 +0000)]
Steve, pointer out that getName() is available for selectors. Made code much smaller, thanks.

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

17 years agoPush the rewriter forward a bit more. Now it rewrites
Chris Lattner [Tue, 16 Oct 2007 21:07:07 +0000 (21:07 +0000)]
Push the rewriter forward a bit more.  Now it rewrites
#import to #include's as a test.

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

17 years agothese aren't const.
Chris Lattner [Tue, 16 Oct 2007 21:04:49 +0000 (21:04 +0000)]
these aren't const.

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

17 years agoFix problem dumping/printing method names with null selector.
Fariborz Jahanian [Tue, 16 Oct 2007 20:52:13 +0000 (20:52 +0000)]
Fix problem dumping/printing method names with null selector.

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

17 years agoPatch to implement AST generation for objective-c's @selector expression.
Fariborz Jahanian [Tue, 16 Oct 2007 20:40:23 +0000 (20:40 +0000)]
Patch to implement AST generation for objective-c's @selector expression.

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

17 years agoEmit diagnostics for methods not found.
Steve Naroff [Tue, 16 Oct 2007 20:39:36 +0000 (20:39 +0000)]
Emit diagnostics for methods not found.

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

17 years agoUnbreak mingw32. Maybe there should be something like libClandSystem? :)
Anton Korobeynikov [Tue, 16 Oct 2007 09:09:44 +0000 (09:09 +0000)]
Unbreak mingw32. Maybe there should be something like libClandSystem? :)

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

17 years agoinitialization of references should not do default fn/array promotions.
Chris Lattner [Tue, 16 Oct 2007 02:55:40 +0000 (02:55 +0000)]
initialization of references should not do default fn/array promotions.
This fixes a bug Anders noticed.

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

17 years agoBad cast...need to use dyn_cast_or_null. Also changed Sema::InitBuiltinVaListType...
Steve Naroff [Tue, 16 Oct 2007 00:00:18 +0000 (00:00 +0000)]
Bad cast...need to use dyn_cast_or_null. Also changed Sema::InitBuiltinVaListType (which had the same bug).

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

17 years agoPatch to parse @selector expressions.
Fariborz Jahanian [Mon, 15 Oct 2007 23:39:13 +0000 (23:39 +0000)]
Patch to parse @selector expressions.

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

17 years agoChange the type of ObjCStringLiteral from "struct __builtin_CFString *" to "NSConstan...
Steve Naroff [Mon, 15 Oct 2007 23:35:17 +0000 (23:35 +0000)]
Change the type of ObjCStringLiteral from "struct __builtin_CFString *" to "NSConstantString *".

This makes the typecheck much happier. Without this change, the type checker would have to special case "struct __builtin_CFString *". This change does assume the interface for NSConstantString is declared in the translation unit.

I left ASTContext::getCFConstantStringType() around for now (with a comment that says it is currently unused).

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

17 years agoFix a parser bug with message expressions - need to call ParsePostfixExpressionSuffix().
Steve Naroff [Mon, 15 Oct 2007 20:55:58 +0000 (20:55 +0000)]
Fix a parser bug with message expressions - need to call ParsePostfixExpressionSuffix().

Now were correctly allow the following...

    i = [str rangeOfString:@"]"].length;

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

17 years agoMove type compatibility predicates from Type to ASTContext. In addition, the predicat...
Steve Naroff [Mon, 15 Oct 2007 20:41:53 +0000 (20:41 +0000)]
Move type compatibility predicates from Type to ASTContext. In addition, the predicates are now instance methods (they were previously static class methods on Type).

This allowed me to fix the following hack from this weekend...

// FIXME: Devise a way to do this without using strcmp.
// Would like to say..."return getAsStructureType() == IdStructType;", but
// we don't have a pointer to ASTContext.
bool Type::isObjcIdType() const {
  if (const RecordType *RT = getAsStructureType())
    return !strcmp(RT->getDecl()->getName(), "objc_object");
  return false;
}

...which is now...

bool isObjcIdType(QualType T) const {
  return T->getAsStructureType() == IdStructType;
}

Side notes:

- I had to remove a convenience function from the TypesCompatibleExpr class.

int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);}

Which required a couple clients get a little more verbose...

-    Result = TCE->typesAreCompatible();
+    Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2());

Overall, I think this change also makes sense for a couple reasons...

1) Since ASTContext vends types, it makes sense for the type compatibility API to be there.
2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions).

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

17 years agoAdd code generation and sema checking for __builtin_va_arg.
Anders Carlsson [Mon, 15 Oct 2007 20:28:48 +0000 (20:28 +0000)]
Add code generation and sema checking for __builtin_va_arg.

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

17 years agoSeveral name lookup conflict detection fixes involving objective-c names.
Fariborz Jahanian [Mon, 15 Oct 2007 19:16:57 +0000 (19:16 +0000)]
Several name lookup conflict detection fixes involving objective-c names.

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

17 years agoAdded ASTContext::setObjcIdType/getObjcIdType(), set by Sema.
Steve Naroff [Mon, 15 Oct 2007 14:41:52 +0000 (14:41 +0000)]
Added ASTContext::setObjcIdType/getObjcIdType(), set by Sema.

Also noticed ASTContext::BuiltinVaListType wasn't being initialized to the null type (so I set it).

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

17 years agoTeach the type checker about "id". This removes the following bogus warning...
Steve Naroff [Mon, 15 Oct 2007 03:14:16 +0000 (03:14 +0000)]
Teach the type checker about "id". This removes the following bogus warning...

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.m
t.m:29:18: warning: incompatible pointer types assigning 'id' to 'NSString *'
    resultString = [[NSString alloc] initWithFormat:0 arguments:0];
    ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

17 years agoAdd support for Pascal strings.
Anders Carlsson [Mon, 15 Oct 2007 02:50:23 +0000 (02:50 +0000)]
Add support for Pascal strings.

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

17 years agoFix a warning
Anders Carlsson [Mon, 15 Oct 2007 02:50:04 +0000 (02:50 +0000)]
Fix a warning

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

17 years ago- Teach ObjcInterfaceDecl::lookupInstance/ClassMethod to look through protocols.
Steve Naroff [Sun, 14 Oct 2007 23:13:51 +0000 (23:13 +0000)]
- Teach ObjcInterfaceDecl::lookupInstance/ClassMethod to look through protocols.
- Start looking up methods in the global method pools (for "id").
- Start integrating interface types into the type system.

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

17 years agoAdd category lookup (removing a couple FIXME's).
Steve Naroff [Sun, 14 Oct 2007 18:27:41 +0000 (18:27 +0000)]
Add category lookup (removing a couple FIXME's).
Changed ObjcInterfaceDecl::ListCategories->CategoryList.

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

17 years agoFix -ast-dump for ObjC.
Steve Naroff [Sun, 14 Oct 2007 17:03:01 +0000 (17:03 +0000)]
Fix -ast-dump for ObjC.

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

17 years ago- Added Sema::AddFactoryMethodToGlobalPool and Sema::AddInstanceMethodToGlobalPool...
Steve Naroff [Sun, 14 Oct 2007 00:58:41 +0000 (00:58 +0000)]
- Added Sema::AddFactoryMethodToGlobalPool and Sema::AddInstanceMethodToGlobalPool and DenseMaps. This will allow us to efficiently lookup a method from a selector given no type information (for the "id" data type).

- Fixed some funky "}
                    else {" indentation in Sema::ActOnAddMethodsToObjcDecl(). I'd prefer we stay away from this style...it wastes space and isn't any easier to read (from my perspective, at least:-)

- Changed Parser::ParseObjCInterfaceDeclList() to only call Action::ActOnAddMethodsToObjcDecl() when it actually has methods to add (since most interface have methods, this is a very minor cleanup).

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

17 years agoFix an incorrect assertion.
Anders Carlsson [Sat, 13 Oct 2007 05:52:34 +0000 (05:52 +0000)]
Fix an incorrect assertion.

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

17 years agohaha, my devious plot is complete:
Chris Lattner [Sat, 13 Oct 2007 00:46:29 +0000 (00:46 +0000)]
haha, my devious plot is complete:

$ clang rewrite.c -rewrite-test
prints:

int foo() {
        b:      foo();
f:      foo();
    foo();
}

for:

int foo() {
b: foo();
f: foo();
    foo();
}

amazing.

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

17 years agoAdd __builtin_va_list definitions for x86_64 and ppc64.
Anders Carlsson [Sat, 13 Oct 2007 00:45:48 +0000 (00:45 +0000)]
Add __builtin_va_list definitions for x86_64 and ppc64.

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

17 years agoWith this I can now insert stuff before tabs, woo.
Chris Lattner [Sat, 13 Oct 2007 00:21:23 +0000 (00:21 +0000)]
With this I can now insert stuff before tabs, woo.

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

17 years agoWoo, tab deletion now works. Next lets see if we can
Chris Lattner [Sat, 13 Oct 2007 00:17:04 +0000 (00:17 +0000)]
Woo, tab deletion now works.  Next lets see if we can
insert stuff.

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

17 years agoanother step forward in rewriter stuff. This still has
Chris Lattner [Sat, 13 Oct 2007 00:11:23 +0000 (00:11 +0000)]
another step forward in rewriter stuff.  This still has
some incredibly subtle details that I'm working on getting
right.

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

17 years agoGenerate code for va_start and va_end.
Anders Carlsson [Fri, 12 Oct 2007 23:56:29 +0000 (23:56 +0000)]
Generate code for va_start and va_end.

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

17 years agoPatch to check for duplicate method decls in protocols.
Fariborz Jahanian [Fri, 12 Oct 2007 23:43:31 +0000 (23:43 +0000)]
Patch to check for duplicate method decls in protocols.

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

17 years agoremove dead method with bogus comment.
Chris Lattner [Fri, 12 Oct 2007 23:18:19 +0000 (23:18 +0000)]
remove dead method with bogus comment.

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

17 years agoCheck and diagnose that objective-c objects may not be statically allocated.
Fariborz Jahanian [Fri, 12 Oct 2007 22:10:42 +0000 (22:10 +0000)]
Check and diagnose that objective-c objects may not be statically allocated.

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

17 years agoAdded notion of '*' specified format width/specifiers when checking
Ted Kremenek [Fri, 12 Oct 2007 20:51:52 +0000 (20:51 +0000)]
Added notion of '*' specified format width/specifiers when checking
printf format strings.  Added type checking to see if the matching
width/precision argument was of type 'int'.

Thanks to Anders Carlsson for reporting this missing feature.

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

17 years agoadd a new SM::getDecomposedFileLoc method.
Chris Lattner [Fri, 12 Oct 2007 20:24:19 +0000 (20:24 +0000)]
add a new SM::getDecomposedFileLoc method.

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

17 years agoFixed typo in comment.
Fariborz Jahanian [Fri, 12 Oct 2007 19:53:08 +0000 (19:53 +0000)]
Fixed typo in comment.

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

17 years agoFixed a @compatible_alias bug. In the process, discovered unnecessary 2ndry lookup
Fariborz Jahanian [Fri, 12 Oct 2007 19:38:20 +0000 (19:38 +0000)]
Fixed a @compatible_alias bug. In the process, discovered unnecessary 2ndry lookup
ok class names and streamlined this logic to do the lookup once.

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

17 years agoReplace one FIXME with another. We handle protocols just fine now. The ObjC decl...
Steve Naroff [Fri, 12 Oct 2007 18:49:25 +0000 (18:49 +0000)]
Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)...

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

17 years agoAdd some more diagnostics for va_start, fix tests so they pass with these new diags.
Anders Carlsson [Fri, 12 Oct 2007 17:48:41 +0000 (17:48 +0000)]
Add some more diagnostics for va_start, fix tests so they pass with these new diags.

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

17 years agoFixed a bug whereby, struct tag name matches a typedef/objc-class name
Fariborz Jahanian [Fri, 12 Oct 2007 16:34:10 +0000 (16:34 +0000)]
Fixed a bug whereby, struct tag name matches a typedef/objc-class name
and hid them.

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

17 years agoTemporary fix to test case. This area is currently under construction...test case...
Steve Naroff [Fri, 12 Oct 2007 16:15:17 +0000 (16:15 +0000)]
Temporary fix to test case. This area is currently under construction...test case will be changing again soon.

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

17 years agoadd comments.
Chris Lattner [Fri, 12 Oct 2007 00:37:26 +0000 (00:37 +0000)]
add comments.

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

17 years agoPrintf argument checking now supports dynamically-passed precision
Ted Kremenek [Fri, 12 Oct 2007 00:11:27 +0000 (00:11 +0000)]
Printf argument checking now supports dynamically-passed precision
specifiers.

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

17 years agoThis patch implementa objective-c's @compatibilty-alias declaration.
Fariborz Jahanian [Thu, 11 Oct 2007 23:42:27 +0000 (23:42 +0000)]
This patch implementa objective-c's @compatibilty-alias declaration.

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

17 years agoPush the rewriting APIs along. Build a trivial client that replaces tabs
Chris Lattner [Thu, 11 Oct 2007 18:38:32 +0000 (18:38 +0000)]
Push the rewriting APIs along.  Build a trivial client that replaces tabs
with x's for now.  The APIs are all unimplemented, so it doesn't do
anything yet! :)

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

17 years agoImplemented parsing of objctive-c protocol conforming type used in
Fariborz Jahanian [Thu, 11 Oct 2007 18:08:47 +0000 (18:08 +0000)]
Implemented parsing of objctive-c protocol conforming type used in
an identifier statement. Fixed up pretty priting to print this type
correctly.

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

17 years agoadd RewriterTest.cpp to xcode project.
Chris Lattner [Thu, 11 Oct 2007 16:34:20 +0000 (16:34 +0000)]
add RewriterTest.cpp to xcode project.

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

17 years agoclarify
Chris Lattner [Thu, 11 Oct 2007 16:06:02 +0000 (16:06 +0000)]
clarify

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

17 years agoslightly simplify interface
Chris Lattner [Thu, 11 Oct 2007 03:36:41 +0000 (03:36 +0000)]
slightly simplify interface

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

17 years agoAdd __builtin_va_start to the list of builtins, make __builtin_va_list available...
Anders Carlsson [Thu, 11 Oct 2007 01:00:40 +0000 (01:00 +0000)]
Add __builtin_va_start to the list of builtins, make __builtin_va_list available to builtin functions.

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

17 years agoPatch to create protocol conforming class types.
Fariborz Jahanian [Thu, 11 Oct 2007 00:55:41 +0000 (00:55 +0000)]
Patch to create protocol conforming class types.

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

17 years agoadd scafolding to play around with and bring up the code rewriter.
Chris Lattner [Thu, 11 Oct 2007 00:43:27 +0000 (00:43 +0000)]
add scafolding to play around with and bring up the code rewriter.

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

17 years agoupdate argument.
Chris Lattner [Thu, 11 Oct 2007 00:38:03 +0000 (00:38 +0000)]
update argument.

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

17 years agorename -parse-ast-view to -ast-view
Chris Lattner [Thu, 11 Oct 2007 00:37:43 +0000 (00:37 +0000)]
rename -parse-ast-view to -ast-view

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

17 years agorename -parse-ast-print to -ast-print
Chris Lattner [Thu, 11 Oct 2007 00:18:28 +0000 (00:18 +0000)]
rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only

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

17 years agoFix 80 col violations.
Chris Lattner [Wed, 10 Oct 2007 23:42:28 +0000 (23:42 +0000)]
Fix 80 col violations.

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

17 years agofix a bunch of regressions I introduced :(
Chris Lattner [Wed, 10 Oct 2007 23:31:03 +0000 (23:31 +0000)]
fix a bunch of regressions I introduced :(

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

17 years agoRefinements to Sema::GetObjcIdType()...
Steve Naroff [Wed, 10 Oct 2007 23:24:43 +0000 (23:24 +0000)]
Refinements to Sema::GetObjcIdType()...

- Cache the typedef, not the type (avoids importing AST/Type.h).
- Emit an error if "id" cannot be found.
- Comment the routine and add a FIXME to reconsider how we emulate GCC's new fangled behavior. This isn't a priority for now, since almost no code depends on having "id" built-in.
- Add a test.

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

17 years agoCommented out header with no section body. Will write this eventually.
Ted Kremenek [Wed, 10 Oct 2007 23:22:00 +0000 (23:22 +0000)]
Commented out header with no section body.  Will write this eventually.

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

17 years agoAdded some documentation on clang CFGs. It is very rough.
Ted Kremenek [Wed, 10 Oct 2007 23:01:43 +0000 (23:01 +0000)]
Added some documentation on clang CFGs.  It is very rough.

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

17 years ago- Make sure default return/argument types (for methods) default to "id".
Steve Naroff [Wed, 10 Oct 2007 21:53:07 +0000 (21:53 +0000)]
- Make sure default return/argument types (for methods) default to "id".
- Cache the "id" type in Sema...initialize ObjcIdType and TUScope (oops).
- Fix ActOnInstanceMessage to allow for "id" type receivers...still work to do (next).

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

17 years agoavoid accessing off the end of identifiers.
Chris Lattner [Wed, 10 Oct 2007 20:59:57 +0000 (20:59 +0000)]
avoid accessing off the end of identifiers.

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

17 years agoEmit a warning when the body of an if block is a NullStmt.
Anders Carlsson [Wed, 10 Oct 2007 20:50:11 +0000 (20:50 +0000)]
Emit a warning when the body of an if block is a NullStmt.

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

17 years agoclang -E should not print tokens from the predefines buffer.
Chris Lattner [Wed, 10 Oct 2007 20:45:16 +0000 (20:45 +0000)]
clang -E should not print tokens from the predefines buffer.

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

17 years agoUpdated VC++ build system.
Hartmut Kaiser [Wed, 10 Oct 2007 19:50:45 +0000 (19:50 +0000)]
Updated VC++ build system.

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

17 years agoAdded idea for a simple C++ checker.
Ted Kremenek [Wed, 10 Oct 2007 18:52:22 +0000 (18:52 +0000)]
Added idea for a simple C++ checker.

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

17 years agoadd an idea
Chris Lattner [Wed, 10 Oct 2007 18:08:07 +0000 (18:08 +0000)]
add an idea

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

17 years agoresolve a fixme, by moving __builtin_va_list to a more logical
Chris Lattner [Wed, 10 Oct 2007 17:48:53 +0000 (17:48 +0000)]
resolve a fixme, by moving __builtin_va_list to a more logical
place and making it correctly parameterized on the target.

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

17 years agoFix a latent bug in MinimalActions (created by a recent name change).
Steve Naroff [Wed, 10 Oct 2007 17:45:44 +0000 (17:45 +0000)]
Fix a latent bug in MinimalActions (created by a recent name change).

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

17 years agoRemove Scope argument from ObjC actions that either don't need it or can now use...
Steve Naroff [Wed, 10 Oct 2007 17:32:04 +0000 (17:32 +0000)]
Remove Scope argument from ObjC actions that either don't need it or can now use TUScope.
Also improve a recently added comment.

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

17 years agoAdd a dummy for the id typedef. Steve, plz fill this in. :)
Chris Lattner [Tue, 9 Oct 2007 22:58:09 +0000 (22:58 +0000)]
Add a dummy for the id typedef.  Steve, plz fill this in. :)

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

17 years agoMake a significant change to invert the control flow handling
Chris Lattner [Tue, 9 Oct 2007 22:10:18 +0000 (22:10 +0000)]
Make a significant change to invert the control flow handling
predefined macros.  Previously, these were handled by the driver,
now they are handled by the preprocessor.

Some fallout of this:

1. Instead of preprocessing two buffers (the predefines, then the
   main source file)  we now start preprocessing the main source
   file and inject the predefines as a "psuedo #include" from the
   main source file.
2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify
   Preprocessor::isInPrimaryFile.
3. The driver doesn't have to know about standard #defines, the
   preprocessor knows, which is nice for people wanting to define
   their own drivers.
4. This allows us to put normal tokens in the predefine buffer,
   for example a definition for __builtin_va_list that is
   target-specific, and a typedef for id in objc.

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

17 years agoMake sure methods with no return type default to "id".
Steve Naroff [Tue, 9 Oct 2007 22:01:59 +0000 (22:01 +0000)]
Make sure methods with no return type default to "id".

This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added).

Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope.

Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped).

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