Coder Social home page Coder Social logo

Comments (7)

bharadwajy avatar bharadwajy commented on May 25, 2024

Please share the error being encountered.

from llvm-mctoll.

zyt755 avatar zyt755 commented on May 25, 2024

Please share the error being encountered.

I receive expected unqualifield-id error.

/home/llvm-mctoll/llvm/tools/llvm-mctoll/Raiser/IncludedFileInfo.cpp:51:11: error: expected unqualified-id
    llvm::setCurrentDebugType(DEBUG_TYPE);
          
/home/llvm-mctoll/llvm/include/llvm/Support/Debug.h:70:32: note: expanded from macro 'setCurrentDebugType'
#define setCurrentDebugType(X) do { (void)(X); } while (false)
                               
/home/llvm-mctoll/llvm/tools/llvm-mctoll/Raiser/IncludedFileInfo.cpp:47:22: warning: private field 'Context' is not used [-Wunused-private-field]
  clang::ASTContext &Context;
                     ^
1 warning and 1 error generated.
gmake[3]: *** [tools/llvm-mctoll/Raiser/CMakeFiles/mctollRaiser.dir/build.make:90: tools/llvm-mctoll/Raiser/CMakeFiles/mctollRaiser.dir/IncludedFileInfo.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:81628: tools/llvm-mctoll/Raiser/CMakeFiles/mctollRaiser.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:81490: tools/llvm-mctoll/CMakeFiles/llvm-mctoll.dir/rule] Error 2
gmake: *** [Makefile:18376: llvm-mctoll] Error 2

from llvm-mctoll.

zyt755 avatar zyt755 commented on May 25, 2024

I comment the line and get the same error in another place.
And I comment it again.

/home/llvm-mctoll/llvm/tools/llvm-mctoll/llvm-mctoll.cpp:1589:9: error: expected unqualified-id                                 
  llvm::setCurrentDebugType(DEBUG_TYPE);                                                                                                          
        ^                                                                                                                                         
/home/llvm-mctoll/llvm/include/llvm/Support/Debug.h:70:32: note: expanded from macro 'setCurrentDebugType'                      
#define setCurrentDebugType(X) do { (void)(X); } while (false)                                                                                    
                               ^                                                                                                                  
1 warning and 1 error generated.                                                                                                                  
gmake[3]: *** [tools/llvm-mctoll/CMakeFiles/llvm-mctoll.dir/build.make:76: tools/llvm-mctoll/CMakeFiles/llvm-mctoll.dir/llvm-mctoll.cpp.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....                                                                                                     
gmake[2]: *** [CMakeFiles/Makefile2:81483: tools/llvm-mctoll/CMakeFiles/llvmmctoll.dir/all] Error 2                                              
gmake[1]: *** [CMakeFiles/Makefile2:81490: tools/llvm-mctoll/CMakeFiles/llvm-mctoll.dir/rule] Error 2                                             
gmake: *** [Makefile:18376: llvm-mctoll] Error 2 

In the end, I get following result.

[100%] Linking CXX executable ../../bin/llvm-mctoll
/usr/bin/ld: ../../lib/libmctollX86Raiser.a(X86MachineInstructionRaiser.cpp.o): in function `llvm::mctoll::X86MachineInstructionRaiser::raiseBinaryOpRegToRegMachineInstr(llvm::MachineInstr const& )': 
X86MachineInstructionRaiser.cpp:(.text._ZN4llvm6mctoll27X86MachineInstructionRaiser33raiseBinaryOpRegToRegMachineInstrERKNS_12MachineInstrE+0x26ec): undefined reference to `llvm::MachineInstr::dump() const' /usr/bin/ld: X86MachineInstructionRaiser.cpp:(.text._ZN4llvm6mctoll27X86MachineInstructionRaiser33raiseBinaryOpRegToRegMachineInstrERKNS_12MachineInstrE+0x2895): undefined reference to `llvm::Mac
hineInstr::dump() const'
/usr/bin/ld: X86MachineInstructionRaiser.cpp:(.text._ZN4llvm6mctoll27X86MachineInstructionRaiser33raiseBinaryOpRegToRegMachineInstrERKNS_12MachineInstrE+0x289d): undefined reference to `llvm::Mac
hineInstr::dump() const'
/usr/bin/ld: ../../lib/libmctollX86Raiser.a(X86MachineInstructionRaiser.cpp.o): in function `llvm::mctoll::X86MachineInstructionRaiser::raiseBinaryOpMemToRegInstr(llvm::MachineInstr const&, llvm::Value*)':X86MachineInstructionRaiser.cpp:(.text._ZN4llvm6mctoll27X86MachineInstructionRaiser26raiseBinaryOpMemToRegInstrERKNS_12MachineInstrEPNS_5ValueE+0x199a): undefined reference to `llvm::MachineInstr
::dump() const'
/usr/bin/ld: ../../lib/libmctollX86Raiser.a(X86MachineInstructionRaiser.cpp.o): in function `llvm::mctoll::X86MachineInstructionRaiser::raiseCallMachineInstr(llvm::MachineInstr const&)':
X86MachineInstructionRaiser.cpp:(.text._ZN4llvm6mctoll27X86MachineInstructionRaiser21raiseCallMachineInstrERKNS_12MachineInstrE+0x1603): undefined reference to `llvm::Type::dump() const'
/usr/bin/ld: ../../lib/libmctollX86Raiser.a(X86MachineInstructionRaiserSSE.cpp.o): in function `llvm::mctoll::X86MachineInstructionRaiser::raiseSSEConvertPrecisionMachineInstr(llvm::MachineInstr const&)':
X86MachineInstructionRaiserSSE.cpp:(.text._ZN4llvm6mctoll27X86MachineInstructionRaiser36raiseSSEConvertPrecisionMachineInstrERKNS_12MachineInstrE+0x282): undefined reference to `llvm::MachineInstr::dump() const'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [tools/llvm-mctoll/CMakeFiles/llvm-mctoll.dir/build.make:258: bin/llvm-mctoll] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:81483: tools/llvm-mctoll/CMakeFiles/llvm-mctoll.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:81490: tools/llvm-mctoll/CMakeFiles/llvm-mctoll.dir/rule] Error 2
gmake: *** [Makefile:18376: llvm-mctoll] Error 2

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on May 25, 2024

Thanks. I'll take a look as soon as I get a chance. In the meantime, can you make sure that the tip of your llvm-project tree matches the commit listed in llvm-project-git-commit-to-use.txt.

from llvm-mctoll.

zyt755 avatar zyt755 commented on May 25, 2024

Thanks. I'll take a look as soon as I get a chance. In the meantime, can you make sure that the tip of your llvm-project tree matches the commit listed in llvm-project-git-commit-to-use.txt.

Thanks. Yes, I'm sure llvm-project tree matches the commit listed in llvm-project-git-commit-to-use.txt because I compiled the mctoll project many times and only failed when disable assertions.

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on May 25, 2024

Can you please try

  1. applying the following patch
diff --git a/Raiser/IncludedFileInfo.cpp b/Raiser/IncludedFileInfo.cpp
index 9b9e1e9..e3d4ca2 100644
--- a/Raiser/IncludedFileInfo.cpp
+++ b/Raiser/IncludedFileInfo.cpp
@@ -48,7 +48,9 @@ class FuncDeclVisitor : public clang::RecursiveASTVisitor<FuncDeclVisitor> {
 
 public:
   FuncDeclVisitor(clang::ASTContext &Context) : Context(Context) {
+#ifndef NDEBUG
     llvm::setCurrentDebugType(DEBUG_TYPE);
+#endif
   }
 
   bool VisitFunctionDecl(clang::FunctionDecl *FuncDecl) {
diff --git a/llvm-mctoll.cpp b/llvm-mctoll.cpp
index ecea0fb..77c5a3a 100644
--- a/llvm-mctoll.cpp
+++ b/llvm-mctoll.cpp
@@ -1585,8 +1584,9 @@ int main(int argc, char **argv) {
   // Disassemble contents of .text section.
   Disassemble = true;
   FilterSections.push_back(".text");
-
+#ifndef NDEBUG
   llvm::setCurrentDebugType(DEBUG_TYPE);
+#endif
   std::for_each(InputFNames.begin(), InputFNames.end(), dumpInput);
 
   return EXIT_SUCCESS;
  1. followed by configuring the build using the following command?
cmake -S llvm -B <build-dir> -G "Ninja"   \
      -DLLVM_TARGETS_TO_BUILD="X86;ARM"    \
     -DLLVM_ENABLE_PROJECTS="clang;lld"        \
     -DCLANG_DEFAULT_PIE_ON_LINUX=OFF     \
     -DCMAKE_BUILD_TYPE=Release \
     -DLLVM_ENABLE_DUMP=true

Thanks!

from llvm-mctoll.

zyt755 avatar zyt755 commented on May 25, 2024

Can you please try

  1. applying the following patch
diff --git a/Raiser/IncludedFileInfo.cpp b/Raiser/IncludedFileInfo.cpp
index 9b9e1e9..e3d4ca2 100644
--- a/Raiser/IncludedFileInfo.cpp
+++ b/Raiser/IncludedFileInfo.cpp
@@ -48,7 +48,9 @@ class FuncDeclVisitor : public clang::RecursiveASTVisitor<FuncDeclVisitor> {
 
 public:
   FuncDeclVisitor(clang::ASTContext &Context) : Context(Context) {
+#ifndef NDEBUG
     llvm::setCurrentDebugType(DEBUG_TYPE);
+#endif
   }
 
   bool VisitFunctionDecl(clang::FunctionDecl *FuncDecl) {
diff --git a/llvm-mctoll.cpp b/llvm-mctoll.cpp
index ecea0fb..77c5a3a 100644
--- a/llvm-mctoll.cpp
+++ b/llvm-mctoll.cpp
@@ -1585,8 +1584,9 @@ int main(int argc, char **argv) {
   // Disassemble contents of .text section.
   Disassemble = true;
   FilterSections.push_back(".text");
-
+#ifndef NDEBUG
   llvm::setCurrentDebugType(DEBUG_TYPE);
+#endif
   std::for_each(InputFNames.begin(), InputFNames.end(), dumpInput);
 
   return EXIT_SUCCESS;
  1. followed by configuring the build using the following command?
cmake -S llvm -B <build-dir> -G "Ninja"   \
      -DLLVM_TARGETS_TO_BUILD="X86;ARM"    \
     -DLLVM_ENABLE_PROJECTS="clang;lld"        \
     -DCLANG_DEFAULT_PIE_ON_LINUX=OFF     \
     -DCMAKE_BUILD_TYPE=Release \
     -DLLVM_ENABLE_DUMP=true

Thanks!

THX a lot! It works!

from llvm-mctoll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.