Skip to content

Commit 6c965f7

Browse files
committed
Dejan's issue.
1 parent 8db35db commit 6c965f7

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ Three environment variables must be set to use these wrappers:
4949
Once the environment is set up, just use `wllvm` and `wllvm++` as your C
5050
and C++ compilers, respectively.
5151

52+
5253
In addition to the above environment variables the following can be optionally used:
5354

55+
* `LLVM_CC_NAME` can be set if your clang compiler is not called `clang` but
56+
something like `clang-3.7`. Similarly `LLVM_CXX_NAME` can be used to describe
57+
what the C++ is called. Note that in these sorts of cases, the environment
58+
variable `LLVM_COMPILER` should still be set to `clang` not `clang-3.7` etc.
59+
5460
* `LLVM_COMPILER_PATH` can be set to the absolute path to the folder that
5561
contains the compiler and other LLVM tools such as `llvm-link` to be used.
5662
This prevents searching for the compiler in your PATH environment variable.

driver/utils.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,16 +543,24 @@ def getBitcodeFileName(self, argFilter):
543543
class ClangBuilder(BuilderBase):
544544
def __init__(self, cmd, isCxx, prefixPath=None):
545545
super(ClangBuilder, self).__init__(cmd, isCxx, prefixPath)
546-
546+
547547
def getBitcodeCompiler(self):
548548
cc = self.getCompiler()
549549
return cc + ['-emit-llvm']
550550

551551
def getCompiler(self):
552552
if self.isCxx:
553-
return ['{0}clang++'.format(self.prefixPath)]
553+
cxx = os.getenv('LLVM_CXX_NAME')
554+
if cxx:
555+
return ['{0}{1}'.format(self.prefixPath, cxx)]
556+
else:
557+
return ['{0}clang++'.format(self.prefixPath)]
554558
else:
555-
return ['{0}clang'.format(self.prefixPath)]
559+
cc = os.getenv('LLVM_CC_NAME')
560+
if cc:
561+
return ['{0}{1}'.format(self.prefixPath, cc)]
562+
else:
563+
return ['{0}clang'.format(self.prefixPath)]
556564

557565
def getBitcodeArglistFilter(self):
558566
return ClangBitcodeArgumentListFilter(self.cmd)
@@ -566,7 +574,6 @@ def attachBitcode(self, argFilter):
566574
outFile = argFilter.getOutputFilename()
567575
attachBitcodePathToObject(bcname, outFile)
568576

569-
#iam: this should join the dodo soon, yes?
570577
class DragoneggBuilder(BuilderBase):
571578
def __init__(self, cmd, isCxx, prefixPath=None):
572579
super(DragoneggBuilder, self).__init__(cmd, isCxx, prefixPath)

0 commit comments

Comments
 (0)