Skip to content

gollvm: error: no matching function for call to llvm::LoadInst::LoadInst(llvm::Type*&, llvm::Value*&, std::string&) #39109

@codersguild

Description

@codersguild

What version of Go are you using (go version)?

$ go version
go version go1.12.10 linux/amd64

Does this issue reproduce with the latest release?

Yes.
I cloned the lastest version from
https://go.googlesource.com/gollvm/

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ns1server/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ns1server/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go-1.12"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.12/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build459238245=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I fixed one of the issues with MaybeAlign(). I changed it to Align() from llvm:Align().
I am trying a ninja build for gollvm using cmake & ninja-build.

I am getting the error as shown below.

/home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm.cpp:616:74: error: no matching function for call to ‘llvm::LoadInst::LoadInst(llvm::Type*&, llvm::Value*&, std::string&)’
  616 |     llvm::Instruction *loadInst = new llvm::LoadInst(vt, spaceVal, ldname);
      |                                                                          ^
In file included from /home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/IRBuilder.h:33,
                 from /home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm-irbuilders.h:18,
                 from /home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm-builtins.h:18,
                 from /home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm.cpp:15:
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:198:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::AtomicOrdering, llvm::SyncScope::ID, llvm::BasicBlock*)’
  198 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:198:3: note:   candidate expects 8 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:194:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::AtomicOrdering, llvm::SyncScope::ID, llvm::Instruction*)’
  194 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:194:3: note:   candidate expects 8 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:192:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::BasicBlock*)’
  192 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:192:3: note:   candidate expects 6 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:190:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::Instruction*)’
  190 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:190:3: note:   candidate expects 6 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:188:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::BasicBlock*)’
  188 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:188:3: note:   candidate expects 5 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:186:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Instruction*)’
  186 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:186:3: note:   candidate expects 5 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:185:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, llvm::BasicBlock*)’
  185 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, BasicBlock *InsertAtEnd);
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:185:3: note:   candidate expects 4 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:183:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, llvm::Instruction*)’
  183 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:183:3: note:   candidate expects 4 arguments, 3 provided

What did you expect to see?

A proper build success result.

What did you see instead?

An Error.

/home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm.cpp:616:74: error: no matching function for call to ‘llvm::LoadInst::LoadInst(llvm::Type*&, llvm::Value*&, std::string&)’
  616 |     llvm::Instruction *loadInst = new llvm::LoadInst(vt, spaceVal, ldname);
      |                                                                          ^
In file included from /home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/IRBuilder.h:33,
                 from /home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm-irbuilders.h:18,
                 from /home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm-builtins.h:18,
                 from /home/ns1server/workarea/llvm-project/llvm/tools/gollvm/bridge/go-llvm.cpp:15:
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:198:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::AtomicOrdering, llvm::SyncScope::ID, llvm::BasicBlock*)’
  198 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:198:3: note:   candidate expects 8 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:194:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::AtomicOrdering, llvm::SyncScope::ID, llvm::Instruction*)’
  194 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:194:3: note:   candidate expects 8 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:192:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::BasicBlock*)’
  192 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:192:3: note:   candidate expects 6 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:190:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::Instruction*)’
  190 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:190:3: note:   candidate expects 6 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:188:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::BasicBlock*)’
  188 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:188:3: note:   candidate expects 5 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:186:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Instruction*)’
  186 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:186:3: note:   candidate expects 5 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:185:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, llvm::BasicBlock*)’
  185 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, BasicBlock *InsertAtEnd);
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:185:3: note:   candidate expects 4 arguments, 3 provided
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:183:3: note: candidate: ‘llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, llvm::Instruction*)’
  183 |   LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr,
      |   ^~~~~~~~
/home/ns1server/workarea/llvm-project/llvm/include/llvm/IR/Instructions.h:183:3: note:   candidate expects 4 arguments, 3 provided
```.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions