]> granicus.if.org Git - clang/log
clang
14 years agoIt's OK to use nullptr in relational operators if the other side is a null pointer...
Anders Carlsson [Thu, 4 Nov 2010 03:17:43 +0000 (03:17 +0000)]
It's OK to use nullptr in relational operators if the other side is a null pointer constant.

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

14 years agoc-index-test: Switch to using clang_executeOnThread instead of mucking about
Daniel Dunbar [Thu, 4 Nov 2010 01:26:31 +0000 (01:26 +0000)]
c-index-test: Switch to using clang_executeOnThread instead of mucking about
with system specific stuff.

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

14 years agolibclang: Add clang_executeOnThread, for use in c-index-test (and only there,
Daniel Dunbar [Thu, 4 Nov 2010 01:26:29 +0000 (01:26 +0000)]
libclang: Add clang_executeOnThread, for use in c-index-test (and only there,
preferably). Good thing c-index-test is written in C!!!!

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

14 years agoadd a comment to my last commit
Douglas Gregor [Thu, 4 Nov 2010 00:14:23 +0000 (00:14 +0000)]
add a comment to my last commit

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

14 years agoWhen canonicalizing nested-name-specifiers involving dependent names
Douglas Gregor [Thu, 4 Nov 2010 00:09:33 +0000 (00:09 +0000)]
When canonicalizing nested-name-specifiers involving dependent names
or dependent specializations, rip apart the dependent name/dependent
specialization to recanonicalize its pieces, because
nested-name-specifiers store "dependent-type::identifier" differently
than types do. Fixes PR7419.

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

14 years agoFixes a rewriting bug when type in a block argument type
Fariborz Jahanian [Wed, 3 Nov 2010 23:50:34 +0000 (23:50 +0000)]
Fixes a rewriting bug when type in a  block argument type
is a objc qualified class type. // rdar: //8608902

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

14 years agoPatch to rewrite objc qualified types which occur in
Fariborz Jahanian [Wed, 3 Nov 2010 23:29:24 +0000 (23:29 +0000)]
Patch to rewrite objc qualified types which occur in
block pointer type arguments. Partial fix for
// rdar: //8608902

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

14 years agoImplement -working-directory.
Argyrios Kyrtzidis [Wed, 3 Nov 2010 22:45:23 +0000 (22:45 +0000)]
Implement -working-directory.

When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
 the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
 file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

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

14 years agoFix an assertion.
Argyrios Kyrtzidis [Wed, 3 Nov 2010 22:45:13 +0000 (22:45 +0000)]
Fix an assertion.

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

14 years agoMake this error less specific but also less likely to cause confusion. Fixes
Nick Lewycky [Wed, 3 Nov 2010 17:52:57 +0000 (17:52 +0000)]
Make this error less specific but also less likely to cause confusion. Fixes
PR7702.

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

14 years agoWhen producing overload candidates for binary built-in operators, keep
Douglas Gregor [Wed, 3 Nov 2010 17:00:07 +0000 (17:00 +0000)]
When producing overload candidates for binary built-in operators, keep
the sets of available conversions for the first and second arguments
separate. This is apparently the indent of C++ [over.built], and
reduces the number of overload candidates generated, eliminating some
ambiguities. Fixes PR8477.

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

14 years agoSome fixes for synthesized ivar metadata (GNU runtime).
David Chisnall [Wed, 3 Nov 2010 16:12:44 +0000 (16:12 +0000)]
Some fixes for synthesized ivar metadata (GNU runtime).

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

14 years agoAdded cursor visitor that takes a block as an argument. Tested compiling
David Chisnall [Wed, 3 Nov 2010 14:12:26 +0000 (14:12 +0000)]
Added cursor visitor that takes a block as an argument.  Tested compiling
libclang with both clang -fblocks and gcc (no blocks support).  Only exposed in
the header to compilers that do have blocks support.

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

14 years agofix test case.
Zhongxing Xu [Wed, 3 Nov 2010 11:24:56 +0000 (11:24 +0000)]
fix test case.

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

14 years agoDo not add elidable CXXConstructExpr as block-level expr.
Zhongxing Xu [Wed, 3 Nov 2010 11:14:06 +0000 (11:14 +0000)]
Do not add elidable CXXConstructExpr as block-level expr.

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

14 years agoAdded generating destructors for temporary objects. Two cases I know of, that are...
Marcin Swiderski [Wed, 3 Nov 2010 06:19:35 +0000 (06:19 +0000)]
Added generating destructors for temporary objects. Two cases I know of, that are not handled properly:
1. For statement: const C& c = C(0) ?: C(1) destructors generated for condition will not differ from those generated for case without prolonged lifetime of temporary,
2. There will be no destructor for constant reference member bound to temporary at the exit from constructor.

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

14 years agoRevert while I debug test failures :-(
Rafael Espindola [Wed, 3 Nov 2010 04:43:56 +0000 (04:43 +0000)]
Revert while I debug test failures :-(

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

14 years agoSwitch clang to run ld directly on linux. I tested this on all the linux
Rafael Espindola [Wed, 3 Nov 2010 04:37:51 +0000 (04:37 +0000)]
Switch clang to run ld directly on linux. I tested this on all the linux
distros listed by running

gcc main.o -o main
g++ main.o -o main
gcc main.o -o main -static
g++ main.o -o main -static
gcc f.o -o f.so -shared
g++ f.o -o f.so -shared

and comparing the ld line with the one created by clang. I also added
-m32/m64 in distros that support it.

While I tested many distros, there will always be more. If you are hit by this
it should be somewhat easy to add your distro. If you are in a hurry, do
revert this, but please inform how to detect you distro and the ld command
lines produced by the above gcc invocations. Most distros have some patches
on gcc :-(

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

14 years agoWhen setting a tied check if it's already tied. If it's tied to another constraint...
Anders Carlsson [Wed, 3 Nov 2010 02:54:51 +0000 (02:54 +0000)]
When setting a tied check if it's already tied. If it's tied to another constraint it's invalid. Fixes PR3905.

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

14 years agoA number in an input constraint can't point to a read-write ('+') constraint. Fixes...
Anders Carlsson [Wed, 3 Nov 2010 02:22:29 +0000 (02:22 +0000)]
A number in an input constraint can't point to a read-write ('+') constraint. Fixes PR3904.

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

14 years agoProvide an error when a non-identifier name (such as an operator) is used as a
Sean Hunt [Wed, 3 Nov 2010 01:07:06 +0000 (01:07 +0000)]
Provide an error when a non-identifier name (such as an operator) is used as a
parameter name.

Fixes PR8012.

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

14 years agoImprove source-location information for CXXConstructExpr nodes, by
Douglas Gregor [Wed, 3 Nov 2010 00:35:38 +0000 (00:35 +0000)]
Improve source-location information for CXXConstructExpr nodes, by
ensuring that they cover all of their child nodes. There's still a
clang_getCursor()-related issue with CXXFunctionalCastExprs with
CXXConstructExprs as children (see FIXME in the test case); I'll look
at that separately.

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

14 years agoDon't add Decls with an invalid location to DeclsInContainer.
Ted Kremenek [Tue, 2 Nov 2010 23:17:51 +0000 (23:17 +0000)]
Don't add Decls with an invalid location to DeclsInContainer.

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

14 years agoHack to workaround deficiency in ObjC ASTs. Functions and variables may be declared
Ted Kremenek [Tue, 2 Nov 2010 23:10:24 +0000 (23:10 +0000)]
Hack to workaround deficiency in ObjC ASTs.  Functions and variables may be declared
within an @implementation, but we have no way to record that information in the AST.
This may cause CursorVisitor to miss these Decls when doing a AST walk.

Fixes <rdar://problem/8595462>.

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

14 years agoTests for inline asm constraints, generic and x86.
John Thompson [Tue, 2 Nov 2010 23:03:52 +0000 (23:03 +0000)]
Tests for inline asm constraints, generic and x86.

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

14 years agoAdd link to LLVM releases page.
Daniel Dunbar [Tue, 2 Nov 2010 22:34:04 +0000 (22:34 +0000)]
Add link to LLVM releases page.

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

14 years agoFixes an assertion violation when bind to temporary
Fariborz Jahanian [Tue, 2 Nov 2010 21:05:53 +0000 (21:05 +0000)]
Fixes an assertion violation when bind to temporary
expression is a dependent expression.
// rdar: // 8620524 and PR7851

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

14 years agoEnsure that static local variables in function templates inherit the
John McCall [Tue, 2 Nov 2010 21:04:24 +0000 (21:04 +0000)]
Ensure that static local variables in function templates inherit the
visibility of their function.

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

14 years agoTeach code completion to provide property results when the property
Douglas Gregor [Tue, 2 Nov 2010 20:36:02 +0000 (20:36 +0000)]
Teach code completion to provide property results when the property
can be used to automatically synthesize an ivar.

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

14 years agoDriver: Silently ignore -fasm-blocks for now instead of error'ing, this cause
Daniel Dunbar [Tue, 2 Nov 2010 19:42:04 +0000 (19:42 +0000)]
Driver: Silently ignore -fasm-blocks for now instead of error'ing, this cause
some unexpected fallout.

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

14 years agoAdd support for Fedora 14. Patch by Daniel Kozlowski.
Rafael Espindola [Tue, 2 Nov 2010 18:39:34 +0000 (18:39 +0000)]
Add support for Fedora 14. Patch by Daniel Kozlowski.

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

14 years agoUnbreak private_extern, which apparently we had zero tests for.
John McCall [Tue, 2 Nov 2010 18:38:13 +0000 (18:38 +0000)]
Unbreak private_extern, which apparently we had zero tests for.

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

14 years agoFix a crash mangling decayed val argument-typed function.
Fariborz Jahanian [Tue, 2 Nov 2010 16:54:00 +0000 (16:54 +0000)]
Fix a crash mangling decayed val argument-typed function.
// rdar: //8620510 and PR7666

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

14 years agoProperly handle temporaries that are created in a AsmStmt.
Argyrios Kyrtzidis [Tue, 2 Nov 2010 02:33:08 +0000 (02:33 +0000)]
Properly handle temporaries that are created in a AsmStmt.

Previously the temporaries would get destroyed before the asm call.

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

14 years agoIgnore attributes on classes when calculating visibility for members
John McCall [Tue, 2 Nov 2010 01:45:15 +0000 (01:45 +0000)]
Ignore attributes on classes when calculating visibility for members
with their own explicit visibility attributes.  Basically we only want to
apply a single visibility attribute from any particular ancestry.

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

14 years agoDiagnose a coherant message when @interface
Fariborz Jahanian [Tue, 2 Nov 2010 00:44:43 +0000 (00:44 +0000)]
Diagnose a coherant message when @interface
does not terminate with @end.
// rdar: //7824372

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

14 years agoTeach SourceManager::getPresumedLoc() how to fail gracefully if getLineNumber/getColu...
Douglas Gregor [Tue, 2 Nov 2010 00:39:22 +0000 (00:39 +0000)]
Teach SourceManager::getPresumedLoc() how to fail gracefully if getLineNumber/getColumnNumber fail

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

14 years agoWhen performing template argument deduction against a template-id,
Douglas Gregor [Tue, 2 Nov 2010 00:02:34 +0000 (00:02 +0000)]
When performing template argument deduction against a template-id,
only keep deduction results for successful deductions, so that they
can be compared against each other. Fixes PR8462, from Richard Smith!

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

14 years agoMake my test case test what it meant to
Douglas Gregor [Mon, 1 Nov 2010 23:33:11 +0000 (23:33 +0000)]
Make my test case test what it meant to

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

14 years agoEncapsulate within CXCursor the notion of whether a VarDecl* is the first Decl in...
Ted Kremenek [Mon, 1 Nov 2010 23:26:51 +0000 (23:26 +0000)]
Encapsulate within CXCursor the notion of whether a VarDecl* is the first Decl in a DeclGroup.  We use this
to recover some context that is currently not modeled directly in the AST.  Currently VarDecl's cannot
properly determine their source range because they have no context on whether or not they appear in a DeclGroup.
For the meantime, this bandaid suffices in libclang since that is where the correct SourceRange is directly needed.

Fixes <rdar://problem/8595749>.

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

14 years agoTeach the CStringChecker and PthreadLockChecker about non-identifier
Douglas Gregor [Mon, 1 Nov 2010 23:16:05 +0000 (23:16 +0000)]
Teach the CStringChecker and PthreadLockChecker about non-identifier
declaration names, from Jim Goodnow II!

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

14 years agoEliminate an unused local variable
Douglas Gregor [Mon, 1 Nov 2010 21:56:54 +0000 (21:56 +0000)]
Eliminate an unused local variable

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

14 years agoClean up temporaries created by an asm statement. Fixes rdar://8540491
Argyrios Kyrtzidis [Mon, 1 Nov 2010 21:51:42 +0000 (21:51 +0000)]
Clean up temporaries created by an asm statement. Fixes rdar://8540491

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

14 years agoHarden Sema::MaybeBindTotemporary.
Douglas Gregor [Mon, 1 Nov 2010 21:10:29 +0000 (21:10 +0000)]
Harden Sema::MaybeBindTotemporary.

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

14 years agoRestore patch for PR8453 which was undone in r117829
Fariborz Jahanian [Mon, 1 Nov 2010 20:47:16 +0000 (20:47 +0000)]
Restore patch for PR8453 which was undone in r117829
(was project bugs).

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

14 years agoDo not compare invalid source locations
Douglas Gregor [Mon, 1 Nov 2010 20:13:04 +0000 (20:13 +0000)]
Do not compare invalid source locations

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

14 years agoEmit error when using a bound member function for something other than calling it.
Argyrios Kyrtzidis [Mon, 1 Nov 2010 18:49:26 +0000 (18:49 +0000)]
Emit error when using a bound member function for something other than calling it.

Also avoids IRGen crashes due to accepting invalid code.

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

14 years agoRequire that the types of the parameters of a block literal are complete.
Douglas Gregor [Mon, 1 Nov 2010 18:37:59 +0000 (18:37 +0000)]
Require that the types of the parameters of a block literal are complete.

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

14 years agoSimplify. Builtin types' context is always implied.
Devang Patel [Mon, 1 Nov 2010 16:52:40 +0000 (16:52 +0000)]
Simplify. Builtin types' context is always implied.

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

14 years agoDon't update empty field subobjects for bitfields. Fixes PR8519.
Anders Carlsson [Mon, 1 Nov 2010 15:14:51 +0000 (15:14 +0000)]
Don't update empty field subobjects for bitfields. Fixes PR8519.

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

14 years agoPlug a leak in the preprocessing record's handling of inclusion
Douglas Gregor [Mon, 1 Nov 2010 15:03:47 +0000 (15:03 +0000)]
Plug a leak in the preprocessing record's handling of inclusion
directives. We had a std::string in an object that was allocated via a
BumpPtrAllocator.

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

14 years agoDisable some timing code
Douglas Gregor [Mon, 1 Nov 2010 13:48:43 +0000 (13:48 +0000)]
Disable some timing code

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

14 years agoExplicitly handle CXXBindTemporaryExpr, CXXFunctionalCastExpr,
Zhongxing Xu [Mon, 1 Nov 2010 13:04:58 +0000 (13:04 +0000)]
Explicitly handle CXXBindTemporaryExpr, CXXFunctionalCastExpr,
and ImplicitCastExpr to propagate asLValue AddStmtChoice property.
But do not propagate AlwaysAdd property.

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

14 years agoNow initializer of C++ record type is visited as block-level expr.
Zhongxing Xu [Mon, 1 Nov 2010 09:09:44 +0000 (09:09 +0000)]
Now initializer of C++ record type is visited as block-level expr.
Let the destination of AggExprVisitor be an explicit MemRegion.
Reenable the test case.

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

14 years agoMake all CXXConstructExpr's block-level expressions. This is required by
Zhongxing Xu [Mon, 1 Nov 2010 06:46:05 +0000 (06:46 +0000)]
Make all CXXConstructExpr's block-level expressions. This is required by
method inlining. Temporarily fail a test case.

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

14 years agoOnly apply -fvisibility-inlines-hidden to definitions. Apparently
John McCall [Mon, 1 Nov 2010 01:29:57 +0000 (01:29 +0000)]
Only apply -fvisibility-inlines-hidden to definitions.  Apparently
isInlined() just gives meaningless results for non-definitions.

Fixes rdar://problem/8614470

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

14 years agoGet rid of more calls to getBaseClassOffsetInBits.
Anders Carlsson [Mon, 1 Nov 2010 00:21:58 +0000 (00:21 +0000)]
Get rid of more calls to getBaseClassOffsetInBits.

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

14 years agoPort over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset...
Anders Carlsson [Sun, 31 Oct 2010 23:45:59 +0000 (23:45 +0000)]
Port over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset instead.

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

14 years agoRename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOff...
Anders Carlsson [Sun, 31 Oct 2010 23:22:37 +0000 (23:22 +0000)]
Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.

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

14 years agoStart converting over the RecordLayoutBuilder next.
Anders Carlsson [Sun, 31 Oct 2010 22:20:42 +0000 (22:20 +0000)]
Start converting over the RecordLayoutBuilder next.

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

14 years agoEmptyObjectMap now uses CharUnits wherever possible.
Anders Carlsson [Sun, 31 Oct 2010 22:13:23 +0000 (22:13 +0000)]
EmptyObjectMap now uses CharUnits wherever possible.

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

14 years agoMore CharUnits conversion.
Anders Carlsson [Sun, 31 Oct 2010 21:54:55 +0000 (21:54 +0000)]
More CharUnits conversion.

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

14 years agoMore CharUnits conversion.
Anders Carlsson [Sun, 31 Oct 2010 21:39:24 +0000 (21:39 +0000)]
More CharUnits conversion.

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

14 years agoUse CharUnits in the EmptyClassOffsets map.
Anders Carlsson [Sun, 31 Oct 2010 21:22:43 +0000 (21:22 +0000)]
Use CharUnits in the EmptyClassOffsets map.

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

14 years agoAdd a DenseMapInfo specializaiton for CharUnits.
Anders Carlsson [Sun, 31 Oct 2010 21:17:03 +0000 (21:17 +0000)]
Add a DenseMapInfo specializaiton for CharUnits.

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

14 years agoCorrect typos and whitespace, spotted by Nico Weber!
Nick Lewycky [Sun, 31 Oct 2010 21:07:24 +0000 (21:07 +0000)]
Correct typos and whitespace, spotted by Nico Weber!

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

14 years agoFix typo spotted by Nico Weber.
Nick Lewycky [Sun, 31 Oct 2010 21:04:33 +0000 (21:04 +0000)]
Fix typo spotted by Nico Weber.

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

14 years agoBaby steps towards using only CharUnits for base class offsets in ASTRecordLayout...
Anders Carlsson [Sun, 31 Oct 2010 21:01:46 +0000 (21:01 +0000)]
Baby steps towards using only CharUnits for base class offsets in ASTRecordLayout. Start by storing the offsets in CharUnits in the ASTRecordLayout object.

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

14 years agoTeach the constant expr evaluator about derived-to-base casts when no virtual bases...
Anders Carlsson [Sun, 31 Oct 2010 20:41:46 +0000 (20:41 +0000)]
Teach the constant expr evaluator about derived-to-base casts when no virtual bases are involved. Fixes PR5974.

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

14 years agoMake Clang static analyzer skip function template definitions. This fixes Clang...
Zhanyong Wan [Sun, 31 Oct 2010 04:22:34 +0000 (04:22 +0000)]
Make Clang static analyzer skip function template definitions.  This fixes Clang PR 8426, 8427, & 8433.  Reviewed by Ted Kremenek and Doug Gregor.

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

14 years agoDon't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes...
Anders Carlsson [Sun, 31 Oct 2010 01:21:47 +0000 (01:21 +0000)]
Don't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes PR8507.

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

14 years agoEmit an error when trying to form a pointer-to-member to a bitfield.
Argyrios Kyrtzidis [Sat, 30 Oct 2010 19:52:22 +0000 (19:52 +0000)]
Emit an error when trying to form a pointer-to-member to a bitfield.

As a bonus, avoids a crash on the IRGen side due to accepting invalid code.

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

14 years agorenamed: test/SemaCXX/ptrtomember-badcall.cpp -> test/SemaCXX/ptrtomember.cpp
Argyrios Kyrtzidis [Sat, 30 Oct 2010 19:52:19 +0000 (19:52 +0000)]
renamed:    test/SemaCXX/ptrtomember-badcall.cpp -> test/SemaCXX/ptrtomember.cpp

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

14 years agoRevert r117678, "Qualified 'id' should implement all of static class type's", it...
Daniel Dunbar [Sat, 30 Oct 2010 19:22:48 +0000 (19:22 +0000)]
Revert r117678, "Qualified 'id' should implement all of static class type's", it breaks things.

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

14 years agoTurns out that we may end up calling dladdr on GetExecutablePath, give it external...
Benjamin Kramer [Sat, 30 Oct 2010 17:32:40 +0000 (17:32 +0000)]
Turns out that we may end up calling dladdr on GetExecutablePath, give it external linkage to make sure the lookup works on all platforms.

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

14 years agoThis function doesn't need external linkage either.
Benjamin Kramer [Sat, 30 Oct 2010 14:28:41 +0000 (14:28 +0000)]
This function doesn't need external linkage either.

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

14 years agoBetter solution: calculate the visibility of functions and variables
John McCall [Sat, 30 Oct 2010 11:50:40 +0000 (11:50 +0000)]
Better solution:  calculate the visibility of functions and variables
independently of whether they're definitions, then teach IR generation to
ignore non-explicit visibility when emitting declarations.  Use this to
make sure that RTTI, vtables, and VTTs get the right visibility.

More of rdar://problem/8613093

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

14 years agoGCC faithfully calculates visibility for variables independently of
John McCall [Sat, 30 Oct 2010 09:18:49 +0000 (09:18 +0000)]
GCC faithfully calculates visibility for variables independently of
whether it's a declaration or not, then ignores that information for
declarations unless it was explicitly given.  It's not totally clear
how that should be mapped into a sane system, but make an effort.

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

14 years agoUse the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.
Benjamin Kramer [Sat, 30 Oct 2010 08:28:42 +0000 (08:28 +0000)]
Use the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.

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

14 years agoPreserve the template type parameter name when instantiating a templace.
Nick Lewycky [Sat, 30 Oct 2010 06:48:20 +0000 (06:48 +0000)]
Preserve the template type parameter name when instantiating a templace.
Fixes PR8489.

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

14 years agoRename alignof -> alignOf to avoid irritating C++'0x compilers,
Chris Lattner [Sat, 30 Oct 2010 05:14:06 +0000 (05:14 +0000)]
Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423

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

14 years agoFlush statements after writing each DECL_CXX_BASE_SPECIFIERS node
Douglas Gregor [Sat, 30 Oct 2010 04:28:16 +0000 (04:28 +0000)]
Flush statements after writing each DECL_CXX_BASE_SPECIFIERS node

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

14 years agoDon't remove the init expression from the initializer list if it had a semantic error.
Argyrios Kyrtzidis [Sat, 30 Oct 2010 01:06:26 +0000 (01:06 +0000)]
Don't remove the init expression from the initializer list if it had a semantic error.

We already flag the error with InitListChecker's hadError and we mess up the AST unnecessarily.
Fixes rdar://8605381.

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

14 years agoAdd test/SemaCXX/crash-PR7625.cpp into test/SemaCXX/crashes.cpp
Argyrios Kyrtzidis [Sat, 30 Oct 2010 01:06:23 +0000 (01:06 +0000)]
Add test/SemaCXX/crash-PR7625.cpp into test/SemaCXX/crashes.cpp

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

14 years agotest/SemaCXX/crash-8124080.cpp -> test/SemaCXX/crashes.cpp
Argyrios Kyrtzidis [Sat, 30 Oct 2010 01:06:21 +0000 (01:06 +0000)]
test/SemaCXX/crash-8124080.cpp -> test/SemaCXX/crashes.cpp

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

14 years agoAdd test case for <rdar://problem/8610363> (a bogus report of using an uninitialized...
Ted Kremenek [Sat, 30 Oct 2010 00:43:15 +0000 (00:43 +0000)]
Add test case for <rdar://problem/8610363> (a bogus report of using an uninitialized field).  This was
already fixed, but this serves for detecting regressions.

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

14 years agoMake the deserialization of macro definitions lazy, so that we can
Douglas Gregor [Sat, 30 Oct 2010 00:23:06 +0000 (00:23 +0000)]
Make the deserialization of macro definitions lazy, so that we can
load identifiers without loading their corresponding macro
definitions. This is likely to improve PCH performance slightly, and
reduces deserialization stack depth considerably when using
preprocessor metaprogramming.

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

14 years agoWhen list-initializing a vector, try to copy-initialize from vectors instead
John McCall [Sat, 30 Oct 2010 00:11:39 +0000 (00:11 +0000)]
When list-initializing a vector, try to copy-initialize from vectors instead
of descending into the subelements.

rdar://problem/8345836

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

14 years agoDon't test isRegularFile before calling eraseFromDisk, since
Dan Gohman [Fri, 29 Oct 2010 23:26:14 +0000 (23:26 +0000)]
Don't test isRegularFile before calling eraseFromDisk, since
eraseFromDisk does the same check. This avoids a stat call
in the common case.

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

14 years agoHandle Type.h a better way.
Dale Johannesen [Fri, 29 Oct 2010 23:24:33 +0000 (23:24 +0000)]
Handle Type.h a better way.

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

14 years agoImprove diagnostics reporting of un-implemented
Fariborz Jahanian [Fri, 29 Oct 2010 23:20:05 +0000 (23:20 +0000)]
Improve diagnostics reporting of un-implemented
methods in protocols when protocols are in system
headers and thus ignored. //rdar: //8227199

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

14 years agoGenerate bitcasts going in and out of MMX parameters
Dale Johannesen [Fri, 29 Oct 2010 23:12:32 +0000 (23:12 +0000)]
Generate bitcasts going in and out of MMX parameters
in asm's.  PR 8501, 8602988.
I don't like including Type.h where it is; the idea was
to get references to X86_MMXTy out of the common code.
Maybe there's a better way?

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

14 years agoUse CodeGenFunction's getContext(), for consistency.
Dan Gohman [Fri, 29 Oct 2010 22:47:07 +0000 (22:47 +0000)]
Use CodeGenFunction's getContext(), for consistency.

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

14 years agoThese functions don't need external linkage.
Dan Gohman [Fri, 29 Oct 2010 22:41:35 +0000 (22:41 +0000)]
These functions don't need external linkage.

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

14 years agoMake the deserialization of C++ base class specifiers lazy, improving
Douglas Gregor [Fri, 29 Oct 2010 22:39:52 +0000 (22:39 +0000)]
Make the deserialization of C++ base class specifiers lazy, improving
the performance of C++ PCH and reducing stack depth in the reader.

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

14 years agoRestore r117644, this time properly ignoring -fvisibility and type visibility
John McCall [Fri, 29 Oct 2010 22:22:43 +0000 (22:22 +0000)]
Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.

Apply visibility in IR gen to variables that are merely declared
and never defined.  We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.

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

14 years agoUse objdir != srcdir in the getting started doc.
Rafael Espindola [Fri, 29 Oct 2010 22:05:17 +0000 (22:05 +0000)]
Use objdir != srcdir in the getting started doc.

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

14 years agoUpdate tests to not search of as.
Rafael Espindola [Fri, 29 Oct 2010 21:18:11 +0000 (21:18 +0000)]
Update tests to not search of as.

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

14 years agoSwitch to using the integrated assembler by default on x86 and x86-64 ELF
Rafael Espindola [Fri, 29 Oct 2010 20:14:02 +0000 (20:14 +0000)]
Switch to using the integrated assembler by default on x86 and x86-64 ELF
systems.

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

14 years agoIf Consumer object failed to create due to some
Fariborz Jahanian [Fri, 29 Oct 2010 19:49:13 +0000 (19:49 +0000)]
If Consumer object failed to create due to some
user error, fail gracefully. Fixes
pr8508.

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