- Feb 03, 2010
-
-
Douglas Gregor authored
that is in an anonymous namespace, give that function or variable internal linkage. This change models an oddity of the C++ standard, where names declared in an anonymous namespace have external linkage but, because anonymous namespace are really "uniquely-named" namespaces, the names cannot be referenced from other translation units. That means that they have external linkage for semantic analysis, but the only sensible implementation for code generation is to give them internal linkage. We now model this notion via the UniqueExternalLinkage linkage type. There are several changes here: - Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage when the declaration is in an anonymous namespace. - Added Type::getLinkage() to determine the linkage of a type, which is defined as the minimum linkage of the types (when we're dealing with a compound type that is not a struct/class/union). - Extended NamedDecl::getLinkage() to consider the linkage of the template arguments and template parameters of function template specializations and class template specializations. - Taught code generation to rely on NamedDecl::getLinkage() when determining the linkage of variables and functions, also considering the linkage of the types of those variables and functions (C++ only). Map UniqueExternalLinkage to internal linkage, taking out the explicit checks for isInAnonymousNamespace(). This fixes much of PR5792, which, as discovered by Anders Carlsson, is actually the reason behind the pass-manager assertion that causes the majority of clang-on-clang regression test failures. With this fix, Clang-built-Clang+LLVM passes 88% of its regression tests (up from 67%). The specific numbers are: LLVM: Expected Passes : 4006 Expected Failures : 32 Unsupported Tests : 40 Unexpected Failures: 736 Clang: Expected Passes : 1903 Expected Failures : 14 Unexpected Failures: 75 Overall: Expected Passes : 5909 Expected Failures : 46 Unsupported Tests : 40 Unexpected Failures: 811 Still to do: - Improve testing - Check whether we should allow the presence of types with InternalLinkage (in addition to UniqueExternalLinkage) given variables/functions internal linkage in C++, as mentioned in PR5792. - Determine how expensive the getLinkage() calls are in practice; consider caching the result in NamedDecl. - Assess the feasibility of Chris's idea in comment #1 of PR5792. llvm-svn: 95216
-
Chandler Carruth authored
llvm-svn: 95215
-
Zhongxing Xu authored
llvm-svn: 95214
-
Zhongxing Xu authored
llvm-svn: 95213
-
Zhongxing Xu authored
llvm-svn: 95212
-
Douglas Gregor authored
initializer. Grrr.... llvm-svn: 95211
-
Chris Lattner authored
llvm-svn: 95209
-
Chris Lattner authored
llvm-svn: 95208
-
Chris Lattner authored
so that llvm-mc -show-encoding prints like this: hlt ## encoding: [0xf4] instead of like this: hlt # encoding: [0xf4] llvm-svn: 95207
-
Chris Lattner authored
instead of textually. llvm-svn: 95206
-
Chris Lattner authored
of const ones. non-const ones aren't very useful, because you can't even, say, emit them. llvm-svn: 95205
-
Chris Lattner authored
llvm-svn: 95203
-
Chris Lattner authored
add -filetype=null for performance testing and remove -filetype=dynlib, which isn't planned to be implemented. llvm-svn: 95202
-
Chris Lattner authored
llvm-svn: 95201
-
Ted Kremenek authored
RegionStoreManager::InvalidateRegions() by adjusting the worklist to iterate over BindingKeys instead of MemRegions. We also only need to do the actual invalidation work on base regions, and for non-base regions just blow away their bindings. llvm-svn: 95200
-
Sam Weinig authored
Implement Doug's suggestion. Eliminate the Stmts pointer from CXXTryStmt and instead allocate the statements after the object. llvm-svn: 95199
-
Evan Cheng authored
llvm-svn: 95198
-
Sean Callanan authored
instructions on a single line. Also made it a bit more forgiving when it reports errors. llvm-svn: 95197
-
John McCall authored
as undefined. Fixes an assertion in APFloat::toString noticed by Dale. llvm-svn: 95196
-
Evan Cheng authored
Allow all types of callee's to be tail called. But avoid automatic tailcall if the callee is a result of bitcast to avoid losing necessary zext / sext etc. llvm-svn: 95195
-
Daniel Dunbar authored
- Requires backend support, which only exists for i386--darwin currently. No 'as' required: -- ddunbar@ozzy:tmp$ cat t.c int main() { return 42; } ddunbar@ozzy:tmp$ clang -m32 -integrated-as t.c ddunbar@ozzy:tmp$ ./a.out; echo $? 42 ddunbar@ozzy:tmp$ -- The random extra whitespace is how you know its working! :) llvm-svn: 95194
-
Ted Kremenek authored
not build a subregion map and instead do a single scan of the store. This is done by building "region clusters" that represent the collection of regions that have the same base region. Invalidating any region in a cluster means that they all should get invalidated. This change brought out a point that Zhongxing mentioned to me offline: the flattened memory binding has issues distinguishing between direct and default bindings. For example, setting the default value for an entire struct is the same as binding to the first element. To address this problem, I moved the binding "tag" (Direct or Default) from BindingVal to BdingKey (and removed BindingVal entirely). This requires us to do double lookups in some cases; and there is still much more cleanup that can be done. This change produced a noticeable speedup when analyzing sqlite3 (a reduction of 4% in running time). llvm-svn: 95193
-
Douglas Gregor authored
realize that CXXConstructExpr is always implicit, so we should just return its argument (if there is only one) rather than directly invoking the constructor. llvm-svn: 95192
-
Jeffrey Yasskin authored
llvm-svn: 95191
-
Sam Weinig authored
llvm-svn: 95190
-
David Chisnall authored
- Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit. - Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant. - Recognise @selector() expressions as valid static initialisers (as GCC does). - Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load. - Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this: - (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL) withObject: (id)object; Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes. - Made @selector() expressions emit type info if available and the runtime supports it. Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s. llvm-svn: 95189
-
Sebastian Redl authored
llvm-svn: 95188
-
Chris Lattner authored
.o files don't like that. llvm-svn: 95187
-
Chris Lattner authored
llvm-svn: 95186
-
Chris Lattner authored
llvm-svn: 95185
-
Chris Lattner authored
llvm-svn: 95184
-
Dale Johannesen authored
llvm-svn: 95183
-
Daniel Dunbar authored
llvm-svn: 95182
-
Chris Lattner authored
llvm-svn: 95181
-
Chris Lattner authored
llvm-svn: 95180
-
Chris Lattner authored
the streamer. Demo: $ cat t.ll define i32 @test() nounwind { ret i32 42 } $ llc t.ll -o - ... _test: movl $42, %eax ret $ llc t.ll -o t.o -filetype=obj $ otool -tv t.o t.o: (__TEXT,__text) section _test: 00000000 movl $0x0000002a,%eax 00000005 ret llvm-svn: 95179
-
Chris Lattner authored
the end of the instruction instead of expecting the caller to do it. This currently causes the asm-verbose instruction comments to be on the next line. llvm-svn: 95178
-
Chris Lattner authored
than DEBUG_VALUE :( ) into the target indep AsmPrinter.cpp file. This allows elimination of the NO_ASM_WRITER_BOILERPLATE hack among other things. llvm-svn: 95177
-
John McCall authored
appropriately. Call out a few missing cases in the expression mangler. llvm-svn: 95176
-
Chris Lattner authored
llvm-svn: 95175
-