Commit Graph

3179 Commits

Author SHA1 Message Date
Chris Lattner dd00e625d2 add a portability fixme.
llvm-svn: 45091
2007-12-17 06:51:34 +00:00
Chris Lattner 3e206b3a0e teach RemoveDuplicates about header maps.
llvm-svn: 45090
2007-12-17 06:44:29 +00:00
Chris Lattner c4ba38ed1e Step #1 in adding headermap support to clang.
llvm-svn: 45089
2007-12-17 06:36:45 +00:00
Chris Lattner 899ff4a26d rearrange some code and make it more efficient.
llvm-svn: 45087
2007-12-17 05:59:27 +00:00
Chris Lattner 28c91c5f35 add a hack so that codegen doesn't abort on missing sema of initializers, now
we emit stuff like this:

abort on missing sema of initializers, now
we emit stuff like this:

t3.c:1:24: warning: cannot codegen this initializer yet
const char x[2][4] = { { 'a', 'b', '\0', '\0' }, { 'c', 'd', 'e', '\0' } };
                       ^~~~~~~~~~~~~~~~~~~~~~~~

This should be removed when sema is finished.

llvm-svn: 45086
2007-12-17 05:17:42 +00:00
Christopher Lamb 77560fbde7 Update to use new PointerType::getUnqual() api.
llvm-svn: 45081
2007-12-17 01:11:20 +00:00
Anders Carlsson ca6bcae0be Start generating SSE intrinsics.
llvm-svn: 45079
2007-12-16 22:33:50 +00:00
Steve Naroff eaaae467c7 Sema::ActOnMemberReferenceExpr() needs to perform the default conversions.
Bug and test case provided by Carl Lewis.

llvm-svn: 45078
2007-12-16 21:42:28 +00:00
Chris Lattner 39911a2258 swtich to smallptrset, which is more efficient than std::set.
llvm-svn: 45065
2007-12-15 23:20:07 +00:00
Chris Lattner d6658d932b make clang -v output more similar to gcc's -v output.
llvm-svn: 45064
2007-12-15 23:11:06 +00:00
Anders Carlsson f5f6544edc We now support all MMX intrinsics. SSE intrinsics are next.
llvm-svn: 45062
2007-12-15 21:23:30 +00:00
Chris Lattner 60a288ab19 simplify the interfaces to ProcessInputFile and InitializePreprocessor
llvm-svn: 45060
2007-12-15 20:48:40 +00:00
Ted Kremenek 56ba5b3931 Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to be
so useful and introduced a few bugs.

llvm-svn: 45051
2007-12-15 00:39:18 +00:00
Ted Kremenek 3291844bf0 Added "mode" to StmtIterator to record if the expression being iterated
over is the subexpression of a sizeof(expression).  Different clients
will wish to handle iteration over such subexpressions differently, and can
now easily query if they are iterating over such statements using the
StmtIterator's inSizeOfExpr().

llvm-svn: 45047
2007-12-14 23:40:56 +00:00
Steve Naroff 3ce37a6b8e - Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCategoryDecl. These methods are replaced by the respective iterators on each class.
- Add getInstanceMethodForSelector to ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCatgoryDecl. This hook will do a "shallow" lookup. This is a convenience method that reducing some of the iterator usage.
- Various changes to convert all clients to the above API's...
 

llvm-svn: 45046
2007-12-14 23:37:57 +00:00
Ted Kremenek 85e45f278c Added support to StmtIterator to traverse the size expression of a VLA type
declared in a sizeof.  For example:

 sizeof(int[foo()]);

the expression "foo()" is an expression that is executed during the evaluation
of sizeof.

llvm-svn: 45043
2007-12-14 22:52:23 +00:00
Anders Carlsson 4d3094a9bb Simplify the vector code. Add more shift intrinsics.
llvm-svn: 45035
2007-12-14 17:48:24 +00:00
Kevin c3286e9cef IE Menu Problem...
Originally, I included CSS hacks for IE.
However, my comments before the doctype was the reason IE was running in non-strict mode.  I did not know this.
When Chris removed the comments, IE correctly went into strict mode and my IE hacks were no longer needed (the hacks were getting in the way now).
solution:
*) Make sure doctype is first on all files
*) removed all IE hacks from menu.css (since the doctype issue fixes IE)

llvm-svn: 45025
2007-12-14 05:47:49 +00:00
Seo Sanghyeon d4d8c3c717 Array subscription in aggregate expression
llvm-svn: 45023
2007-12-14 02:04:12 +00:00
Seo Sanghyeon 3abb6d8435 Implement dereference operator in aggregate expression
llvm-svn: 45020
2007-12-14 01:09:11 +00:00
Ted Kremenek 7d9a2e119d CFG bug fix: for sizeof(expressions), don't expand the control-flow
of "expressions", since they are not really evaluated.

