瀏覽代碼

some fixes

Andrea Gussoni 8 年之前
父節點
當前提交
b392187587
共有 4 個文件被更改,包括 3 次插入24 次删除
  1. 1 1
      source/Ast.h
  2. 1 1
      source/JIT.cpp
  3. 1 1
      source/Parser.cpp
  4. 0 21
      source/utils/t.ll

+ 1 - 1
source/Ast.h

@@ -148,7 +148,7 @@ public:
   }
 
   unsigned getBinaryPrecedence() const { return Precedence; }
-  //void CreateArgumentAllocas(Function *F);
+  void CreateArgumentAllocas(Function *F);
 };
 
 /// FunctionAST - This class represents a function definition itself.

+ 1 - 1
source/JIT.cpp

@@ -27,7 +27,7 @@ void InitializeModuleAndPassManager(void) {
   // HACK:: removed because not present in the full code listing and because of
   // errors in linking phase (libLLVMTransformUtils)
   // Promote allocas to registers.
-  //::TheFPM->add(createPromoteMemoryToRegisterPass());
+  //JITObjects::TheFPM->add(createPromoteMemoryToRegisterPass());
   // Do simple "peephole" optimizations and bit-twiddling optzns.
   JITObjects::TheFPM->add(createInstructionCombiningPass());
   // Reassociate expressions.

+ 1 - 1
source/Parser.cpp

@@ -397,8 +397,8 @@ static std::unique_ptr<PrototypeAST> ParsePrototype() {
 
   return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
                                          BinaryPrecedence);
+                                         
 }
-
 /// definition ::= 'def' prototype expression
 static std::unique_ptr<FunctionAST> ParseDefinition() {
   getNextToken(); // eat def.

+ 0 - 21
source/utils/t.ll

@@ -1,21 +0,0 @@
-declare double @foo()
-
-declare double @bar()
-
-define double @baz(double %x) {
-entry:
-  %ifcond = fcmp one double %x, 0.000000e+00
-  br i1 %ifcond, label %then, label %else
-
-then:       ; preds = %entry
-  %calltmp = call double @foo()
-  br label %ifcont
-
-else:       ; preds = %entry
-  %calltmp1 = call double @bar()
-  br label %ifcont
-
-ifcont:     ; preds = %else, %then
-  %iftmp = phi double [ %calltmp, %then ], [ %calltmp1, %else ]
-  ret double %iftmp
-}