[LLVMdev] [patch] Fix problems with build LLVM using gcc 4.1.0(gcc CVS mainline)
Chris Lattner
sabre at nondot.org
Sun Oct 23 23:41:45 PDT 2005
On Mon, 24 Oct 2005, Vladimir A. Merzliakov wrote:
>>> 2) Same error but some diff. problem with AlphaCodeEmitter.cpp and
>>> PPCCodeEmitter.cpp:
>>>
>>> GCC don't like definition member-functions in global namespace with
>>> declaration in llvm::<unnamed> :
>
> Sorry for wrong comment.
> Must be:
> GCC 4.1.0 don't like definition member-functions in llvm namespace with
> declaration in <global>::<unnamed> namespace
Ahhh, ok, I see. I just applied a patch to SparcV8. With it, does this
patch fix the problem?
===================================================================
RCS file: /home/vadve/shared/PublicCVS/llvm/utils/TableGen/CodeEmitterGen.cpp,v
retrieving revision 1.41
diff -u -r1.41 CodeEmitterGen.cpp
--- CodeEmitterGen.cpp 19 Aug 2005 01:04:33 -0000 1.41
+++ CodeEmitterGen.cpp 24 Oct 2005 06:40:56 -0000
@@ -76,7 +76,7 @@
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
EmitSourceFileHeader("Machine Code Emitter", o);
- o << "namespace llvm {\n\n";
+ //o << "namespace llvm {\n\n";
std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::";
// Emit function declaration
@@ -256,5 +256,5 @@
<< " return Value;\n"
<< "}\n\n";
- o << "} // End llvm namespace \n";
+ //o << "} // End llvm namespace \n";
}
-Chris
> For example
>
> PPCCodeEmitter.cpp:
>
> using namespace llvm;
>
> namespace {
> class PPCCodeEmitter : public MachineFunctionPass {
> ...
> }
> ...
> }
> ...
> #include "PPCGenCodeEmitter.inc"
>
> But PPCCodeEmitter.inc:
>
> namespace llvm {
> ...
> } // end llvm namespace
>
> As result LLVM build terminate with error:
>
> /usr/home/wanderer/pkg/build/llvm/obj/lib/Target/PowerPC/PPCGenCodeEmitter.inc:11:
> error: definition of 'unsigned
> int<unnamed>::PPCCodeEmitter::getBinaryCodeForInstr(llvm::MachineInstr&)' is
> not in namespace enclosing '<unnamed>::PPCCodeEmitter'
>
> After adding "namespace llvm {" in AlphaCodeEmitter.cpp
> gcc 4.1.0 terminate build with error:
> /home/wanderer/pkg/build/llvm/src/llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:76:
> error: explicit qualification in declaration of 'llvm::FunctionPass*
> llvm::createAlphaCodeEmitterPass(llvm::MachineCodeEmitter&)'
>
> As result I remove llvm:: from line:
> FunctionPass *llvm::createAlphaCodeEmitterPass(MachineCodeEmitter &MCE) {
>
> Vladimir
>
>
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list