llvm-svn: 45015
2007-12-13 22:44:18 +00:00
Fariborz Jahanian c47dc4f5af Patch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceType
llvm-svn: 45014
2007-12-13 20:47:42 +00:00
Steve Naroff d78c81b6de Sema::ActOnFinishFunctionBody(): Since we no longer synthesize a FunctionDecl for each method, remove the unconditional initialization to 0 and corresponding comment.
llvm-svn: 45008
2007-12-13 18:18:56 +00:00
Ted Kremenek 2f4ab7148c Add hack to SourceManager to support missing source files during
deserialization.  Eventually this should be replaced with a lazy-reading
mechanism that only reads source files when they are needed by clients.

llvm-svn: 45007
2007-12-13 18:12:10 +00:00
Ted Kremenek 31dcdb312b Add check in the driver to see if a serialized AST file has been successfully
deserialized.

llvm-svn: 45006
2007-12-13 18:11:11 +00:00
Ted Kremenek 685dc9b56e Changed set of top-level decls from a list to a vector.
llvm-svn: 45005
2007-12-13 17:54:02 +00:00
Ted Kremenek 15ddcef648 Changed -serialize-ast to not create a temporary directory, but instead
create a .ast file in the current working directory.  This mirrors the behavior
of the -c option for gcc.  Later we should add the ability to write the
serialized file anywhere.

llvm-svn: 45004
2007-12-13 17:50:11 +00:00
Chris Lattner 60af5f3b82 Set target data layout info in module.
llvm-svn: 45003
2007-12-13 17:34:31 +00:00
Chris Lattner 69b9ea5afa typo
llvm-svn: 45002
2007-12-13 17:27:09 +00:00
Chris Lattner 2048b067a6 debug info too.
llvm-svn: 45001
2007-12-13 17:25:36 +00:00
Ted Kremenek 9f5ad6c795 Minor spelling; punctuation correction.
llvm-svn: 45000
2007-12-13 16:41:01 +00:00
Bill Wendling a5be19d3df Grammar fix: correct ' usage.
llvm-svn: 44998
2007-12-13 09:57:40 +00:00
Chris Lattner eb13c73c36 minor cleanups
llvm-svn: 44996
2007-12-13 07:47:54 +00:00
Chris Lattner 54424ad69c add some builtins.
llvm-svn: 44995
2007-12-13 07:41:58 +00:00
Chris Lattner 13653d7668 simplify some code.
llvm-svn: 44994
2007-12-13 07:34:23 +00:00
Chris Lattner 3c1334013d Don't do integer promotions of LHS for compound shift assignment. The LHS has to be a modifiable lvalue.
llvm-svn: 44993
2007-12-13 07:28:16 +00:00
Chris Lattner d7b5a9aa1a remove some dead styles.
llvm-svn: 44992
2007-12-13 06:55:59 +00:00
Chris Lattner d9c10096d7 nuke hte status page.
llvm-svn: 44991
2007-12-13 06:55:02 +00:00
Chris Lattner 196a226567 add a bunch of open projects
llvm-svn: 44990
2007-12-13 06:41:15 +00:00
Ted Kremenek 136a37f1eb Updated serialization of ParmVarDecl to serialize out objcDeclQualifier.
Previously this field was serialized out in VarDecl (a parent class), but
now the field belongs to ParmVarDecl.

llvm-svn: 44989
2007-12-13 06:28:13 +00:00
Chris Lattner a5b4965c0e split get_involved into two pages: get_started and get_involved.
llvm-svn: 44988
2007-12-13 06:20:15 +00:00
Chris Lattner 8610d2de02 wrap to 80 cols, many fixes to markup.
llvm-svn: 44985
2007-12-13 05:42:27 +00:00
Ted Kremenek 3a742d280c For uninitialized values analysis, added special treatment for declarations
of array types.  For things like:

  char x[10];
  
we should treat "x" as being initialized, because the variable "x" really
refers to the memory block of the array. Clearly x[1] is uninitialized, but
expressions like "(char*) x" really do refer to an initialized value. This
simple dataflow analysis does not reason about the contents of arrays.

This fixes: PR 1859 (http://llvm.org/bugs/show_bug.cgi?id=1859)

llvm-svn: 44984
2007-12-13 05:14:22 +00:00
Chris Lattner 2fe0dd09b3 Fix file header.
llvm-svn: 44983
2007-12-13 05:02:35 +00:00
Ted Kremenek 78dcda6059 Fixed bug in live-variable analysis and uninitialized-values analysis where
we incorrectly examine the expression within a sizeof() for use in computing
dataflow values.

This fixes: PR 1858 (http://llvm.org/bugs/show_bug.cgi?id=1858)

llvm-svn: 44982
2007-12-13 04:47:15 +00:00
Chris Lattner 52a6f82d0f use new interface.
llvm-svn: 44978
2007-12-13 02:05:09 +00:00
Chris Lattner 67671ed4b7 add a helper method.
llvm-svn: 44976
2007-12-13 01:59:49 +00:00
Devang Patel 527048247b Add assert to detect incomplete implementation work.
llvm-svn: 44974
2007-12-13 01:24:16 +00:00
Fariborz Jahanian 885890a47a Moved ObjcDeclQualifier to ParmVarDecl from VarDecl.
Ted, this change necessitates (de)/serialization of ParmVarDecl.

llvm-svn: 44972
2007-12-13 00:54:18 +00:00
Chris Lattner 70efff25be builtin id 0 is invalid, don't use a slot for it.
llvm-svn: 44968
2007-12-13 00:38:03 +00:00
Ted Kremenek ce8d55b087 Implemented -serialize-ast option for the driver. This is not really tested
and is a work in progress.

llvm-svn: 44967
2007-12-13 00:37:31 +00:00
Fariborz Jahanian 56637d127f Fixed test to match the new diagnostic text.
llvm-svn: 44966
2007-12-13 00:16:34 +00:00
Fariborz Jahanian 4d1288a67e Concatenation of objc strings.
llvm-svn: 44964
2007-12-12 23:55:49 +00:00
Chris Lattner b8bd2db8b3 fix off-by-one error.
llvm-svn: 44963
2007-12-12 23:46:36 +00:00
Ted Kremenek 8fdd3d95eb Implemented prototype mode where the driver can operate on serialized ASTs
instead of source files.

llvm-svn: 44962
2007-12-12 23:41:08 +00:00
Ted Kremenek 1daa3cfbae TargetInfo no longer includes a reference to SourceManager.
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:

    FullLoc.getManager().someMethod(FullLoc.getLocation());
    
instead we have:

    FullLoc.someMethod();
    
Modified TextDiagnostics (and related classes) to use this short-hand.

llvm-svn: 44957
2007-12-12 22:39:36 +00:00
Steve Naroff f44cb63859 Encode enumeral types.
llvm-svn: 44956
2007-12-12 22:30:11 +00:00
Ted Kremenek 9b7632eef8 Removed "NULL" from default construction of FullSourceLoc (compilation errors on
some systems).

llvm-svn: 44953
2007-12-12 19:39:40 +00:00
Ted Kremenek f82942d04c constified getFullLoc().
llvm-svn: 44951
2007-12-12 18:55:29 +00:00
Ted Kremenek febe89a6da Changes to FullSourceLoc:
- Added cstor that takes no arguments to create an "invalid" location.
  - Removed non-const version of getSourceManager().
  - Renamed getSourceManager() to getManager.
  - Remover operator SourceLocatio().

llvm-svn: 44950
2007-12-12 18:54:21 +00:00
Ted Kremenek 50d23f007f Renamed getFullSourceLoc() -> getFullLoc().
llvm-svn: 44949
2007-12-12 18:46:37 +00:00
Ted Kremenek d8bcfe27cc Added method: Preprocessor::getFullSourceLoc. Used by clients of Preprocessor
to get a FullSourceLoc from a SourceLocation.

llvm-svn: 44948
2007-12-12 18:41:40 +00:00
Ted Kremenek 23e2085701 Renamed FullContextSourceLocation to FullSourceLoc.
llvm-svn: 44947
2007-12-12 18:32:04 +00:00
Ted Kremenek 8d03cf953b Added utility static method to FullContextSourceLocation
for creating "invalid" location objects.

llvm-svn: 44946
2007-12-12 18:20:34 +00:00
Chris Lattner 83021e92ba make it a bit more clear in what way the ivar is consistent.
llvm-svn: 44945
2007-12-12 18:19:52 +00:00
Chris Lattner 85332c7534 add an ivar_size() method that never returns -1.
llvm-svn: 44944
2007-12-12 18:19:33 +00:00
Ted Kremenek ea6999a1a5 Constified a predicate method.
llvm-svn: 44943
2007-12-12 18:18:05 +00:00
Ted Kremenek fd5e5c4704 Added class FullContextSourceLocation: a tuple class that
contains both a SourceLocation and its associated
SourceManager. This class is useful for argument passing to
functions that expect both objects.

llvm-svn: 44942
2007-12-12 18:16:46 +00:00
Chris Lattner 0f29d98419 simplify some code, bump j. This fixes the remaining test failures.
llvm-svn: 44941
2007-12-12 18:11:49 +00:00
Ted Kremenek 6f6ff37b04 Moved construction of TargetInfo objects out of the Driver
and into the "Basic" library. TargetInfo objects are now
constructed from triples by calling the static method
TargetInfo::CreateTargetInfo.

llvm-svn: 44940
2007-12-12 18:05:32 +00:00
Chris Lattner dd2bffdd0b handle the -1'ness of undefined lists
llvm-svn: 44939
2007-12-12 18:02:31 +00:00
Chris Lattner 061227aa59 unbreak the build. I'm still working on test failures.
llvm-svn: 44938
2007-12-12 17:58:05 +00:00
Chris Lattner 7354e6a50e fix typo
llvm-svn: 44932
2007-12-12 08:17:45 +00:00
Chris Lattner 30d23e8289 more cleanups changing things like getInstanceVariables to iterators.
llvm-svn: 44930
2007-12-12 07:56:42 +00:00
Chris Lattner 31bc07e6cf resolve some fixmes and clean up some code by eliminating the get*Vars apis to some classes and use iterators instead.
llvm-svn: 44927
2007-12-12 07:46:12 +00:00
Chris Lattner 854f3167c0 start cleaning up interfaces for objc bits and pieces by switching to an
iterator interface.

llvm-svn: 44926
2007-12-12 07:30:05 +00:00
Chris Lattner da463fe7c1 split objc pieces of SemaDecl.cpp out into SemaDeclObjC.cpp
llvm-svn: 44925
2007-12-12 07:09:47 +00:00
Ted Kremenek 433a492f53 Added back VisitDeclStmt() to the StmtDumper, essentially reverting r44920:
http://llvm.org/viewvc/llvm-project?rev=44920&view=rev

Putting VisitDeclStmt() was motivated because it called DumpDeclarator(),
which printed out a little bit more information than just using the
child_iterator interface to visit the subexpressions of DeclStmt. To avoid
printing the initializers twice, DumpSubTree() now specially checks for
DeclStmts; in such cases it calls VisitDeclStmt() without using the
child_iterators to visit the subexpressions.

llvm-svn: 44924
2007-12-12 06:59:42 +00:00
Chris Lattner 61511e12e0 move function to a more logical location, add its grammar productions.
llvm-svn: 44923
2007-12-12 06:56:32 +00:00
Chris Lattner 074f325746 remove todo
llvm-svn: 44922
2007-12-12 06:54:22 +00:00
Ted Kremenek ee1a988bf6 Removed VisitDeclStmt(). The initializers of a DeclStmt are now automatically
printed out by DumpSubTree() via the child_iterator interface. This fixes a
bug where the initializers were being dumped twice.

llvm-svn: 44920
2007-12-12 06:44:12 +00:00
Chris Lattner 6d513f37c9 Unbreak -stats on cocoa.h
llvm-svn: 44919
2007-12-12 06:43:05 +00:00
Chris Lattner b011825453 add run lines.
llvm-svn: 44918
2007-12-12 06:22:14 +00:00
Chris Lattner 58c8be81bb add run line
llvm-svn: 44917
2007-12-12 06:20:40 +00:00
Chris Lattner 2fbe8e98c4 add runline, make this test real.
llvm-svn: 44916
2007-12-12 06:20:18 +00:00
Chris Lattner e01fc281c3 verify that tests contain RUN lines.
llvm-svn: 44915
2007-12-12 06:19:22 +00:00
Chris Lattner 840e05ba11 simplify some code.
llvm-svn: 44913
2007-12-12 06:13:27 +00:00
Chris Lattner 5c11c41203 implement correct semantic analysis for shifts. For:
int test(int x, long long y) {
  return x << y;
}

we now realize the type of the shift is int, not long long.

This fixes a fixme from june.

llvm-svn: 44912
2007-12-12 05:47:28 +00:00
Chris Lattner 2d39e07112 Simplify some code, don't force the triple to a darwin triple if non-darwin.
llvm-svn: 44911
2007-12-12 05:01:48 +00:00
Chris Lattner b8877d9c6d typo reported by Gabor Greif
llvm-svn: 44909
2007-12-12 04:22:37 +00:00
Chris Lattner c6208a72f7 Fix a codegen crash on test/CodeGen/cast.c, reported by Keith.
llvm-svn: 44908
2007-12-12 04:13:20 +00:00
Chris Lattner 4ebd7c2c19 fix typo pointed out by gordon
llvm-svn: 44906
2007-12-12 03:33:41 +00:00
Chris Lattner 47fbe949c4 fix expected errors.
llvm-svn: 44901
2007-12-12 01:15:04 +00:00
Fariborz Jahanian 27c15cca19 Add -pedantic so test passes.
llvm-svn: 44900
2007-12-12 01:06:09 +00:00
Chris Lattner e002fbea56 Add ObjC parser support for concatenated ObjC strings. Note that
this is passed to sema and ignored there, so the second part of the
string will not make it into the AST.  Passing to Fariborz to finish
Sema + AST construction.

llvm-svn: 44898
2007-12-12 01:04:12 +00:00
Fariborz Jahanian c98d956778 Implemented type checking for pointer of objects of protocol-qualified types.
Note that incompatible-protocol-qualified-types.m is currently failing. This is
unrelated to this patch and Steve is looking at the general problem of not reporting
incompitible pointer types in return stetement..

llvm-svn: 44897
2007-12-12 01:00:23 +00:00
Ted Kremenek fc095b1669 Moved creation of SourceManager, HeaderSearch, TargetInfo, and LangOptions
into the loop that processes input files. These will soon become translation
unit specific (with the exception of LangOptions).

llvm-svn: 44893
2007-12-11 23:28:38 +00:00
Chris Lattner f641255a86 simplify code now that isConstantExpr really does always
return a loc.

llvm-svn: 44890
2007-12-11 23:15:04 +00:00
Chris Lattner 255e1323f3 Fix a case where we'd return "is not a constant expr" without
return a location.

llvm-svn: 44889
2007-12-11 23:11:17 +00:00
Fariborz Jahanian 16e703ade5 80-column please.
llvm-svn: 44888
2007-12-11 23:04:08 +00:00
Ted Kremenek 89fbadd3be Modified the internals of Diagnostic and DiagnosticClient to use
SourceManager*'s instead of SourceManager&'s. This allows the client specify a
NULL SourceManager when using a default constructed SourceLocation. Thus the
SourceManager can be NULL when the SourceLocation's isValid() == false.

The interface to most clients of Diagnostic remains the same.
Diagnostic::Report() is overload to either accept a SourceLocation and a
SourceManager&, or neither. Thus clients that do not have a SourceManager
cannot specify a SourceLocation.

Modified TextDiagnostics* to use this new interface.
Modified the driver to not passed in SourceManager when warning about "-I-".

llvm-svn: 44887
2007-12-11 22:57:35 +00:00
Fariborz Jahanian 4e56ed5fab Implemented rewriting of protocol-qualified global variable types.
Re-implemented some of rewriting of protocol-qualified function 
argument types to support it in its generality.

llvm-svn: 44886
2007-12-11 22:50:14 +00:00
Chris Lattner 3487a3009b gcc supports more targets.
llvm-svn: 44885
2007-12-11 22:32:45 +00:00
Chris Lattner 95f80da9fb update pch discussion
llvm-svn: 44884
2007-12-11 22:29:38 +00:00
Chris Lattner a6b103a3c3 improve title
llvm-svn: 44883
2007-12-11 22:26:03 +00:00
Chris Lattner 6931189378 add a con of clang vs gcc
llvm-svn: 44882
2007-12-11 22:22:59 +00:00
Devang Patel b37b12d102 Match union field type when member expression is u->x
llvm-svn: 44879
2007-12-11 21:33:16 +00:00
Ted Kremenek d4e5fbacab Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.

Modified all users of Diagnostics to comply with this new interface.

Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).

Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.

llvm-svn: 44878
2007-12-11 21:27:55 +00:00
Fariborz Jahanian c86ee9ce90 Refactor Rewritetest::RewriteObjcQualifiedInterfaceTypes in preparation for more
general use.

llvm-svn: 44876
2007-12-11 19:56:36 +00:00
Devang Patel e3f9fa6322 Refactor bit-field handling code into a separate method.
No functionality change.

llvm-svn: 44875
2007-12-11 19:51:39 +00:00
Fariborz Jahanian 3b5dca2533 For @optional unimplemented methods do not issue the warning.
llvm-svn: 44872
2007-12-11 19:10:26 +00:00
Fariborz Jahanian 251a943ce9 Fixed a parsing bug whereby @optional/@required keyword is not followed by
a method declaration.

llvm-svn: 44870
2007-12-11 18:34:51 +00:00
Chris Lattner 8975f49065 mention pork
llvm-svn: 44857
2007-12-11 07:59:50 +00:00
Chris Lattner 29a16af8de properly namespacify.
llvm-svn: 44845
2007-12-11 04:36:28 +00:00
Chris Lattner 63ba2c06c4 fix a build issue with non-apple-gcc-4.0 compilers.
llvm-svn: 44844
2007-12-11 04:33:00 +00:00
Steve Naroff 5cace62e66 Avoid the first person in a recently added comment.
llvm-svn: 44843
2007-12-11 03:38:03 +00:00
Steve Naroff 3f1223cb06 - Tweak several tests to be compatible with my last commit.
- Add a test to message.m for an unusual case for GCC compat (as suggested by Chris).

llvm-svn: 44842
2007-12-11 03:34:41 +00:00
Anders Carlsson f1c18350e3 Generate more builtins.
llvm-svn: 44841
2007-12-11 03:09:22 +00:00
Steve Naroff c30dcf1251 Change err_undef_protocolref to warn_undef_protocolref (this is consistent with GCC).
llvm-svn: 44840
2007-12-11 02:44:30 +00:00
Anders Carlsson eee7566205 Generate code for some more intrinsics.
llvm-svn: 44839
2007-12-11 02:25:54 +00:00
Chris Lattner 11fbda2b5a Reimplement support for strings that initialize global inits now that
the types are right in sema.  Thanks Steve.

llvm-svn: 44834
2007-12-11 01:38:45 +00:00
Devang Patel 7ae82e7305 Separate access field number is not required.
llvm-svn: 44833
2007-12-11 01:23:33 +00:00
Devang Patel 113bd8be70 Beautify comment.
llvm-svn: 44831
2007-12-11 00:54:19 +00:00
Devang Patel ab6aadb34a Add support to share llvm fields for bit-fields.
For example, struct { char a; short b:2; };

llvm-svn: 44830
2007-12-11 00:49:18 +00:00
Steve Naroff f727faf2ed Explicitly set the string literal type from "char *" to "constant array of char".
At this point, I am fairly certain the front-end is correct. Unfortunately, the back-end is still unhappy.

That said, I've commented out the two lines in globalinit.c that are causing problems.

Chris, please have a look...thanks!

llvm-svn: 44823
2007-12-11 00:00:01 +00:00
Ted Kremenek c0870605be Fixed bug in CFG::PopulateBlkExprMap where the ordering
between fetching the size of the expression map (for use as
the next integer id for an Expr*) and the creation of the
entry in the map could be non-deterministic.  This could
cause the size of the map to be incremented prior to the
index being determine.

On Linux the map entry would be created first, causing the
map to the "size" to be incremented prior to it being
queried. On Mac OS X we had the reverse behavior. Now the
size is always queried prior to the new id being inserted
into the map.

This was the real cause of the bit-overrun triggered in
PR 1847:

  http://llvm.org/bugs/show_bug.cgi?id=1847
  
Also reverted the change in patch 44813, which was a bogus
fix to this problem:

  http://llvm.org/viewvc/llvm-project?rev=44813&view=rev

llvm-svn: 44822
2007-12-10 23:58:39 +00:00
Ted Kremenek f182e81d85 Added missing inclusion of stdarg.h. Now CGExprScalar.cpp
compiles again on Linux.

llvm-svn: 44821
2007-12-10 23:44:32 +00:00
Steve Naroff 91f78080e3 Add support for initializing char arrays from string literals.
Adapted from a patch by Anders Carlsson.

llvm-svn: 44816
2007-12-10 22:44:33 +00:00
Ted Kremenek b4785e3054 Fixed off-by-one-error when resizing Bitvectors used for
dataflow analysis over expressions and decls.

This should fix bug 1847:

http://llvm.org/bugs/show_bug.cgi?id=1847

Thanks to Török Edwin for providing a test case that
identified the problem.

llvm-svn: 44813
2007-12-10 22:01:22 +00:00
Chris Lattner 433fb26707 add support for implicit cast from array to pointer that is not the element
type.

llvm-svn: 44809
2007-12-10 19:50:32 +00:00
Anders Carlsson d0113e4be3 Revert change that broke the build.
llvm-svn: 44808
2007-12-10 19:46:20 +00:00
Chris Lattner e665077f9a disable case that makes this fail.
llvm-svn: 44807
2007-12-10 19:44:50 +00:00
Anders Carlsson b9eb82c3ee Add EmitShuffleVector helper method.
llvm-svn: 44806
2007-12-10 19:35:18 +00:00
Anders Carlsson dc16e8f299 Address comments from Chris.
llvm-svn: 44804
2007-12-10 19:30:18 +00:00
Chris Lattner 456078d50d minor edits.
llvm-svn: 44801
2007-12-10 18:56:37 +00:00
Devang Patel b3ae8d7dc2 Add assert to flag incomplete bit-field support.
llvm-svn: 44800
2007-12-10 18:52:06 +00:00
Devang Patel 3c31b54b47 Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
llvm-svn: 44799
2007-12-10 18:37:40 +00:00
Devang Patel bb5c0d8960 Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
llvm-svn: 44798
2007-12-10 18:25:34 +00:00
Ted Kremenek 256a15d532 Added newline to end of file.
llvm-svn: 44797
2007-12-10 18:01:25 +00:00
Chris Lattner 80c54698e8 be more clear about what we are comparing.
llvm-svn: 44795
2007-12-10 17:38:50 +00:00
Anders Carlsson 1b9853a9f8 Forgot this file.
llvm-svn: 44790
2007-12-10 08:48:18 +00:00
Chris Lattner c3307e2418 fixes, thanks to Nico Weber
llvm-svn: 44789
2007-12-10 08:21:12 +00:00
Chris Lattner 428760a6e6 clean up the TOC.
llvm-svn: 44788
2007-12-10 08:19:29 +00:00
Chris Lattner e396aaae28 finish the features description.
llvm-svn: 44787
2007-12-10 08:12:49 +00:00
Chris Lattner b6a8cfea24 now with hackability.
llvm-svn: 44784
2007-12-10 07:23:52 +00:00
Chris Lattner aa085d36e2 reorganize features, expound on a couple more.
llvm-svn: 44783
2007-12-10 07:14:08 +00:00
Chris Lattner e404df76c0 incorporate suggestions from Joel Nelson.
llvm-svn: 44782
2007-12-10 06:01:32 +00:00
Chris Lattner f572f3364d start making features be a more detailed description of the features/goals section on the main page.
llvm-svn: 44781
2007-12-10 05:52:05 +00:00
Chris Lattner 27a2709cfb add toc
llvm-svn: 44780
2007-12-10 05:23:01 +00:00
Chris Lattner b072569682 don't duplicate goals on the features page.
llvm-svn: 44779
2007-12-10 05:20:47 +00:00
Chris Lattner ab44e15ce7 update status
llvm-svn: 44778
2007-12-10 05:11:40 +00:00
Chris Lattner fdfd014270 edits, switch the goals/why section.
llvm-svn: 44777
2007-12-10 05:10:14 +00:00
Chris Lattner 5a7359c8c2 minor edits
llvm-svn: 44776
2007-12-10 05:06:15 +00:00
Chris Lattner e31cd5b564 add link to comparison page.
llvm-svn: 44763
2007-12-10 02:25:51 +00:00
Chris Lattner 609f9ccb2c Be more positive! Add to sidebar.
llvm-svn: 44762
2007-12-10 02:24:44 +00:00
Chris Lattner 10ebf4dcb1 updates.
llvm-svn: 44761
2007-12-10 02:18:15 +00:00
Chris Lattner 3fbe73bef2 minor edits
llvm-svn: 44759
2007-12-10 02:05:32 +00:00
Chris Lattner cf7cb4bbdd make more positive.
llvm-svn: 44758
2007-12-10 01:52:24 +00:00
Chris Lattner 78eeea2ce9 Add a "comparing clang to other compilers" page, to help resolve some FAQ's.
llvm-svn: 44754
2007-12-10 01:44:24 +00:00
Chris Lattner 7f0ad21480 lots of this is done.
llvm-svn: 44753
2007-12-10 00:14:49 +00:00
Chris Lattner cb04ac9599 abort when we lower an initializer to the wrong type, as we currently do for:
char text[] = "string";

llvm-svn: 44752
2007-12-10 00:05:55 +00:00
Chris Lattner 686628e052 extend or truncate the initializer for a string initializer to match its type.
llvm-svn: 44751
2007-12-10 00:00:56 +00:00
Chris Lattner c25c42f3ca Implement codegen support for:
char text[8] = "string";

Big fixme remains.

llvm-svn: 44750
2007-12-09 23:49:42 +00:00
Anders Carlsson 92c4e44da1 Address Chris's comments.
llvm-svn: 44749
2007-12-09 23:39:18 +00:00
Anders Carlsson 895af08562 Move target specific builtin IDs to TargetBuiltins.h so that they can be used by CGBuiltin.cpp
llvm-svn: 44748
2007-12-09 23:17:02 +00:00
Chris Lattner 4d62f42eba Implement correct semantic analysis of subtractions, implementing
C99 6.5.6.

llvm-svn: 44746
2007-12-09 21:53:25 +00:00
Anders Carlsson 8e1d8cf241 Implement __builtin_ia32_mulps.
llvm-svn: 44745
2007-12-09 21:51:19 +00:00
Anders Carlsson a020c43034 Generate code for target specific intrinsics.
llvm-svn: 44744
2007-12-09 21:20:04 +00:00
Chris Lattner 3ed83c1c0f The flags on tokens indicate whether they are the start of a *physical* line,
not the start of a logical line.  Be careful about this distinction, which 
affects when newlines are printed and when paste-avoidance happens, etc.  
This fixes PR1848, thanks to Neil for noticing this!

llvm-svn: 44743
2007-12-09 21:11:08 +00:00
Chris Lattner 84f450789a Fix a pretty big but subtle bug counting the number of newlines to emit.
This would cause us to emit different code (in -E mode) for these two files:

---
#define t(x) x

t(a
3)
---
#define t(x) x
t(a
3)
---

In one case, -E would print "a\n3", in the other it printed "a3".  Now
it prints "a3" for both.

This is part of PR1848.

llvm-svn: 44742
2007-12-09 20:45:43 +00:00
Chris Lattner 615315f307 Add dumping support for locations, make -dumptokens print out the location
info of each token.

llvm-svn: 44741
2007-12-09 20:31:55 +00:00
Chris Lattner 93cd101e5c Fix typo noticed by Nico Weber
llvm-svn: 44739
2007-12-09 17:50:14 +00:00
Chris Lattner 7566350b74 many edits to the main page, add a prominant 'status' section.
llvm-svn: 44737
2007-12-09 09:05:23 +00:00
Chris Lattner d93d0fc79a unindent, don't zap whitespace before/after paragraphs.
llvm-svn: 44736
2007-12-09 08:40:26 +00:00
Chris Lattner dffc79530a simplify the menu css, make it a bit more attractive.
llvm-svn: 44735
2007-12-09 08:38:01 +00:00
Chris Lattner fc3b9bfea8 cleanup some markup, e.g. & -> &amp;
llvm-svn: 44734
2007-12-09 08:17:09 +00:00
Chris Lattner 9c4aad2dba avoid ///usr/include/foo.h, patch by Sean Middleditch
llvm-svn: 44731
2007-12-09 00:39:55 +00:00
Chris Lattner 283d094b75 implement support for functions that initialize globals.
llvm-svn: 44730
2007-12-09 00:36:01 +00:00
Anders Carlsson 050f494f66 Add getTargetPrefix to TargetInfo, to be used with target specific intrinsics.
llvm-svn: 44712
2007-12-08 19:32:57 +00:00
Fariborz Jahanian 8ea0779624 Test case for my last patch for implementation of static protocoled type
used as reciver type of a message expression.

llvm-svn: 44693
2007-12-08 01:00:55 +00:00
Steve Naroff 1f6ed92dbb Omit the field name when including the super class structure template.
This allows us to access a superclasses ivars without deriving the absolute path.

The comments below say a bit more...

llvm-svn: 44688
2007-12-07 22:15:58 +00:00
Fariborz Jahanian ff6a455c12 Implemented when static typing is combined with protocols and use as receiver
type.

llvm-svn: 44685
2007-12-07 21:21:21 +00:00
Steve Naroff 2c20c38ced Have Sema::CheckConstantInitList skip semantic analysis when the element type is a record (until we implement the FIXME). This removes a bogus error for the following code...
snarofflocal% cat bug.m

#import <Foundation/NSGeometry.h>

#define NUMHELICOPTERRECTS 5

static NSRect helicopterRects[NUMHELICOPTERRECTS] = {
    {{27, 0}, {18, 11}},	// Bottom
    {{0, 8}, {4, 11}},		// Tail
    {{0, 16}, {50, 1}},
    {{22, 5}, {18, 12}},	// Body
    {{0, 10}, {42, 3}}
};

llvm-svn: 44684
2007-12-07 21:12:53 +00:00
Steve Naroff 888f33cc44 Lookup methods in the global pool even when a statically typed object's class interface isn't in scope!
As the comment in the code indicates, I'm not fond of this. Nevertheless, gcc compat is a goal.

Here is the case I'm talking about...

#import <Foundation/Foundation.h>

@interface AnyClass : NSObject
- (NSRect)rect;
@end

@class Helicopter;

static void func(Helicopter *obj) {
  NSRect r = [obj rect];
}

...before this patch, we would warn/error. With this patch, everything "just works".

llvm-svn: 44682
2007-12-07 20:41:14 +00:00
Fariborz Jahanian 33c0e815f3 Patch for rewriting of @protocol.
llvm-svn: 44681
2007-12-07 18:47:10 +00:00
Steve Naroff b2f8ff153d Rewrite 'super' within a class method. This required some minor tweaks to the front-end.
llvm-svn: 44673
2007-12-07 03:50:46 +00:00
Fariborz Jahanian 2bbd03a755 Patch to implement "Protocol" as a built-in type declared as
"@class Protocol;"

llvm-svn: 44670
2007-12-07 00:18:54 +00:00
Anders Carlsson 10c6110fca Add workaround to get test/Parser/compound_literal.c working again.
llvm-svn: 44666
2007-12-06 20:10:20 +00:00
Fariborz Jahanian 227c0d13bc On Steve's suggestion, moved handling of use of undeclared method in a message
to rewriter (my previous patch).

llvm-svn: 44665
2007-12-06 19:49:56 +00:00
Devang Patel 65a2288eef More struct bitfields layout work. Now handle,
struct STestB1 {char a; char b:2; } stb1;
struct STestB2 {char a; char b:5; char c:4} stb2;

llvm-svn: 44664
2007-12-06 19:16:05 +00:00
Fariborz Jahanian 6b644a6e05 test case for my very last patch.
llvm-svn: 44662
2007-12-06 17:43:04 +00:00
Chris Lattner b36a98e9a3 Fix a bug handling typedefs of functions, patch by Nuno Lopes!
llvm-svn: 44661
2007-12-06 17:20:20 +00:00
Chris Lattner 9bc22b4838 make it more clear what 'foo' is
llvm-svn: 44653
2007-12-06 04:20:07 +00:00
Fariborz Jahanian c277f6f351 A missing method in a messaging expression issues a warning, clients must not
crash because of this.

llvm-svn: 44648
2007-12-06 01:37:55 +00:00
Ted Kremenek 260d01d6e6 Subdivided the function InitializeBaseLanguage into InitializeBaseLanguage,
GetLanguage, and InitializeLangOptions.  The goal is to break up this logic
into atomic units of functionality that can later be refactored into better
driver logic that is capable of handling a mixture of source files of
different languages.

llvm-svn: 44642
2007-12-05 23:49:08 +00:00
Chris Lattner 2ed8f31f2f Avoid passing Diags into InitializeIncludePaths.
llvm-svn: 44639
2007-12-05 23:24:17 +00:00
Steve Naroff 152dd812b2 Make sure Parser::ParseObjCSelectorExpression() handles unary selectors (with no arguments) properly.
llvm-svn: 44636
2007-12-05 22:21:29 +00:00
Ted Kremenek cdcf6dcbcb Removed dependence on including iostream (use llvm/Support/Streams.h instead).
llvm-svn: 44635
2007-12-05 22:21:13 +00:00
Ted Kremenek e095881856 Converted SerializationTest (--test-pickling) to use the new TranslationUnit
class to serialize and deserialize translation units.

llvm-svn: 44634
2007-12-05 22:08:43 +00:00
Steve Naroff ff9f8efe4d Make sure the class methods get attached to the metaclass object.
Need to query the implementation, not the interface...

llvm-svn: 44633
2007-12-05 21:49:40 +00:00